Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.11] [SLO] Fix SLO burn rate rule to call
alertWithLifecycle
befo…
…re `getAlertUuid` (#169004) (#169026) # Backport This will backport the following commits from `main` to `8.11`: - [[SLO] Fix SLO burn rate rule to call `alertWithLifecycle` before `getAlertUuid` (#169004)](#169004) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Chris Cowan","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-10-16T19:55:39Z","message":"[SLO] Fix SLO burn rate rule to call `alertWithLifecycle` before `getAlertUuid` (#169004)\n\n## Summary\r\n\r\nThis PR fixes #168962 by calling `alertWithLifecycle` before\r\n`getAlertUuid`. When `getAlertUuid` is called first it will generate a\r\nUUID which is not associated with the actual alert. When you call\r\n`alertWithLifecycle`, it generates the Alert then stores the `alertUuid`\r\nthat maps the `alertId` to the `alertUuid`; `getAlertUuid` tries to\r\nrecall this association but falls back to generating a UUID. I had to\r\nchange the way the test worked by modifying mock's behavior to match the\r\nimplementation; once I had a test that failed similarly to what we see\r\nin the real world, I fixed the issue by changing the implementation to\r\ncall `alertWithLifecycle` first\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"48bb5ae6797fd58f5c4076df583b32060572ca66","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team: Actionable Observability","backport:prev-minor","v8.12.0"],"number":169004,"url":"https://github.com/elastic/kibana/pull/169004","mergeCommit":{"message":"[SLO] Fix SLO burn rate rule to call `alertWithLifecycle` before `getAlertUuid` (#169004)\n\n## Summary\r\n\r\nThis PR fixes #168962 by calling `alertWithLifecycle` before\r\n`getAlertUuid`. When `getAlertUuid` is called first it will generate a\r\nUUID which is not associated with the actual alert. When you call\r\n`alertWithLifecycle`, it generates the Alert then stores the `alertUuid`\r\nthat maps the `alertId` to the `alertUuid`; `getAlertUuid` tries to\r\nrecall this association but falls back to generating a UUID. I had to\r\nchange the way the test worked by modifying mock's behavior to match the\r\nimplementation; once I had a test that failed similarly to what we see\r\nin the real world, I fixed the issue by changing the implementation to\r\ncall `alertWithLifecycle` first\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"48bb5ae6797fd58f5c4076df583b32060572ca66"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/169004","number":169004,"mergeCommit":{"message":"[SLO] Fix SLO burn rate rule to call `alertWithLifecycle` before `getAlertUuid` (#169004)\n\n## Summary\r\n\r\nThis PR fixes #168962 by calling `alertWithLifecycle` before\r\n`getAlertUuid`. When `getAlertUuid` is called first it will generate a\r\nUUID which is not associated with the actual alert. When you call\r\n`alertWithLifecycle`, it generates the Alert then stores the `alertUuid`\r\nthat maps the `alertId` to the `alertUuid`; `getAlertUuid` tries to\r\nrecall this association but falls back to generating a UUID. I had to\r\nchange the way the test worked by modifying mock's behavior to match the\r\nimplementation; once I had a test that failed similarly to what we see\r\nin the real world, I fixed the issue by changing the implementation to\r\ncall `alertWithLifecycle` first\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"48bb5ae6797fd58f5c4076df583b32060572ca66"}}]}] BACKPORT--> Co-authored-by: Chris Cowan <[email protected]>
- Loading branch information