-
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
Add circuit breaker for max number of actions by connector type #128319
Add circuit breaker for max number of actions by connector type #128319
Conversation
…specific action config.
Pinging @elastic/response-ops (Team:ResponseOps) |
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.
kibana-docker LGTM
x-pack/plugins/alerting/server/task_runner/create_execution_handler.ts
Outdated
Show resolved
Hide resolved
Pass actions config map to execution_handler
… into 126504-connector-type-overrides
@elasticmachine merge upstream |
x-pack/plugins/alerting/server/task_runner/create_execution_handler.ts
Outdated
Show resolved
Hide resolved
@ersin-erdal Thank you for making the changes to the config! Those look great. I left a question about whether we're actually capping by connector type in the |
… into 126504-connector-type-overrides
…connector-type-overrides � Conflicts: � x-pack/plugins/alerting/server/plugin.ts � x-pack/plugins/alerting/server/task_runner/task_runner.test.ts � x-pack/plugins/alerting/server/task_runner/task_runner_factory.ts
I created an When I set my config to:
I see 20 active server log entries and 8 recovered server log entries. This works as expected. When I set my config to:
I would expect to see 5 active server log entries. Instead I see 20 active server log entries and no recovered server log entries. |
Fixed :) |
…connector-type-overrides � Conflicts: � x-pack/plugins/alerting/server/task_runner/create_execution_handler.test.ts � x-pack/plugins/alerting/server/types.ts
@elasticmachine merge upstream |
…connector-type-overrides � Conflicts: � x-pack/plugins/alerting/server/config.ts � x-pack/plugins/alerting/server/lib/rule_execution_status.ts � x-pack/plugins/alerting/server/task_runner/create_execution_handler.test.ts � x-pack/plugins/alerting/server/task_runner/create_execution_handler.ts � x-pack/plugins/alerting/server/task_runner/task_runner.test.ts � x-pack/plugins/alerting/server/task_runner/task_runner.ts � x-pack/plugins/alerting/server/task_runner/types.ts
… into 126504-connector-type-overrides
Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>
… into 126504-connector-type-overrides
src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker
Outdated
Show resolved
Hide resolved
x-pack/plugins/alerting/server/task_runner/create_execution_handler.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/alerting/server/task_runner/create_execution_handler.ts
Outdated
Show resolved
Hide resolved
x-pack/test/alerting_api_integration/spaces_only/tests/alerting/capped_action_type.ts
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, left a nit comment
}; | ||
|
||
// Checkers | ||
public hasReachedTheExecutableActionsLimit = (actionsConfigMap: ActionsConfigMap): boolean => |
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: seems like for this and the next hasReached...()
method, we could pass the actionsConfigMap()
into the constructor, so we wouldn't have to pass it into these methods directly. Haven't seen where it's used, but it could save having to pass the configMap object around with this object ... OTOH, perhaps there is a reason we do this, or we already have it available and the current structure makes it easier to test ...
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 could be moved in to this class but they are completely different objects.
This class is to hold ruleRunMetrics while actionsConfigMap is the config object from kibana.yml...
Maybe later we can do this refactoring, lets discuss :)
💚 Build SucceededMetrics [docs]Public APIs missing comments
Public APIs missing exports
History
To update your PR or re-run it, just comment with: |
…tic#128319) * connectorTypeOverrides key in kibana.yml can create a connector type specific action config. * Update docs and docker allowed keys
fixes: #126504
Summary
This PR intends to introduce a new kibana.yml config key that can override the actions.max circuit breaker by connector type(s)
To Verify
Create a rule that has more than one actions of the same type (e.g. Server Log).
Add the below config to your kibana.yml and expect only one of your actions to be triggered.
number_of_triggered_actions
value in event log should be1
.And a warning banner on rule details page should be shown.