prometheus icon indicating copy to clipboard operation
prometheus copied to clipboard

rate() function giving spurious peak

Open apeksharma opened this issue 3 years ago • 13 comments

What did you do? Plotting graph of a metric (say M) and the rate of that metric.

What did you expect to see? No deviation in normal graph of rate(M)

What did you see instead? Under which circumstances? Unexpected spike in the graph

image

Data points for that duration image

Environment

  • System information:

Don't have access to the system. Can get it if needed.

  • Prometheus version:

    2.18.1

image

  • Alertmanager version:

NA

  • Prometheus configuration file: Don't have access to the system. Can get it if needed.

  • Logs:

insert Prometheus and Alertmanager logs relevant to the issue here

apeksharma avatar Apr 03 '21 12:04 apeksharma

You probably have resets.

Can you please provide the raw metrics?

to do that, run mymetric{label="a"}[3h] in the "console" tabs.

roidelapluie avatar Apr 03 '21 20:04 roidelapluie

Thanks Julien for responding.

PFA raw metrics. Also, adding graphs from the exact same duration for easy correlation. image raw_metrics.txt

apeksharma avatar Apr 04 '21 08:04 apeksharma

You have a counter reset:

439 @1617442554.304 439 @1617442554.315 440 @1617442564.304 439 @1617442564.315 440 @1617442574.33 440 @1617442584.297

roidelapluie avatar Apr 04 '21 08:04 roidelapluie

It might be a bug in prometheus. Why is that scraped twice at the same time?

Can you are more about your configuration?

roidelapluie avatar Apr 04 '21 08:04 roidelapluie

cc: @sanjeevpandey19: Sanjeev, would you be able to help with above questions?

apeksharma avatar Apr 04 '21 09:04 apeksharma

Reminds me a bit of this issue: https://github.com/prometheus/prometheus/issues/6894

vsliouniaev avatar Apr 07 '21 21:04 vsliouniaev

I totally agree and I digged multiple times in the codebase without finding the bug yet...

roidelapluie avatar Apr 07 '21 23:04 roidelapluie

I see. Can close this in favor of earlier one then. Thanks Julien and Vasily

apeksharma avatar Apr 08 '21 15:04 apeksharma

Can you still provide the requested info please?

roidelapluie avatar Apr 08 '21 18:04 roidelapluie

Can you still provide the requested info please?

@roidelapluie what sort of specific information you need here.

Do you want to know if we have setup using operator or vanila Prometheus or you would need Prometheus.yaml itself ?

sanjeevpandey19 avatar Apr 09 '21 05:04 sanjeevpandey19

I'd like the prometheus.yml to see the relabeling rules and the jobs, if possible.

roidelapluie avatar Apr 12 '21 09:04 roidelapluie

@roidelapluie any update on this issue we are also facing the same issue in Prometheus 2.25.0 where in the rate() function has unexpected spikes in the data

dhruvp-8 avatar Apr 28 '21 22:04 dhruvp-8

Team, Is there any update on this issue.. We're also facing similar issue. But with increase() function

amey24kulkarni avatar Apr 02 '23 01:04 amey24kulkarni

Hello from the bug scrub.

It's still mysterious what's happening here. The best we know is that the reason is #6894, so let's bundle activities there and close this one.

beorn7 avatar Apr 09 '24 12:04 beorn7