-
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] Remove defaultRuleTaskTimeout and set ruleType specific timeout from kibana.yml #128294
[Alerting] Remove defaultRuleTaskTimeout and set ruleType specific timeout from kibana.yml #128294
Conversation
1- Rule Type specific timeout from kibana.yml xpack.alerting.rules.execution.ruleTypeOverrides 2- Timeout that applies to all rule types, from kibana.yml xpack.alerting.rules.execution.timeout 3- ruleTaskTimeout from the source plugin 4- default timeout '5m'
@@ -286,18 +285,21 @@ export class AlertingPlugin { | |||
ActionGroupIds, | |||
RecoveryActionGroupId | |||
> | |||
) { | |||
) => { |
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.
Converted to an arrow function, so we can use this
in the function.
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
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! Verified the following:
- When no value is set for
xpack.alerting.rules.execution.timeout
, rule type timeouts are5m
for all rules except security rules. - When value is set for
xpack.alerting.rules.execution.timeout
, value is applied to all rules - When value is set for specific rule type using
xpack.alerting.rules.execution.ruleTypeOverrides
, value is applied to that specific rule type.
Nice job! Tagging @lcawl to review copy and @jbudz for a question about the docker allowlist
src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker
Show resolved
Hide resolved
src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker
Show resolved
Hide resolved
left a comment about timeout config priority
…24807-rule-task-timeout
@@ -207,3 +200,22 @@ Specifies the behavior when a new or changed rule has a schedule interval less t | |||
|
|||
`xpack.alerting.rules.execution.actions.max`:: | |||
Specifies the maximum number of actions that a rule can trigger each time detection checks run. | |||
|
|||
`xpack.alerting.rules.execution.timeout`:: |
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.
xpack.alerting.rules.execution.timeout
I know that it currently appears in our Rules UI, but "execution" is one of those words with violent connotations that we generally try to avoid. Is there some other term we can use that's less problematic? For example, "xpack.alerting.rules.tasks.timeout" or "xpack.alerting.rules.invocation.timeout", or just "xpack.alerting.rules.timeout"?
+ | ||
For example, `20m`, `24h`, `7d`, `1w`. Default: `5m`. | ||
|
||
`xpack.alerting.rules.execution.ruleTypeOverrides`:: |
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.
xpack.alerting.rules.execution.ruleTypeOverrides
::
Likewise, is it possible to omit "execution" from this setting name too? For example, just use "xpack.alerting.rules.typeOverrides" instead?
For example, `20m`, `24h`, `7d`, `1w`. Default: `5m`. | ||
|
||
`xpack.alerting.rules.execution.ruleTypeOverrides`:: | ||
Overrides the configs under `xpack.alerting.rules.execution` for the rule type with the given ID. The value is array of objects consists of the key(s) that are wanted to be overridden under execution object and the id of the specific rule type that is wanted to be modified. |
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.
Overrides the configs under
xpack.alerting.rules.execution
for the rule type with the given ID.
This makes me wonder if the configs referred to here are in some other file or UI. If not, this might be clearer:
"Overrides xpack.alerting.rules.*
settings for a specific rule identifier.
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.
Changes LGTM! I tested the different mechanisms locally and saw it work! Great work
|
||
export const getRuleTaskTimeout = ({ | ||
config, | ||
ruleTaskTimeout, |
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.
optional nit: to make the naming of this variable clearer, what if it was called something like ruleTypeProposedTimeout
?
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
fixes: #124807
doc preview: https://kibana_128294.docs-preview.app.elstc.co/guide/en/kibana/master/alert-action-settings-kb.html#alert-settings
Summary
This PR intends to remove
defaultRuleTaskTimeout
config and useconfig.execution.timeout
key instead of it.The new key
config.execution.timeout
can be modified by the users globally or per rule type.To Verify
this.ruleType.executor
) code such as:await new Promise(r => setTimeout(r, 360000));
That would delay your rule execution for 6 minutes.
Index Threshold should timeout in 10s and the Security Rule in 5m.
You can see the error message in the rule detail page with the applied timeout config.
To try global timeout config remove
ruleTypeOverrides
from your kibana.yml and run the kibana again...You should see 30s in the error message on the rule details page.
Checklist
Delete any items that are not applicable to this PR.