[ResponseOps][Alerting] Do not return alerts from internally managed rule types#223453
[ResponseOps][Alerting] Do not return alerts from internally managed rule types#223453cnasikas merged 8 commits intoelastic:mainfrom
Conversation
|
Pinging @elastic/response-ops (Team:ResponseOps) |
kdelemme
left a comment
There was a problem hiding this comment.
Thanks for introducing this feature (and adding it into the streams rule), code LGTM. I just have a question regarding the SearchStrategy and its scope. Is the SearchStrategy also used by the alerting client?
It's not really a problem right now because we do search the alerts-as-data indices directly.
Thanks! No, the alerts client does not use he search strategy. It is only used by the UI atm. |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]History
cc @cnasikas |
| new Map( | ||
| Array.from(registeredRuleTypes).filter( | ||
| ([_id, ruleType]) => | ||
| ruleType.internallyManaged == null || !Boolean(ruleType.internallyManaged) |
There was a problem hiding this comment.
The first part should be redundant as Boolean() also checks for false, 0, "", null, undefined and NaN https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion
There was a problem hiding this comment.
If I use only !Boolean, it will filter out rule types that do not have the internallyManaged property defined. The property is optional, and all of the rule types aside from stream rules do not define it. I want to filter out only rule types that have the internallyManaged defined and set it to true.
|
@elasticmachine merge upstream |
|
Starting backport for target branches: 8.19 https://github.com/elastic/kibana/actions/runs/15776082363 |
…rule types (elastic#223453) ## Summary This PR introduces the concept of internally managed rule types. The purpose of this PR is to hide alerts in the alerts table in the UI produced by internally managed rule types. In following PRs, we will enhance the framework to handle more cases when the product requirements are clearer. If, in the future, the streams team wants to use the alerts table to show stream alerts, we could introduce a new parameter in the alerting API to allow alerts produced by internally managed rule types to be returned. Fixes: elastic#221379 cc @kdelemme @dgieselaar ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit 61113a0)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…anaged rule types (#223453) (#224653) # Backport This will backport the following commits from `main` to `8.19`: - [[ResponseOps][Alerting] Do not return alerts from internally managed rule types (#223453)](#223453) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Christos Nasikas","email":"christos.nasikas@elastic.co"},"sourceCommit":{"committedDate":"2025-06-20T09:42:01Z","message":"[ResponseOps][Alerting] Do not return alerts from internally managed rule types (#223453)\n\n## Summary\n\nThis PR introduces the concept of internally managed rule types. The\npurpose of this PR is to hide alerts in the alerts table in the UI\nproduced by internally managed rule types. In following PRs, we will\nenhance the framework to handle more cases when the product requirements\nare clearer. If, in the future, the streams team wants to use the alerts\ntable to show stream alerts, we could introduce a new parameter in the\nalerting API to allow alerts produced by internally managed rule types\nto be returned.\n\nFixes: https://github.com/elastic/kibana/issues/221379\n\ncc @kdelemme @dgieselaar \n\n### Checklist\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"61113a0c46a1d7610bdb28302949001e372ebf98","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","backport:version","v9.1.0","v8.19.0"],"title":"[ResponseOps][Alerting] Do not return alerts from internally managed rule types","number":223453,"url":"https://github.com/elastic/kibana/pull/223453","mergeCommit":{"message":"[ResponseOps][Alerting] Do not return alerts from internally managed rule types (#223453)\n\n## Summary\n\nThis PR introduces the concept of internally managed rule types. The\npurpose of this PR is to hide alerts in the alerts table in the UI\nproduced by internally managed rule types. In following PRs, we will\nenhance the framework to handle more cases when the product requirements\nare clearer. If, in the future, the streams team wants to use the alerts\ntable to show stream alerts, we could introduce a new parameter in the\nalerting API to allow alerts produced by internally managed rule types\nto be returned.\n\nFixes: https://github.com/elastic/kibana/issues/221379\n\ncc @kdelemme @dgieselaar \n\n### Checklist\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"61113a0c46a1d7610bdb28302949001e372ebf98"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/223453","number":223453,"mergeCommit":{"message":"[ResponseOps][Alerting] Do not return alerts from internally managed rule types (#223453)\n\n## Summary\n\nThis PR introduces the concept of internally managed rule types. The\npurpose of this PR is to hide alerts in the alerts table in the UI\nproduced by internally managed rule types. In following PRs, we will\nenhance the framework to handle more cases when the product requirements\nare clearer. If, in the future, the streams team wants to use the alerts\ntable to show stream alerts, we could introduce a new parameter in the\nalerting API to allow alerts produced by internally managed rule types\nto be returned.\n\nFixes: https://github.com/elastic/kibana/issues/221379\n\ncc @kdelemme @dgieselaar \n\n### Checklist\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"61113a0c46a1d7610bdb28302949001e372ebf98"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> --------- Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…rule types (elastic#223453) ## Summary This PR introduces the concept of internally managed rule types. The purpose of this PR is to hide alerts in the alerts table in the UI produced by internally managed rule types. In following PRs, we will enhance the framework to handle more cases when the product requirements are clearer. If, in the future, the streams team wants to use the alerts table to show stream alerts, we could introduce a new parameter in the alerting API to allow alerts produced by internally managed rule types to be returned. Fixes: elastic#221379 cc @kdelemme @dgieselaar ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Summary
This PR introduces the concept of internally managed rule types. The purpose of this PR is to hide alerts in the alerts table in the UI produced by internally managed rule types. In following PRs, we will enhance the framework to handle more cases when the product requirements are clearer. If, in the future, the streams team wants to use the alerts table to show stream alerts, we could introduce a new parameter in the alerting API to allow alerts produced by internally managed rule types to be returned.
Fixes: #221379
cc @kdelemme @dgieselaar
Checklist