Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic rules causes incorrect graphs in grafana #981

Open
sergeyshevch opened this issue Nov 14, 2023 · 3 comments
Open

Generic rules causes incorrect graphs in grafana #981

sergeyshevch opened this issue Nov 14, 2023 · 3 comments

Comments

@sergeyshevch
Copy link

Generic rules (pyrra_requests/errors_total) cause incorrect calculation in Grafana sum(rate(sum(metric)) instead of sum(rate(metric) that lead to spikes when one of counter resetting.

Article with explanation: https://www.robustperception.io/rate-then-sum-never-sum-then-rate/

Panel from SLO Detail dashboard:
Screenshot 2023-11-14 at 13 18 02

Graph with comparison to correct metric calculation
Screenshot 2023-11-14 at 13 19 01

Is it possible to overtake such issues in any way? Maybe store sum(rate() instead of sum and call metric as pyrra_requests_rate?

@sepulworld
Copy link
Contributor

Screenshot 2024-02-16 at 11 54 03 AM

I see the same issue while using Grafana. Seem to correlate to counter resets

@sepulworld
Copy link
Contributor

sepulworld commented Feb 16, 2024

@sergeyshevch are you able overcome this by changing the expr in the panel? I tried to use quantile_over_time but it doesn't work with vector data. I think this has to be fixed in Pyrra generic rules code

@sergeyshevch
Copy link
Author

sergeyshevch commented Feb 17, 2024

Pyrra should store rate/increase data instead of sum than it will be fixed.
I've done query for workaround on similar case but it will only work on VictoriaMetrics

I will share it later on next week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants