-
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
[POC] Enable per-alert actions #154977
[POC] Enable per-alert actions #154977
Conversation
…ity solution rule page elastic#151916
…maries commit 7265666 Merge: db3fbee e80abe8 Author: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Thu Apr 13 09:17:32 2023 -0400 Merge branch 'main' into security_rule_context_alias commit db3fbee Author: Ying <ying.mao@elastic.co> Date: Wed Apr 12 16:41:31 2023 -0400 Using given intervals for time range, not deriving from alert data commit ca9b149 Author: Ying <ying.mao@elastic.co> Date: Wed Apr 12 14:59:33 2023 -0400 Aliasing context and state variables for detection rules in alert summaries
@elasticmachine merge upstream |
1 similar comment
@elasticmachine merge upstream |
createdAlerts.forEach((alert) => | ||
options.services.alertFactory | ||
.create(alert._id) | ||
.scheduleActions(type.defaultActionGroupId) |
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.
should include the context object in scheduleActions
call so per alert actions have context variables.
}; | ||
}) | ||
.filter((_, idx) => response.body.items[idx].create?.status === 201), | ||
createdAlerts, | ||
errors: errorAggregator(response.body, [409]), | ||
alertsWereTruncated, | ||
}; |
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.
there is an alertWithSuppression
function here that should also be updated to call the alertFactory.create
…ection rules in alert summary mode (#154864) Toward enabling per-action-alerts for detection rules #154977 ## Summary This PR provides the necessary changes for detection rules to fully onboard onto alerting framework alert summaries. * Aliases detection rule context and state variables for summary action variables. This provides backwards compatibility with the `context.alerts`, `context.results_link` and `state.signals_count` action variables that are currently used by detection rules. * Calculates time bounds for summary alerts that can be passed back to the view in app URL generator. This allows rule types to generate view in app URLs limited to the timeframe that will match the summary alerts time range * For throttled summary alerts, the time range is generated as `now - throttle duration` * For per execution summary alerts, we use the `previousStartedAt` time from the task state if available and the schedule duration if not available. This is because some rules write out alerts with `@timestamp: task.startedAt` so just using `now - schedule duration` may not capture those alerts due to task manager schedule delays. --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💔 Build FailedFailed CI StepsTest Failures
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @e40pud |
Summary
Summarize your PR. If it involves visual changes include a screenshot or gif.