Get total time a metric spends at a particular value

23 views
Skip to first unread message

Aniketh Suresh

unread,
Nov 15, 2021, 10:53:53 PM11/15/21
to Prometheus Users
Hello,
I'd like to get the total time a metric spends at a particular value.
For example, 
With a gauge, initially set to 0, set the value to 1 when a particular issue arises. I have an alert for when the value > 0. Once the issue is resolved, this gauge goes back to 0.
Now I can use:
floor(changes(issue[10m])/2), to get the number of times I ran into this issue.

Question:
How do I get the total time spend in that state/value? That way I know how long I spend trying to resolve the issue.

Thanks!
Reply all
Reply to author
Forward
0 new messages