-
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
[Uptime] Fix alerting false positives #75577
[Uptime] Fix alerting false positives #75577
Conversation
Pinging @elastic/uptime (Team:uptime) |
ef45eeb
to
61e9c94
Compare
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.
Do we also need to fix the issue in x-pack/plugins/uptime/server/lib/requests/get_monitor_availability.ts ?
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 WFG
Did some manual testing here too
@elasticmachine merge upstream |
…justinkambic/kibana into uptime_fix-monitor-status-alert-filters
💚 Build SucceededBuild metrics
History
To update your PR or re-run it, just comment with: |
* Add test and modify code to account for complex filter input. * Avoid unnecessary nesting. * Simplify filtering code. * Use `must` instead of `should`. * Fix types. * Refresh snapshots. * Use `filter` instead of `must`. * Refactor to improve readability. * Resolve filtering issue for availability query. * Add test covering filter fix. * Removed unused var. Co-authored-by: Elastic Machine <[email protected]>
* Add test and modify code to account for complex filter input. * Avoid unnecessary nesting. * Simplify filtering code. * Use `must` instead of `should`. * Fix types. * Refresh snapshots. * Use `filter` instead of `must`. * Refactor to improve readability. * Resolve filtering issue for availability query. * Add test covering filter fix. * Removed unused var. Co-authored-by: Elastic Machine <[email protected]> # Conflicts: # x-pack/plugins/uptime/server/lib/requests/get_monitor_availability.ts # x-pack/plugins/uptime/server/lib/requests/get_monitor_status.ts
* [Uptime] Fix alerting false positives (#75577) * Add test and modify code to account for complex filter input. * Avoid unnecessary nesting. * Simplify filtering code. * Use `must` instead of `should`. * Fix types. * Refresh snapshots. * Use `filter` instead of `must`. * Refactor to improve readability. * Resolve filtering issue for availability query. * Add test covering filter fix. * Removed unused var. Co-authored-by: Elastic Machine <[email protected]> * Update broken snapshots. Co-authored-by: Elastic Machine <[email protected]>
Backported to: |
* [Uptime] Fix alerting false positives (#75577) * Add test and modify code to account for complex filter input. * Avoid unnecessary nesting. * Simplify filtering code. * Use `must` instead of `should`. * Fix types. * Refresh snapshots. * Use `filter` instead of `must`. * Refactor to improve readability. * Resolve filtering issue for availability query. * Add test covering filter fix. * Removed unused var. Co-authored-by: Elastic Machine <[email protected]> # Conflicts: # x-pack/plugins/uptime/server/lib/requests/get_monitor_availability.ts # x-pack/plugins/uptime/server/lib/requests/get_monitor_status.ts * Resolve type difference from master. * Refresh test snapshot. * Refresh snapshots. Co-authored-by: Elastic Machine <[email protected]>
Summary
Fixes #74069.
There are circumstances where complex filter logic causes
query.bool.filter
clauses to be rendered for ES queries. In these cases, the user-providedfilter
is overwriting filters that we use. It then causes alerts to trigger for monitors that areup
.I've added test cases to account for arrays and objects in this field. The coded that causes these tests to pass does not break any of the existing tests.
EDIT: while this error was discovered in the Monitor Status alert, it will also happen for the Availability query, which is composed in a very similar way. Since it's a small change to fix it, and it will be simpler to track for backporting, we will modify that code in the same patch.
Checklist
Delete any items that are not applicable to this PR.
For maintainers