-
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
Ability run an alert immediately #50215
Comments
Pinging @elastic/kibana-stack-services (Team:Stack Services) |
Not sure we even need to use TM to do this - we could in theory just run the code in the Kibana process that requested it be run. I think that's what action execution via http request does. We should probably be consistent between these two, in any case. |
The only challenge doing that with the current structure may be the alert / alert instance state that is stored in the task manager. They wouldn't have access to it. Though there may be plans to move some of it outside of TM. |
Is the thinking that this would basically be like scheduling with a runAt of |
Ya, we need to think through this - I think this would be very similar to the "test" scenario as well, so may come with caveats like "you have no state". A different thing we could do would be to change the runAt as Gidi notes, which presumably WOULD give you state. And if we change the runAt, then the subsequent intervals would be relative to that new runAt - might be what the user wants, or not ... |
In addition the 'now' case, the ability to run the alert at some time in the past for testing purposes has been requested:
So if we could run the alert 'now' but also pass a timestamp parameter, and the alert condition is checked relative to that time. |
Somewhat related to #49411 |
Note this solution would have a gotcha: these kind of tasks would not be able to benefit from the distributed nature of multiple instances working the same task queue. I think that gotcha gets a bit nasty when Kibana administrators would want to make finegrain controls and have "lightweight" instances that serve a UI to multiple users, and can ONLY schedule tasks (not claim them), and "heavyweight" instances that are configured only for claiming tasks and not serving UI to end-users. I don't know if it's possible today with Task Manager to configure multiple instances for dedicated roles in tasks - but it would be a reasonable enhancement for tackling scaling a Kibana deployment. |
Moving from |
Closing as task manager has a run now API that can be used for this. |
Hi @ymao1, we are revisiting adding a "run now" functionality in Security Solution. Do you know if the alerting framework exposes this capability via the Alerting client? |
@peluja1012 The alerting rules client calls the task manager We could reopen this issue and update the description to add a wrapper around the task manager runNow in the alerting rules client. Alternatively, it looks like kibana/x-pack/plugins/alerting/server/rules_client/rules_client.ts Lines 938 to 949 in 0aee982
|
Thanks, @ymao1! We'll review our use case in more detail and let you know if calling the |
From #134400.
|
This feature should leverage the new task manager's |
Linking with #138124. If the framework can run a rule to run ad-hoc anytime, the framework should also be able to auto retry when encountering a socket hangup error (or other retry-able errors). |
Depends on #50214.
Maybe create an execute API similar to actions.
The text was updated successfully, but these errors were encountered: