Closed rlehner-dk closed 9 months ago
Hi @rlehner-dk,
the actual result looks correct to me. The single buckets work like counters for values which are less or equal than le
. At least I am thinking it should work like that.
Hello @rlehner-dk,
The actual outcome is indeed correct, since Prometheus histogram is a cumulative one. You have submitted the following 12 values:
0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
Hence, you have all 12 values being less than
or equal to
2, and hence all buckets from 2 and above should have a count of 12.
Hey folks, thank you very much for clarification!
In short, the histogram metric adds the observation to the bucket instead of filling a new bucket. For more details, please refer to the example:
Registration of the metric
Actual Result
Expected Result
as needed for Prometheus - in an example: https://www.robustperception.io/how-does-a-prometheus-histogram-work/
The difference is, that because (my guess) the cumulative value in the observation does not change after
le="1"
, the package does not increment the bucket counter and therefore adding the value to the wrong bucket.I also suggest improving the examples, since it is not self descripting, how the histogram counter is used correctly.