Skip to content
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

[Synthetics] adjust monitor status rule location logic #156432

Conversation

dominiqueclarke
Copy link
Contributor

@dominiqueclarke dominiqueclarke commented May 2, 2023

Summary

Resolves #156223

In previous stack versions, the label was not saved to the saved object.

This ensures that alerting works both for those early versions as well current versions, by adjusting the logic to consider both the location.label and location.id in alerting logic.

Testing

  1. Create a new oblt-cli cluster and connect to the synthetics service, locally or via the dev environment
  2. Checkout v8.5.3
  3. Create a monitor. Make sure it's down and wait for the first down check
  4. Check out this branch
  5. Navigate to Observabillity alerts. Ensure that an alert is generated for the monitor. You may have to wait a few minutes.

@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

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

@dominiqueclarke dominiqueclarke added release_note:skip Skip the PR/issue when compiling release notes Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v8.8.0 v8.9.0 labels May 2, 2023
@dominiqueclarke dominiqueclarke marked this pull request as ready for review May 2, 2023 21:21
@dominiqueclarke dominiqueclarke requested a review from a team as a code owner May 2, 2023 21:21
@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

Copy link
Contributor

@shahzad31 shahzad31 left a comment

Choose a reason for hiding this comment

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

LGTM !!

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #1 / InfraOps App feature controls infrastructure security global infrastructure all privileges infrastructure landing page with data shows Wafflemap

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
securitySolution 398 401 +3
total +5

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
securitySolution 478 481 +3
total +5

History

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

@dominiqueclarke dominiqueclarke merged commit 77cebee into elastic:main May 3, 2023
@dominiqueclarke dominiqueclarke deleted the fix/synthetics-monitor-status-rule-location branch May 3, 2023 13:41
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request May 3, 2023
## Summary

Resolves elastic#156223

In previous stack versions, the label was not saved to the saved object.

This ensures that alerting works both for those early versions as well
current versions, by adjusting the logic to consider both the
location.label and location.id in alerting logic.

### Testing

1. Create a new oblt-cli cluster and connect to the synthetics service,
locally or via the dev environment
2. Checkout v8.5.3
3. Create a monitor. Make sure it's down and wait for the first down
check
4. Check out this branch
5. Navigate to Observabillity alerts. Ensure that an alert is generated
for the monitor. You may have to wait a few minutes.

---------

Co-authored-by: Shahzad <shahzad31comp@gmail.com>
(cherry picked from commit 77cebee)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.8

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 May 3, 2023
#156546)

# Backport

This will backport the following commits from `main` to `8.8`:
- [[Synthetics] adjust monitor status rule location logic
(#156432)](#156432)

<!--- Backport version: 8.9.7 -->

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

<!--BACKPORT [{"author":{"name":"Dominique
Clarke","email":"dominique.clarke@elastic.co"},"sourceCommit":{"committedDate":"2023-05-03T13:41:19Z","message":"[Synthetics]
adjust monitor status rule location logic (#156432)\n\n##
Summary\r\n\r\nResolves
#156223 previous stack
versions, the label was not saved to the saved object.\r\n\r\nThis
ensures that alerting works both for those early versions as
well\r\ncurrent versions, by adjusting the logic to consider both
the\r\nlocation.label and location.id in alerting logic.\r\n\r\n###
Testing\r\n\r\n1. Create a new oblt-cli cluster and connect to the
synthetics service,\r\nlocally or via the dev environment\r\n2. Checkout
v8.5.3\r\n3. Create a monitor. Make sure it's down and wait for the
first down\r\ncheck\r\n4. Check out this branch\r\n5. Navigate to
Observabillity alerts. Ensure that an alert is generated\r\nfor the
monitor. You may have to wait a few
minutes.\r\n\r\n---------\r\n\r\nCo-authored-by: Shahzad
<shahzad31comp@gmail.com>","sha":"77cebee6f754d8bbd439008f8c8466bceebd54ac","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:uptime","release_note:skip","v8.8.0","v8.9.0"],"number":156432,"url":"#156432
adjust monitor status rule location logic (#156432)\n\n##
Summary\r\n\r\nResolves
#156223 previous stack
versions, the label was not saved to the saved object.\r\n\r\nThis
ensures that alerting works both for those early versions as
well\r\ncurrent versions, by adjusting the logic to consider both
the\r\nlocation.label and location.id in alerting logic.\r\n\r\n###
Testing\r\n\r\n1. Create a new oblt-cli cluster and connect to the
synthetics service,\r\nlocally or via the dev environment\r\n2. Checkout
v8.5.3\r\n3. Create a monitor. Make sure it's down and wait for the
first down\r\ncheck\r\n4. Check out this branch\r\n5. Navigate to
Observabillity alerts. Ensure that an alert is generated\r\nfor the
monitor. You may have to wait a few
minutes.\r\n\r\n---------\r\n\r\nCo-authored-by: Shahzad
<shahzad31comp@gmail.com>","sha":"77cebee6f754d8bbd439008f8c8466bceebd54ac"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"8.8","label":"v8.8.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"#156432
adjust monitor status rule location logic (#156432)\n\n##
Summary\r\n\r\nResolves
#156223 previous stack
versions, the label was not saved to the saved object.\r\n\r\nThis
ensures that alerting works both for those early versions as
well\r\ncurrent versions, by adjusting the logic to consider both
the\r\nlocation.label and location.id in alerting logic.\r\n\r\n###
Testing\r\n\r\n1. Create a new oblt-cli cluster and connect to the
synthetics service,\r\nlocally or via the dev environment\r\n2. Checkout
v8.5.3\r\n3. Create a monitor. Make sure it's down and wait for the
first down\r\ncheck\r\n4. Check out this branch\r\n5. Navigate to
Observabillity alerts. Ensure that an alert is generated\r\nfor the
monitor. You may have to wait a few
minutes.\r\n\r\n---------\r\n\r\nCo-authored-by: Shahzad
<shahzad31comp@gmail.com>","sha":"77cebee6f754d8bbd439008f8c8466bceebd54ac"}}]}]
BACKPORT-->

Co-authored-by: Dominique Clarke <dominique.clarke@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v8.8.0 v8.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Synthetics] Alerts do not fire for monitors created in earlier versions
6 participants