Skip to content

[OBX-UX-MGTM][ALERTING] Add the reason message to the rules recovery context#211411

Merged
fkanout merged 17 commits intoelastic:mainfrom
fkanout:184803-add-reason-msg-recovery-context
Mar 3, 2025
Merged

[OBX-UX-MGTM][ALERTING] Add the reason message to the rules recovery context#211411
fkanout merged 17 commits intoelastic:mainfrom
fkanout:184803-add-reason-msg-recovery-context

Conversation

@fkanout
Copy link
Contributor

@fkanout fkanout commented Feb 17, 2025

Summary

It fixes #184803 by:

Adding the reason message to recovery context variables in the following rules:

  • Inventory Threshold
  • Metric threshold
  • Custom threshold
  • Log threshold

Enabling recovery context and handling the recovery alert context for APM (except Anomaly)

  • Latency threshold
  • Error count
  • Failed transaction rate
@fkanout fkanout requested a review from a team as a code owner February 17, 2025 10:53
@botelastic botelastic bot added the Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. label Feb 17, 2025
@elasticmachine
Copy link
Contributor

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

},
});
});
test('includes reason message in the recovered alert context pulled from the last active alert ', async () => {
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 added the test only to the Custom Threshold as the goal is to deprecate/invest less in Logs, Metrics, and Inventory rules.
Also, adding this test to other rules with the current structure/tools is time-consuming because it would require changing how the tests and the mock services work.

@benakansara
Copy link
Contributor

@fkanout are you planning to also enable recovery context for APM rules in this PR (it is part of the same issue #184803)?

@fkanout
Copy link
Contributor Author

fkanout commented Feb 18, 2025

@fkanout are you planning to also enable recovery context for APM rules in this PR (it is part of the same issue #184803)?

@benakansara, yes, I will cover the APM rules in the same PR.

APM rules could not be covered, as I mentioned here: #184803 (comment)
All APM rules are covered except Anomaly, which will be covered in a separate PR (issue)

@fkanout fkanout requested a review from a team February 19, 2025 15:21
@botelastic botelastic bot added the Team:obs-ux-infra_services - DEPRECATED DEPRECATED - Use Team:obs-presentation. label Feb 19, 2025
@elasticmachine
Copy link
Contributor

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

@maciejforcone
Copy link

@fkanout will it be visible in Alert details as well?

Copy link
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!

}),
requiresAppContext: false,
defaultActionMessage: errorCountMessage,
defaultRecoveryMessage: transactionErrorRateRecoveryMessage,
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't it be errorCountRecoveryMessage?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch 👍🏻

@fkanout
Copy link
Contributor Author

fkanout commented Mar 3, 2025

@fkanout will it be visible in Alert details as well?

@maciejforcone, this is for the action variable in the notification section of the connector. Are you referring to the Alert Details page? Where do you think we need to see the recovered context?

@fkanout fkanout enabled auto-merge (squash) March 3, 2025 10:47
@fkanout fkanout merged commit 9a6b4ec into elastic:main Mar 3, 2025
9 checks passed
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
apm 35.5KB 35.6KB +119.0B
infra 49.5KB 49.6KB +122.0B
observability 90.0KB 90.1KB +43.0B
slo 42.2KB 42.2KB +11.0B
total +295.0B

History

cc @fkanout

@kibanamachine
Copy link
Contributor

Starting backport for target branches: 9.0

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 3, 2025
…context (elastic#211411)

## Summary

It fixes elastic#184803 by:

### Adding the reason message to recovery context variables in the
following rules:
- Inventory Threshold
- Metric threshold
- Custom threshold
- Log threshold

### Enabling recovery context and handling the recovery alert context
for APM (except Anomaly)
- Latency threshold
- Error count
- Failed transaction rate

(cherry picked from commit 9a6b4ec)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
9.0

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 Mar 3, 2025
…overy context (#211411) (#212896)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[OBX-UX-MGTM][ALERTING] Add the reason message to the rules recovery
context (#211411)](#211411)

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

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

<!--BACKPORT [{"author":{"name":"Faisal
Kanout","email":"faisal.kanout@elastic.co"},"sourceCommit":{"committedDate":"2025-03-03T12:04:52Z","message":"[OBX-UX-MGTM][ALERTING]
Add the reason message to the rules recovery context (#211411)\n\n##
Summary\n\nIt fixes #184803 by:\n\n### Adding the reason message to
recovery context variables in the\nfollowing rules:\n- Inventory
Threshold\n- Metric threshold\n- Custom threshold\n- Log
threshold\n\n### Enabling recovery context and handling the recovery
alert context\nfor APM (except Anomaly)\n- Latency threshold\n- Error
count\n- Failed transaction
rate","sha":"9a6b4ecda3c0f1db49f8f93cd6968b4e2f2055d7","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","Feature:Alerting","backport:prev-minor","Team:obs-ux-infra_services","Team:obs-ux-management","v9.1.0"],"title":"[OBX-UX-MGTM][ALERTING]
Add the reason message to the rules recovery
context","number":211411,"url":"https://github.com/elastic/kibana/pull/211411","mergeCommit":{"message":"[OBX-UX-MGTM][ALERTING]
Add the reason message to the rules recovery context (#211411)\n\n##
Summary\n\nIt fixes #184803 by:\n\n### Adding the reason message to
recovery context variables in the\nfollowing rules:\n- Inventory
Threshold\n- Metric threshold\n- Custom threshold\n- Log
threshold\n\n### Enabling recovery context and handling the recovery
alert context\nfor APM (except Anomaly)\n- Latency threshold\n- Error
count\n- Failed transaction
rate","sha":"9a6b4ecda3c0f1db49f8f93cd6968b4e2f2055d7"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/211411","number":211411,"mergeCommit":{"message":"[OBX-UX-MGTM][ALERTING]
Add the reason message to the rules recovery context (#211411)\n\n##
Summary\n\nIt fixes #184803 by:\n\n### Adding the reason message to
recovery context variables in the\nfollowing rules:\n- Inventory
Threshold\n- Metric threshold\n- Custom threshold\n- Log
threshold\n\n### Enabling recovery context and handling the recovery
alert context\nfor APM (except Anomaly)\n- Latency threshold\n- Error
count\n- Failed transaction
rate","sha":"9a6b4ecda3c0f1db49f8f93cd6968b4e2f2055d7"}}]}] BACKPORT-->

Co-authored-by: Faisal Kanout <faisal.kanout@elastic.co>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Mar 22, 2025
…context (elastic#211411)

## Summary

It fixes elastic#184803 by:

### Adding the reason message to recovery context variables in the
following rules:
- Inventory Threshold
- Metric threshold
- Custom threshold
- Log threshold

### Enabling recovery context and handling the recovery alert context
for APM (except Anomaly)
- Latency threshold
- Error count
- Failed transaction rate
@benakansara benakansara added backport:version Backport to applied version labels v8.19.0 labels Apr 16, 2025
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x, 9.0

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Apr 16, 2025
…context (elastic#211411)

## Summary

It fixes elastic#184803 by:

### Adding the reason message to recovery context variables in the
following rules:
- Inventory Threshold
- Metric threshold
- Custom threshold
- Log threshold

### Enabling recovery context and handling the recovery alert context
for APM (except Anomaly)
- Latency threshold
- Error count
- Failed transaction rate

(cherry picked from commit 9a6b4ec)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.x
9.0 Cherrypick failed because the selected commit (9a6b4ec) is empty. It looks like the commit was already backported in #212896

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

Manual backport

To create the backport manually run:

node scripts/backport --pr 211411

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Apr 16, 2025
…overy context (#211411) (#218490)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[OBX-UX-MGTM][ALERTING] Add the reason message to the rules recovery
context (#211411)](#211411)

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

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

<!--BACKPORT [{"author":{"name":"Faisal
Kanout","email":"faisal.kanout@elastic.co"},"sourceCommit":{"committedDate":"2025-03-03T12:04:52Z","message":"[OBX-UX-MGTM][ALERTING]
Add the reason message to the rules recovery context (#211411)\n\n##
Summary\n\nIt fixes #184803 by:\n\n### Adding the reason message to
recovery context variables in the\nfollowing rules:\n- Inventory
Threshold\n- Metric threshold\n- Custom threshold\n- Log
threshold\n\n### Enabling recovery context and handling the recovery
alert context\nfor APM (except Anomaly)\n- Latency threshold\n- Error
count\n- Failed transaction
rate","sha":"9a6b4ecda3c0f1db49f8f93cd6968b4e2f2055d7","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","Feature:Alerting","v9.0.0","backport:prev-minor","Team:obs-ux-infra_services","Team:obs-ux-management","backport:version","v9.1.0","v8.19.0"],"title":"[OBX-UX-MGTM][ALERTING]
Add the reason message to the rules recovery
context","number":211411,"url":"https://github.com/elastic/kibana/pull/211411","mergeCommit":{"message":"[OBX-UX-MGTM][ALERTING]
Add the reason message to the rules recovery context (#211411)\n\n##
Summary\n\nIt fixes #184803 by:\n\n### Adding the reason message to
recovery context variables in the\nfollowing rules:\n- Inventory
Threshold\n- Metric threshold\n- Custom threshold\n- Log
threshold\n\n### Enabling recovery context and handling the recovery
alert context\nfor APM (except Anomaly)\n- Latency threshold\n- Error
count\n- Failed transaction
rate","sha":"9a6b4ecda3c0f1db49f8f93cd6968b4e2f2055d7"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/212896","number":212896,"state":"MERGED","mergeCommit":{"sha":"2fc95c610f0b8a7a2b57cfc38a48f722f4ce5b84","message":"[9.0]
[OBX-UX-MGTM][ALERTING] Add the reason message to the rules recovery
context (#211411) (#212896)\n\n# Backport\n\nThis will backport the
following commits from `main` to `9.0`:\n- [[OBX-UX-MGTM][ALERTING] Add
the reason message to the rules recovery\ncontext
(#211411)](https://github.com/elastic/kibana/pull/211411)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by:
Faisal Kanout
<faisal.kanout@elastic.co>"}},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/211411","number":211411,"mergeCommit":{"message":"[OBX-UX-MGTM][ALERTING]
Add the reason message to the rules recovery context (#211411)\n\n##
Summary\n\nIt fixes #184803 by:\n\n### Adding the reason message to
recovery context variables in the\nfollowing rules:\n- Inventory
Threshold\n- Metric threshold\n- Custom threshold\n- Log
threshold\n\n### Enabling recovery context and handling the recovery
alert context\nfor APM (except Anomaly)\n- Latency threshold\n- Error
count\n- Failed transaction
rate","sha":"9a6b4ecda3c0f1db49f8f93cd6968b4e2f2055d7"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Faisal Kanout <faisal.kanout@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels Feature:Alerting release_note:enhancement Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. Team:obs-ux-infra_services - DEPRECATED DEPRECATED - Use Team:obs-presentation. v8.19.0 v9.0.0 v9.1.0

7 participants