-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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 UI] Fix No Data alerts on Metric Threshold with groupBy #111465
Conversation
Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui) |
@elasticmachine merge upstream |
user doesn't have permission to update head repository |
Yes I do kibanamachine what are you talking about |
@elasticmachine merge upstream |
user doesn't have permission to update head repository |
Well imma break the law then whaddaya think of that |
Lol kibanamachine you don't own me |
@Zacqary ensure that |
@tylersmalley Ahh thank you, not sure how that got unchecked I blame kibanamachine. It has it out for me |
Looks good. Something that came up during a meeting: If there is no data for a rule, the consensus seemed to be that they don't expect a "no data" alert per group. That they would just expect the single no data alert. @jasonrhodes correct? Sounds more like a separate rule with this behavior. |
@neptunian yeah, this is why I think clarifying no-data + group by vs document count 0 + group by is going to be essential before we merge anything. Let's hash it out in a design doc and come back here to summarize. |
Let me see if I understand the expected behavior: 1. When alerting on a regular aggregation
00:00:00
00:01:00
2. When alerting on a document count
00:00:00
00:01:00
The expected result of scenario 2 is what I want to see, and this PR doesn't get us there. I'm not sure I understand why the expected result of scenario 1 is more desirable than the actual result from this PR. |
Agreed. I do find having this PR helpful, for me anyway, to understand all the gotchas and technical limitations in coming up with a solution. @Zacqary I agree. I think we need to define what "alert me if there's no data" means to the user. Whether its for no data across the board or for no documents for a particular group. |
@neptunian For what it's worth, I know of at least one other prominent, widely-used alerting stack in which No Data alerts fire on a per-group basis when you're dealing with a groupBy alert. I don't think we need to decide what "alert me on no data" means in the vacuum of our own software, I think we need to decide if we're deviating from the behavior that users in the space already expect, and why. |
So as it turns out, getting Document Count on a group to correctly report 0 instead of reporting as No Data is a one-line fix to this PR. I'm going to commit that just so a doc_count = 0 threshold functions as expected (since No Data isn't enabled by default in the UI). This change would make the No Data option well and truly irrelevant for the Document Count aggregator. Not sure if disabling that checkbox in the UI is within the scope of this PR. |
@elasticmachine merge upstream |
Were you going to commit that in a separate PR? |
@neptunian Sorry looks like it didn't merge when I tried to push it last week. It's committed now. |
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.
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]
History
To update your PR or re-run it, just comment with: |
…stic#111465) * [Metrics UI] Fix No Data alerts on Metric Threshold with groupBy * Fix typecheck * Add integration test for no data groupBy scenario * Uncomment test files * Uncomment test files * Reset stored groups when groupBy parameter changes * Test for groupBy arrays * Fix initial No Data result when no groups are detected yet * Fix linting error * Fix detecting groups with doc count 0 Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
…stic#111465) * [Metrics UI] Fix No Data alerts on Metric Threshold with groupBy * Fix typecheck * Add integration test for no data groupBy scenario * Uncomment test files * Uncomment test files * Reset stored groups when groupBy parameter changes * Test for groupBy arrays * Fix initial No Data result when no groups are detected yet * Fix linting error * Fix detecting groups with doc count 0 Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
…1465) (#113022) * [Metrics UI] Fix No Data alerts on Metric Threshold with groupBy * Fix typecheck * Add integration test for no data groupBy scenario * Uncomment test files * Uncomment test files * Reset stored groups when groupBy parameter changes * Test for groupBy arrays * Fix initial No Data result when no groups are detected yet * Fix linting error * Fix detecting groups with doc count 0 Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Zacqary Adam Xeper <Zacqary@users.noreply.github.com>
…1465) (#113021) * [Metrics UI] Fix No Data alerts on Metric Threshold with groupBy * Fix typecheck * Add integration test for no data groupBy scenario * Uncomment test files * Uncomment test files * Reset stored groups when groupBy parameter changes * Test for groupBy arrays * Fix initial No Data result when no groups are detected yet * Fix linting error * Fix detecting groups with doc count 0 Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Zacqary Adam Xeper <Zacqary@users.noreply.github.com>
…stic#111465) * [Metrics UI] Fix No Data alerts on Metric Threshold with groupBy * Fix typecheck * Add integration test for no data groupBy scenario * Uncomment test files * Uncomment test files * Reset stored groups when groupBy parameter changes * Test for groupBy arrays * Fix initial No Data result when no groups are detected yet * Fix linting error * Fix detecting groups with doc count 0 Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Summary
Fixes #111772
This fixes the Alert me when there's no data option on a Metric Threshold alert that uses an Alert per setting. Any previously detected groups will be stored in the rule state, and if they fail to be detected on the next execution, they'll be backfilled with
null
values so that they can report no data.UPDATE: Document count aggregated values will be backfilled with
0
instead, fixing the behavior ofdoc_count <= 0
rules.Testing
The integration test should cover this scenario, but to ensure it works with the actual Kibana stack:
groupBy
value, e.g.host.name
, and turn on Alert Me When There's No Data. Add a server log action for the Alert state. Either set a threshold that will not fire, or turn off the Alert on Status Change throttling, to ensure that you'll see a No Data alert (as No Data and Alert use the same status).Checklist