Hi, I'm writing Prometheus client library and while trying to figure out how to expose histograms I found out that documentation is not really clear.
Docs: https://prometheus.io/docs/instrumenting/exposition_formats/#text-format-example Example shown there is the most basic one: # A histogram, which has a pretty complex representation in the text format: # HELP http_request_duration_seconds A histogram of the request duration. # TYPE http_request_duration_seconds histogram http_request_duration_seconds_bucket{le="0.05"} 24054 http_request_duration_seconds_bucket{le="0.1"} 33444 http_request_duration_seconds_bucket{le="0.2"} 100392 http_request_duration_seconds_bucket{le="0.5"} 129389 http_request_duration_seconds_bucket{le="1"} 133988 http_request_duration_seconds_bucket{le="+Inf"} 144320 http_request_duration_seconds_sum 53423 http_request_duration_seconds_count 144320 My questions are: 1. +Inf must be last? Or is it just a convention? 2. How about labels? "le" is the only allowed label or can there be more? 3. If there can be more labels then how about order of buckets? 4. "le" should be first or last label? Is below example ok (everything ordered alphabetically so +Inf is a first bucket, additional label added)? # TYPE latency_seconds histogram latency_seconds_bucket{upstream="bar",le="+Inf"} 123 latency_seconds_bucket{upstream="bar",le="0.001"} 1 latency_seconds_bucket{upstream="bar",le="0.002"} 5 latency_seconds_bucket{upstream="bar",le="0.003"} 6 latency_seconds_bucket{upstream="foo",le="+Inf"} 234 latency_seconds_bucket{upstream="foo",le="0.001"} 1 latency_seconds_bucket{upstream="foo",le="0.002"} 4 latency_seconds_bucket{upstream="foo",le="0.003"} 5 latency_seconds_count{upstream="bar"} 123 latency_seconds_count{upstream="foo"} 234 latency_seconds_sum{upstream="bar"} 5 latency_seconds_sum{upstream="foo"} 8 -- You received this message because you are subscribed to the Google Groups "Prometheus Users" 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-users/149642f6-9682-4ed2-a32f-651bfa9a24b2%40googlegroups.com.

