Skip to content

[Incident management] Suggested dashboards are returned only for custom threshold alerts #224458

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

Merged
merged 7 commits into from
Jun 30, 2025

Conversation

cesco-f
Copy link
Contributor

@cesco-f cesco-f commented Jun 18, 2025

Suggested dashboards should return only for custom threshold alerts at the moment, we'll return an empty array for all the other rule type ids.

With this refactor whenever we want to add a new rule type id TS will make sure we also add a getRelevantRuleFields and a getRuleQueryIndex for the new rule type id.

@cesco-f cesco-f requested a review from a team as a code owner June 18, 2025 15:28
@botelastic botelastic bot added the Team:obs-ux-management Observability Management User Experience Team label Jun 18, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

@github-actions github-actions bot added the author:obs-ux-management PRs authored by the obs ux management team label Jun 18, 2025
@cesco-f cesco-f requested a review from dominiqueclarke June 18, 2025 16:41
@cesco-f cesco-f requested a review from a team as a code owner June 19, 2025 10:58
@mgiota
Copy link
Contributor

mgiota commented Jun 23, 2025

@elasticmachine merge upstream

fields as TECHNICAL_ALERT_FIELDS,
} from '@kbn/rule-data-utils';
import { CustomThresholdParams } from '@kbn/response-ops-rule-params/custom_threshold';
import { OBSERVABILITY_THRESHOLD_RULE_TYPE_ID } from '@kbn/rule-data-utils';
Copy link
Contributor

@mgiota mgiota Jun 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cesco-f OBSERVABILITY_THRESHOLD_RULE_TYPE_ID previously was also being imported from @kbn/rule-data-utils. Why did you separate the import here? Is this because of as TECHNICAL_ALERT_FIELDS?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had moved that constant to another file, and when I moved it back to this one, my IDE automatically imported it like that. I changed it back to how it was before.

@cesco-f cesco-f added the v9.2.0 label Jun 30, 2025
@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #58 / ESQL execution logic API @ess @serverless ES|QL rule type, alert suppression with exceptions should apply exceptions

Metrics [docs]

✅ unchanged

History

@cesco-f cesco-f merged commit 85c8d52 into elastic:main Jun 30, 2025
12 checks passed
@cesco-f cesco-f deleted the suggested-dashboards-bug-fix branch June 30, 2025 10:00
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19, 9.1

https://github.com/elastic/kibana/actions/runs/15969849465

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 30, 2025
…om threshold alerts (elastic#224458)

Suggested dashboards should return only for custom threshold alerts at
the moment, we'll return an empty array for all the other rule type ids.

With this refactor whenever we want to add a new rule type id TS will
make sure we also add a `getRelevantRuleFields` and a
`getRuleQueryIndex` for the new rule type id.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 85c8d52)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.19 Backport failed because of merge conflicts
9.1

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 224458

Questions ?

Please refer to the Backport tool documentation

@cesco-f
Copy link
Contributor Author

cesco-f commented Jun 30, 2025

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jun 30, 2025
…r custom threshold alerts (#224458) (#225792)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[Incident management] Suggested dashboards are returned only for
custom threshold alerts
(#224458)](#224458)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Francesco
Fagnani","email":"fagnani.francesco@gmail.com"},"sourceCommit":{"committedDate":"2025-06-30T10:00:01Z","message":"[Incident
management] Suggested dashboards are returned only for custom threshold
alerts (#224458)\n\nSuggested dashboards should return only for custom
threshold alerts at\nthe moment, we'll return an empty array for all the
other rule type ids.\n\nWith this refactor whenever we want to add a new
rule type id TS will\nmake sure we also add a `getRelevantRuleFields`
and a\n`getRuleQueryIndex` for the new rule type
id.\n\n---------\n\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"85c8d521c105e5caf7d171dcccc6a874b947a0ce","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:obs-ux-management","backport:version","v9.1.0","v8.19.0","author:obs-ux-management","v9.2.0"],"title":"[Incident
management] Suggested dashboards are returned only for custom threshold
alerts","number":224458,"url":"https://github.com/elastic/kibana/pull/224458","mergeCommit":{"message":"[Incident
management] Suggested dashboards are returned only for custom threshold
alerts (#224458)\n\nSuggested dashboards should return only for custom
threshold alerts at\nthe moment, we'll return an empty array for all the
other rule type ids.\n\nWith this refactor whenever we want to add a new
rule type id TS will\nmake sure we also add a `getRelevantRuleFields`
and a\n`getRuleQueryIndex` for the new rule type
id.\n\n---------\n\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"85c8d521c105e5caf7d171dcccc6a874b947a0ce"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/224458","number":224458,"mergeCommit":{"message":"[Incident
management] Suggested dashboards are returned only for custom threshold
alerts (#224458)\n\nSuggested dashboards should return only for custom
threshold alerts at\nthe moment, we'll return an empty array for all the
other rule type ids.\n\nWith this refactor whenever we want to add a new
rule type id TS will\nmake sure we also add a `getRelevantRuleFields`
and a\n`getRuleQueryIndex` for the new rule type
id.\n\n---------\n\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"85c8d521c105e5caf7d171dcccc6a874b947a0ce"}}]}]
BACKPORT-->

Co-authored-by: Francesco Fagnani <fagnani.francesco@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
cesco-f added a commit that referenced this pull request Jun 30, 2025
…or custom threshold alerts (#224458) (#225793)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Incident management] Suggested dashboards are returned only for
custom threshold alerts
(#224458)](#224458)

<!--- Backport version: 10.0.1 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Francesco
Fagnani","email":"fagnani.francesco@gmail.com"},"sourceCommit":{"committedDate":"2025-06-30T10:00:01Z","message":"[Incident
management] Suggested dashboards are returned only for custom threshold
alerts (#224458)\n\nSuggested dashboards should return only for custom
threshold alerts at\nthe moment, we'll return an empty array for all the
other rule type ids.\n\nWith this refactor whenever we want to add a new
rule type id TS will\nmake sure we also add a `getRelevantRuleFields`
and a\n`getRuleQueryIndex` for the new rule type
id.\n\n---------\n\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"85c8d521c105e5caf7d171dcccc6a874b947a0ce","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:obs-ux-management","backport:version","v9.1.0","v8.19.0","author:obs-ux-management","v9.2.0"],"title":"[Incident
management] Suggested dashboards are returned only for custom threshold
alerts","number":224458,"url":"https://github.com/elastic/kibana/pull/224458","mergeCommit":{"message":"[Incident
management] Suggested dashboards are returned only for custom threshold
alerts (#224458)\n\nSuggested dashboards should return only for custom
threshold alerts at\nthe moment, we'll return an empty array for all the
other rule type ids.\n\nWith this refactor whenever we want to add a new
rule type id TS will\nmake sure we also add a `getRelevantRuleFields`
and a\n`getRuleQueryIndex` for the new rule type
id.\n\n---------\n\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"85c8d521c105e5caf7d171dcccc6a874b947a0ce"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/225792","number":225792,"state":"OPEN"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/224458","number":224458,"mergeCommit":{"message":"[Incident
management] Suggested dashboards are returned only for custom threshold
alerts (#224458)\n\nSuggested dashboards should return only for custom
threshold alerts at\nthe moment, we'll return an empty array for all the
other rule type ids.\n\nWith this refactor whenever we want to add a new
rule type id TS will\nmake sure we also add a `getRelevantRuleFields`
and a\n`getRuleQueryIndex` for the new rule type
id.\n\n---------\n\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"85c8d521c105e5caf7d171dcccc6a874b947a0ce"}}]}]
BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author:obs-ux-management PRs authored by the obs ux management team backport:version Backport to applied version labels release_note:fix Team:obs-ux-management Observability Management User Experience Team v8.19.0 v9.1.0 v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants