-
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
[Security Solution] Extend Detection Engine Health API with top N rules by metrics #181169
base: main
Are you sure you want to change the base?
Conversation
7637471
to
be946aa
Compare
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
Pinging @elastic/security-solution (Team: SecuritySolution) |
Pinging @elastic/security-detection-rule-management (Team:Detection Rule Management) |
3d1d03a
to
3bc6a79
Compare
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: cc @maximpn |
Relates to: #125642
Summary
This PR extends Detection Engine Health API by adding top N (by default 10) rules grouped by metrics like execution duration or schedule delay.
Details
This PR is part of my OnWeek! project to investigate possible usage of LLM models for example ChatGPT provided by OpenAI to perform automatic rule monitoring by summarising problems in Detection Engine Health API responses and giving users instructions and advices to solve the problems.
Extending Detection Engine Health API by top N rules is beneficial on its own since it allows to easily spot problematic rules and investigate further manually. It could be super helpful while working on SDH.
The following API endpoints were extended
/internal/detection_engine/health/_cluster
/internal/detection_engine/health/_space
A number of extracted top N rules is controlled by
num_of_top_rules
body param. A default value is 10 rules.It's possible to set this param only by using a HTTP POST request (similar behavior for
interval
). When a HTTP GET request is used alway maximum of 10 top rules will be returned for each metric.The following metrics were added to show top N rules for each of them (measured in milliseconds)
The following response parts were extended by added a section under
top_rules
keystats_over_interval
)history_over_interval
)Response example
Cluster health response (truncated)