Skip to content

[8.19] Optimize bulk actions endpoint & update gaps (#222158)#224660

Merged
nkhristinin merged 2 commits intoelastic:8.19from
nkhristinin:backport/8.19/pr-222158
Jun 20, 2025
Merged

[8.19] Optimize bulk actions endpoint & update gaps (#222158)#224660
nkhristinin merged 2 commits intoelastic:8.19from
nkhristinin:backport/8.19/pr-222158

Conversation

@nkhristinin
Copy link
Contributor

Backport

This will backport the following commits from main to 8.19:

Questions ?

Please refer to the Backport tool documentation

These optimizations aim to improve the performance of the bulk actions
endpoint.

The first optimization has to do with how we resolve rules before
executing the bulk actions. Before this PR we were doing this
sequentially, but a `bulkGet` method has been added to the rules action
client.

The second optimization greatly improves the update gaps routine that
occurs after a backfill is scheduled (see the before and after
screenshots below).

The following screenshots were taken under these conditions:
I triggered a manual run bulk action on 1 rule (5m) with 1000 gaps over
a period of 90 days.

Before:

![image](https://github.com/user-attachments/assets/44afc653-690c-4b04-b333-7b84faa19c25)

After:

![image](https://github.com/user-attachments/assets/31cec3f3-dd21-4e1e-a5e3-a957bbcbba03)
Use [this tool](https://github.com/elastic/security-documents-generator)
to create 1 rule (5m) with 1000 gaps.
```
yarn start rules --rules 1 -g 1000 -c -i"5m"
```

Then do a manual run on it for a period of 90 days.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 1109f52)
@nkhristinin nkhristinin added the backport This PR is a backport of another PR label Jun 20, 2025
@nkhristinin nkhristinin added the backport This PR is a backport of another PR label Jun 20, 2025
@nkhristinin nkhristinin enabled auto-merge (squash) June 20, 2025 10:31
@elasticmachine
Copy link
Contributor

elasticmachine commented Jun 20, 2025

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts / Stateful Observability - Deployment-agnostic API integration tests Observability Alerting Synthetics Alerting SyntheticsCustomStatusRule NumberOfChecks - Location threshold > 1 - ungrouped - 2 down locations should be down again
  • [job] [logs] x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts / Stateful Observability - Deployment-agnostic API integration tests Observability Alerting Synthetics Alerting SyntheticsCustomStatusRule NumberOfChecks - Location threshold > 1 - ungrouped - 2 down locations should be down again

Metrics [docs]

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
alerting 53 54 +1
Unknown metric groups

ESLint disabled line counts

id before after diff
alerting 96 97 +1

Total ESLint disabled count

id before after diff
alerting 103 104 +1

History

@nkhristinin
Copy link
Contributor Author

@elasticmachine merge upstream

@nkhristinin nkhristinin merged commit e911ba3 into elastic:8.19 Jun 20, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants