-
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
[Discover] Cancel long running requests in Discover alert #130077
[Discover] Cancel long running requests in Discover alert #130077
Conversation
x-pack/plugins/alerting/server/lib/wrap_scoped_cluster_client.ts
Outdated
Show resolved
Hide resolved
…-long-running-requests-for-alert-rule # Conflicts: # x-pack/plugins/alerting/server/lib/wrap_scoped_cluster_client.ts # x-pack/plugins/alerting/server/types.ts # x-pack/plugins/stack_alerts/server/alert_types/es_query/lib/fetch_search_source_query.ts
@elasticmachine merge upstream |
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
…-long-running-requests-for-alert-rule # Conflicts: # x-pack/plugins/alerting/server/types.ts # x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/preview_rules_route.ts
@elasticmachine merge upstream |
@elasticmachine merge upstream |
…-long-running-requests-for-alert-rule # Conflicts: # x-pack/plugins/alerting/server/task_runner/task_runner.ts
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.
I did an initial pass, looking good! I had two questions before continuing my review 🙏
…-long-running-requests-for-alert-rule # Conflicts: # x-pack/plugins/alerting/common/rule_task_instance.ts # x-pack/plugins/alerting/server/lib/wrap_scoped_cluster_client.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/task_runner_cancel.test.ts
@elasticmachine merge upstream |
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.
I finished my review, I was able to see it working locally 👌 I think type check will catch this but some tests were still referencing searchSourceUtils
.
LGTM but I think we should sum up the metrics from search source and scoped cluster client before reporting them.
...security_solution/server/lib/detection_engine/routes/rules/utils/wrap_search_source_fetch.ts
Outdated
Show resolved
Hide resolved
…-long-running-requests-for-alert-rule # Conflicts: # x-pack/plugins/alerting/server/task_runner/task_runner.ts
@elasticmachine merge upstream |
1ea6a98
to
7ab49d7
Compare
@elasticmachine merge upstream |
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!
x-pack/plugins/alerting/server/lib/wrap_scoped_cluster_client.ts
Outdated
Show resolved
Hide resolved
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Unknown metric groupsReferences to deprecated APIs
History
To update your PR or re-run it, just comment with: cc @dmitriynj |
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.
Code LGTM 👍 , did not test, just review.
Only ask, there are plenty of changes under the hood that should be mentioned in the PR description ... like wrapping the searchSource client also get metrics
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
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!
Summary
Closes #128043
This PR adds ability to cancel
search source
request processing when it takes long within Discover alert rule.SearchSource
object instance was wraped to passabortSignal
.To propogate such behaviour per each further created
searchSource
children, the following methods were also overwritten:searchSource.createChild(...)
,searchSource.createCopy(...)
,searchSource.create(...)
,Checklist
Delete any items that are not applicable to this PR.