Skip to content

[Alert details page] Use related alerts logic only for the custom threshold rule#193957

Merged
maryam-saeidi merged 7 commits intoelastic:mainfrom
maryam-saeidi:193943-ct-related-alerts
Sep 25, 2024
Merged

[Alert details page] Use related alerts logic only for the custom threshold rule#193957
maryam-saeidi merged 7 commits intoelastic:mainfrom
maryam-saeidi:193943-ct-related-alerts

Conversation

@maryam-saeidi
Copy link
Copy Markdown
Member

@maryam-saeidi maryam-saeidi commented Sep 25, 2024

Closes #193943

Summary

This PR only loads related alerts for the custom threshold rule and only when the related rule has tags or group by fields.

For now, we don't show this tab if there is no tag or group and there is a follow-up ticket for discussing the empty state for the related alerts.

Follow-up work

@maryam-saeidi maryam-saeidi self-assigned this Sep 25, 2024
@obltmachine
Copy link
Copy Markdown

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@maryam-saeidi maryam-saeidi added backport:prev-minor Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. release_note:skip Skip the PR/issue when compiling release notes labels Sep 25, 2024
@maryam-saeidi maryam-saeidi marked this pull request as ready for review September 25, 2024 09:53
@maryam-saeidi maryam-saeidi requested a review from a team as a code owner September 25, 2024 09:53
@elasticmachine
Copy link
Copy Markdown
Contributor

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

@botelastic botelastic Bot added the ci:project-deploy-observability Create an Observability project label Sep 25, 2024
@kibana-ci
Copy link
Copy Markdown

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Integration Tests #3 / when rolling back to an older version kibana should detect that a later version alias exists, and abort

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
observability 467.2KB 467.2KB -6.0B

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @maryam-saeidi

Copy link
Copy Markdown
Contributor

@kdelemme kdelemme left a comment

Choose a reason for hiding this comment

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

LGTM, just one question

Comment on lines +118 to +120
useEffect(() => {
setRelatedAlertsKuery(getRelatedAlertKuery(tags, groups));
}, [groups, setRelatedAlertsKuery, tags]);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need to check for empty groups or tags array? Or that's not possible?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This will be handled in getRelatedAlertKuery:

getRelatedAlertKuery = (tags?: string[], groups?: Group[])

@maryam-saeidi maryam-saeidi merged commit 387afb7 into elastic:main Sep 25, 2024
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 25, 2024
…eshold rule (elastic#193957)

Closes elastic#193943

### Summary

This PR only loads related alerts for the custom threshold rule and only
when the related rule has tags or group by fields.

For now, we don't show this tab if there is no tag or group and there is
a follow-up ticket for discussing the empty state for the related
alerts.

#### Follow-up work
- elastic#193952
- elastic#193942

(cherry picked from commit 387afb7)
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
8.x

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

Questions ?

Please refer to the Backport tool documentation

@maryam-saeidi maryam-saeidi deleted the 193943-ct-related-alerts branch September 25, 2024 12:55
kibanamachine added a commit that referenced this pull request Sep 25, 2024
…om threshold rule (#193957) (#193991)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Alert details page] Use related alerts logic only for the custom
threshold rule (#193957)](#193957)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Maryam
Saeidi","email":"maryam.saeidi@elastic.co"},"sourceCommit":{"committedDate":"2024-09-25T12:43:52Z","message":"[Alert
details page] Use related alerts logic only for the custom threshold
rule (#193957)\n\nCloses #193943\r\n\r\n### Summary\r\n\r\nThis PR only
loads related alerts for the custom threshold rule and only\r\nwhen the
related rule has tags or group by fields.\r\n\r\nFor now, we don't show
this tab if there is no tag or group and there is\r\na follow-up ticket
for discussing the empty state for the related\r\nalerts.\r\n\r\n####
Follow-up work\r\n- https://github.com/elastic/kibana/issues/193952\r\n-
https://github.com/elastic/kibana/issues/193942","sha":"387afb782e44a0bf7de5549751e52fc7619c328a","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-management"],"title":"[Alert
details page] Use related alerts logic only for the custom threshold
rule","number":193957,"url":"https://github.com/elastic/kibana/pull/193957","mergeCommit":{"message":"[Alert
details page] Use related alerts logic only for the custom threshold
rule (#193957)\n\nCloses #193943\r\n\r\n### Summary\r\n\r\nThis PR only
loads related alerts for the custom threshold rule and only\r\nwhen the
related rule has tags or group by fields.\r\n\r\nFor now, we don't show
this tab if there is no tag or group and there is\r\na follow-up ticket
for discussing the empty state for the related\r\nalerts.\r\n\r\n####
Follow-up work\r\n- https://github.com/elastic/kibana/issues/193952\r\n-
https://github.com/elastic/kibana/issues/193942","sha":"387afb782e44a0bf7de5549751e52fc7619c328a"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193957","number":193957,"mergeCommit":{"message":"[Alert
details page] Use related alerts logic only for the custom threshold
rule (#193957)\n\nCloses #193943\r\n\r\n### Summary\r\n\r\nThis PR only
loads related alerts for the custom threshold rule and only\r\nwhen the
related rule has tags or group by fields.\r\n\r\nFor now, we don't show
this tab if there is no tag or group and there is\r\na follow-up ticket
for discussing the empty state for the related\r\nalerts.\r\n\r\n####
Follow-up work\r\n- https://github.com/elastic/kibana/issues/193952\r\n-
https://github.com/elastic/kibana/issues/193942","sha":"387afb782e44a0bf7de5549751e52fc7619c328a"}}]}]
BACKPORT-->

Co-authored-by: Maryam Saeidi <maryam.saeidi@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. v8.16.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Alert details page] Use related alerts logic only for the custom threshold rule

6 participants