We're using Lua + Nginx in high performance scenario (100k req/s+). We had to write our own implementation as there is no suitable clients open sourced.
> Label and row ordering doesn't really matter. According to Prometheus docs: "The buckets of a histogram and the quantiles of a summary must appear in increasing numerical order of their label values (for the le or the quantile label, respectively)." Source: https://prometheus.io/docs/instrumenting/exposition_formats/#histograms-and-summaries Is documentation wrong in that case? W dniu piątek, 10 kwietnia 2020 14:09:05 UTC+2 użytkownik Stuart Clark napisał: > > 1. There should be an inf bucket otherwise there might be entries that > don't appear in any, but are included in the count. > > 2. You can have other labels like any other metric, for example by status. > > 3 & 4. Label and row ordering doesn't really matter. > > What language are you using, as many of the client libraries have support > for histograms which sorts all this out for you? > > On 10 April 2020 12:49:55 BST, "Damian Kamiński" <[email protected] > <javascript:>> wrote: >> >> 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 >> >> >> > -- > Sent from my Android device with K-9 Mail. Please excuse my brevity. > -- 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/fadbbd0d-5091-4045-aad6-102b6e70f693%40googlegroups.com.

