-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Metrics Alerts] Fix error when a metric reports no data #59810
Conversation
Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui) |
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
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.
TIny flow-control nit.
const { buckets } = aggregations.aggregatedIntervals; | ||
const { value } = buckets[buckets.length - 1].aggregatedValue; | ||
return value; | ||
try { |
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.
Out of curiosity, why the try/catch here. Why not just explicit if (!buckets.length)
? Not a huge deal, but I'm afraid that intent is lost with try/catch.
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.
Fair enough, figured we wanted to guard for any error in retrieving the data but I'll see if I can clarify
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* master: [Metrics Alerts] Fix error when a metric reports no data (elastic#59810) Vislib legend toggle broken (elastic#59736) [RFC] Pulse (elastic#57108)
* [Metrics Alerts] Fix error when a metric reports no data * Clarify no data case handler, add separate error state * Throw error state when callCluster fails
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
Summary
Fixes #59809
Adds a
NO_DATA
alert state possibility, and sets this state if the alert can't find data over the specified lookup interval.