Hi,

Thank you for the answer. Is there a chance that we can standardize this in 
the OpenMetrics specs so that it is well defined and documented? This can 
help to avoid confusion and clearly state what is supported and what is 
not. Also, since Counter already can have an Exemplar and semantically 
_count is a Counter, everything should be available in the specs, this is 
mostly about "wiring" them together.

Also, what do you think about supporting _count in Histograms (since 
Histogram extends Summary with buckets)?

Thanks,
Jonatan

On Saturday, October 8, 2022 at 5:36:27 AM UTC-7 [email protected] wrote:

> Thanks a lot Bryan.
>
> I think if there is no technical obstacle, we should consider allowing 
> Exemplars for counts in OpenMetrics.
>
> Example: Counts are often used for error rates like this:
>
> sum(rate(http_server_duration_count{http_status_code=~"5.."}[5m])) / 
> sum(rate(http_server_duration_count[5m]))
>
> If the counts came with Exemplars, we could build a feature in Grafana to 
> visualize them on an "error rate" graph, i.e. you could click on an example 
> of an HTTP 500 error and navigate directly to the corresponding trace, or 
> to the logs filtered by trace ID.
>
> Fabian
>
>
> On Sat, Oct 8, 2022 at 2:28 PM Bryan Boreham <[email protected]> wrote:
>
>> I suspect the answer is that the OpenMetrics spec does not mention 
>> exemplars on Summaries.
>>
>> https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#summary
>>
>> I don't see any technical obstacle to attaching them in 
>> https://github.com/prometheus/client_golang.
>> Inside Prometheus, Summaries are just two metrics, so no special handling 
>> required.
>>
>> Bryan
>>
>> On Thursday, 6 October 2022 at 16:45:29 UTC-5 [email protected] wrote:
>>
>>> Hi,
>>>
>>> Great question from the CNCF Slack: What's the reason why we don't allow 
>>> Exemplars for _count in Summary metrics?
>>>
>>> Use case: Java's Micrometer provides a Summary with just a _count and a 
>>> _sum as the default metric for HTTP services. The _count has the HTTP 
>>> status code as a label, so these metrics are great for request rates and 
>>> error rates (and for average latencies if you have nothing better).
>>>
>>> However, there's currently no way to have exemplars. It would be nice to 
>>> have them, for example for investigating erroneous calls. If the _count was 
>>> an explicit counter, and not part of a summary, Exemplars would be 
>>> supported.
>>>
>>> What do you think? Any reason why Exemplars don't work in _count in 
>>> Summaries? Would that be something we could consider supporting?
>>>
>>> Fabian
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Prometheus Developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/prometheus-developers/34b54e23-51dc-4cfb-b00a-fc36a8d8c1bdn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/prometheus-developers/34b54e23-51dc-4cfb-b00a-fc36a8d8c1bdn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-developers/95f9a2bd-8b29-434f-8441-61675863cf4dn%40googlegroups.com.

Reply via email to