-
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
[ResponseOps][Alerting] Ability run a rule on-demand #139848
[ResponseOps][Alerting] Ability run a rule on-demand #139848
Conversation
…kibana into alerting/run-rule-immediately
Pinging @elastic/response-ops (Team:ResponseOps) |
...actions_ui/public/application/sections/rules_list/components/collapsed_item_actions.test.tsx
Show resolved
Hide resolved
...plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list.tsx
Outdated
Show resolved
Hide resolved
…kibana into alerting/run-rule-immediately
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.
Left a few initial comments on the code. I'm wondering if we should do more with the user UX other than the toast message? I'm worried that users will click Run soon
for a rule that takes a minute to run and get impatient and keep trying to run the rule over and over again.
x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/run_soon.test.ts
Outdated
Show resolved
Hide resolved
Maybe as part of the |
…kibana into alerting/run-rule-immediately
I think that sounds good to do! With this change should I keep the toasts or change the ux to something else like you mentioned above? |
I think a toast is fine but might be worth pinging @mdefazio :) |
@mdefazio When a user selects |
@doakalexi Thanks for the ping. A few questions:
My gut reaction is to disable the button if it's currently running and avoid this scenario altogether. Might be odd with the overflow menu scenario (which leads to my question about only having this on the rule detail view). But ideally we would avoid this last scenario. Happy to hop on a zoom if it helps clear up some of these questions. |
My main thinking would be to get a rule out of an error state. For example, the Elastic license expired and the user renewed it, they'd want the rule to get out of error state. Another example could be a transient error and the user wants to re-run a specific rule. Another scenario could be modifying the rule and wanting to run the rule again with the updated configuration. They don't have a preview functionality today and will take some time to develop, so having this ad-hoc run functionality in the interim can be useful.
I don't think it's common enough yet to warrant a dedicated button. We could add telemetry to count how often each cluster uses this feature.
There most likely will be a disconnect between loading the rules list / details page and the current state of the rule (running, idle, etc) which makes disabling the button not the best option (the rule may have finished running after the page loaded and run rule now be used). The API could be enhanced so when the user clicks we can provide feedback if the rule is currently running at that time. For rules that were currently running and had a quick or short duration, it may not be necessary to add some UX as the rule ran when the user wanted it to. However, when a rule has been running for a while, the user may be trying to "run rule" to unblock it and some UX feedback could be useful.. And since we don't know the expected run duration of a currently running rule, the latter may be a better option (some UX feedback after clicking).. |
Thanks for the explanations @mikecote
Would this also lean towards having a 'Stop rule run' option as well? Assuming 'unblock' would mean stopping the process. I wanted to summarize some of the points you mentioned as I think they are really useful:
Assuming this option would be available for bulk actions as well? In which case, I can certainly see why some sort of messaging would be needed to inform the user that a rule is currently running. Wondering if instead of saying 'Run soon', we say something like 'Restart rule interval'. I understand that the rule run may not start right away, but wondering if this is a bit more actionable or immediate, rather than doing some 'soon'? |
We have a couple of challenges before this can be accomplished. In the meantime, the timeout logic will kick in to automatically stop rules from running too long (5 minutes).
This isn't a bad idea, we would have to think through the technical challenges when editing in bulk to not overwhelm the system. Maybe a follow up issue could be created? We have some logic when users change rule interval, but it doesn't run right away, just adjusts the schedule to respect the new interval based on the last time it ran.
Same as above, we may want to hold off on bulk capabilities to avoid the system from getting overwhelmed.
Summoning @lcawl for creative naming :) |
Sounds good @mikecote Thanks for the quick responses. I've setup a meeting with @doakalexi to walkthrough it all and will post any edits. |
Spoke with @doakalexi and the outcome was:
Future changes:
|
|
…kibana into alerting/run-rule-immediately
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! Works as expected :) Left some minor comments. It might also be nice to update the docs with this new feature cc @lcawl
...plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list.tsx
Show resolved
Hide resolved
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
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
Resolves #50215
Summary
runSoon
APIChecklist
To verify