-
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
[Alerting] Allow rule to execute if the value is 0 and that mets the condition #105626
[Alerting] Allow rule to execute if the value is 0 and that mets the condition #105626
Conversation
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
x-pack/plugins/stack_alerts/server/alert_types/index_threshold/alert_type.ts
Outdated
Show resolved
Hide resolved
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. Just one nit about checking for undefined :)
@@ -180,7 +180,7 @@ export function getAlertType( | |||
groupResult.metrics && groupResult.metrics.length > 0 ? groupResult.metrics[0] : null; | |||
const value = metric && metric.length === 2 ? metric[1] : null; | |||
|
|||
if (!value) { | |||
if (value === null) { |
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.
nit: should we also check for value === undefined
just to cover all our bases?
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.
It also could be a shorter version:
if (value == null) {
but current way probably is more clear
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
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Test FailuresKibana Pipeline / general / Chrome UI Functional Tests.test/functional/apps/visualize/_metric_chart·ts.visualize app visualize ciGroup10 metric chart should show PercentilesStandard Out
Stack Trace
Metrics [docs]
History
To update your PR or re-run it, just comment with: |
…y-show-migrate-to-authzd-users * 'master' of github.com:elastic/kibana: (187 commits) Space management page UX improvements (elastic#100448) [Reporting] Unskip flaky test when downloading CSV with "no data" (elastic#105252) Update dependency @elastic/charts to v33 (master) (elastic#105633) [Observability RAC] Improve alerts table columns (elastic#105446) Introduce `preboot` lifecycle stage (elastic#103636) [Security Solution] Invalid kql query timeline refresh bug (elastic#105525) skip flaky suite (elastic#106121) [Security Solution][Endpoint] Fix UI inconsistency between isolation forms and remove display of Pending isolation statuses (elastic#106118) docs: APM RUM Source map API (elastic#105332) [CTI] Adds indicator match rule improvements (elastic#97310) [Security Solution] update text for Isolation action submissions (elastic#105956) EP Meta Telemetry Perf (elastic#104396) [Metrics UI] Drop partial buckets from ALL Metrics UI queries (elastic#104784) Remove beta admonitions for Fleet docs (elastic#106010) [Observability RAC] Remove indexing of rule evaluation documents (elastic#104970) Parameterize migration test for kibana version (elastic#105417) [Alerting] Allow rule to execute if the value is 0 and that mets the condition (elastic#105626) [ML] Fix Index data visualizer sometimes shows wrong doc count for saved searches (elastic#106007) [Security Solution] UX fixes for Policy page and Case Host Isolation comment (elastic#106027) [Security Solution]Memory protection configuration card for policies integration. (elastic#101365) ... # Conflicts: # x-pack/plugins/reporting/public/management/report_listing.test.tsx # x-pack/plugins/reporting/public/management/report_listing.tsx
Friendly reminder: Looks like this PR hasn’t been backported yet. |
…condition (elastic#105626) * Allow rule to execute if the value is 0 and that mets the condition * PR feedback * Fix type issue * PR feedback Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
…condition (#105626) (#106441) * Allow rule to execute if the value is 0 and that mets the condition * PR feedback * Fix type issue * PR feedback Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@chrisronline Can we also backport this bug fix to 7.14? |
@ymao1 Sure! |
…condition (elastic#105626) * Allow rule to execute if the value is 0 and that mets the condition * PR feedback * Fix type issue * PR feedback Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
…condition (#105626) (#107052) * Allow rule to execute if the value is 0 and that mets the condition * PR feedback * Fix type issue * PR feedback Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Resolves #103922
The index threshold alert wasn't properly handling cases where the query returned no results, but the condition matched with no results.
This PR addresses that by always checking the empty value against the condition.
To test, see the setup instructions in #103922