prometheus-plugs icon indicating copy to clipboard operation
prometheus-plugs copied to clipboard

Initialize counter metrics upon declaration

Open VitorTrin opened this issue 6 years ago • 2 comments

Declaring a counter does not mean it exists, as it will only have a value after the first inc. So, the fist time a counter is bumped it goes from not existing to 1, which makes it hard to create alert expressions. I propose that we manually assure the metric exists, (It can be done by doing a inc by 0) so we have stable counters.

Maybe this should be adressed by prometheus_ex? What you think?

VitorTrin avatar Nov 25 '19 15:11 VitorTrin

I think not only about alerts but also restarts... Maybe default value?

deadtrickster avatar Nov 25 '19 15:11 deadtrickster

What would a restart do? I haven't tested that yet.

VitorTrin avatar Nov 25 '19 15:11 VitorTrin