prometheus icon indicating copy to clipboard operation
prometheus copied to clipboard

PromQL: add an annotation (warning) for too many resets in a counter

Open bboreham opened this issue 7 months ago • 1 comments

Proposal

Users frequently come with questions about absurd results from rate, etc., when their problem is that the underlying data is oscillating.

Here is an example of oscillating underlying data: Image

We could warn when this is observed inside PromQL functions that take counters. For instance, if the query is rate(foo[5m]), and we see 5 data points with 4 resets, that would be "too many". Some number of resets is expected; a moderate number should not be warned about.

Suppose we set the bar at resets / points > 0.6 ?

bboreham avatar May 20 '25 11:05 bboreham

Can this proposal be implemented already? If so, I would like to work on it.

a3ylf avatar Jun 15 '25 22:06 a3ylf

0.6 with the second condition that there should be at least 4 samples.

roidelapluie avatar Jul 28 '25 13:07 roidelapluie

I don't mind your suggestion, but doing the math:

1 sample: can't have any resets. 2 samples: can have 1 reset or 0.5 ratio. 3 samples: can have 2 resets or 0.66 ratio, if all three points are descending.

What's the reason not to warn on the 3rd case?

bboreham avatar Jul 28 '25 14:07 bboreham

Hello from the bug scrub!

An open PR is under review for this, leaving open.

beorn7 avatar Oct 07 '25 12:10 beorn7