prom-client
prom-client copied to clipboard
fix: always use sum aggregator for sum & count
sum & count metrics of summary & histogram should always be summed irrespective of the custom aggregator that's mentioned as part of the metric definition.
Previously, aggregating the following two sample sets
set-1
http_duration_seconds{quantile="0.95"} 4
http_duration_seconds_sum 10
http_duration_seconds_count 5
set-2
http_duration_seconds{quantile="0.95"} 6
http_duration_seconds_sum 20
http_duration_seconds_count 5
using average
yields the following where every metric is averaged
.
http_duration_seconds{quantile="0.95"} 5
http_duration_seconds_sum 15
http_duration_seconds_count 5
The fix will always perform sum
for the sum
& count
yielding,
http_duration_seconds{quantile="0.95"} 5
http_duration_seconds_sum 30
http_duration_seconds_count 10
@SimenB @zbjornson Requesting for the review.