Reseting Histogram

13 views
Skip to first unread message

Błażej Suszka

unread,
Jun 7, 2024, 8:38:37 AMJun 7
to Prometheus Users
Hi, is it possible to reset histogram metric somehow?
I'm trying to get average latencies over time but as _sum is cumulatvie since deploying I can't differentiate that.

Thanks in advance for any suggesstions.

Thanks

Ben Kochie

unread,
Jun 7, 2024, 8:41:51 AMJun 7
to Błażej Suszka, Prometheus Users
There is no need to reset in order to get current average latencies. That's the beauty of cumulative counters.

The PromQL would look like this:

rate(my_histogram_seconds_sum[5m])
/
rate(my_histogram_seconds_count[5m])

You can adjust whatever range vector value to want in order to control the averaging window. Up to 2x your scrape interval of course.

--
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 prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/2de4ba8b-59e7-44e1-96f6-d3e2d73fae19n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages