Incorrect gauge usage: set to 0 and then increment a bunch of times?

8 views
Skip to first unread message

Andrew Watson

unread,
Jul 10, 2020, 3:23:00 PM7/10/20
to Prometheus Users
We've got some gauges we use to measure some fleets of vehicles and their status.  So every time we measure the fleet sizes we set the gauge to 0 and then loop through the vehicles and increment the right gauges based on status... 

But what happens is that the gauge values constantly go up so that even though there are really 50 vehicles the gauge quickly spirals up into the thousands...  

Is this combination of Set(0) and Inc() and incorrect approach for a gauge?

Other gauges where we only ever call Set() never have this issue.  Should I just increment a value in my code and then call Set once instead?
Reply all
Reply to author
Forward
0 new messages