-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Elasticsearch: Fix date histogram auto interval handling for alert queries #30049
Elasticsearch: Fix date histogram auto interval handling for alert queries #30049
Conversation
Thanks. This change seemed wrong to me at first sight. I was the one implementing the first version of backend support for elasticsearch. I wonder if something did change in Grafana alerting since last 3 years :) Cannot remember whether this has never worked as expected or not. Could be that Grafana alerting needs an update to solve this problem for "all" data sources I don't know right now. I need to run, but will continue reviewing this tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch. Added a suggestion, but other than that this looks good.
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thank you for contributing to Grafana! |
What this PR does / why we need it:
The current backend Golang code doesn't honor the minimum interval set in the UI for alerts. This means that the data the alerts are triggering against will never match the data in the visualization. For example, if you're monitoring AWS Cloudwatch EC2 data that only reports every 5 minutes and you set the minimum interval to
5m
, the alerts will not trigger correctly because it will use theauto
interval instead which for5m
of data defaults to200ms
.This PR fixes that by setting the minimum interval to the same value in the UI.
Which issue(s) this PR fixes:
Fixes #22082
Special notes for your reviewer: