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

[Rules and Alerting][Stack Monitoring] Quote cluster uuid in global state link sent via alerting rules #190341

Conversation

dominiqueclarke
Copy link
Contributor

@dominiqueclarke dominiqueclarke commented Aug 12, 2024

Summary

Closes #191250

This PR fixes the URL contained in the Shard size alerting rule when the email body contains the {{ context.internalFullMessage}} action variable.

The generated URL which triggers a rison decoder error
https://<host>/app/monitoring#/elasticsearch/indices/<index>?_g=(cluster_uuid:foobar))

is fixed by adding a pair of single quotes around the cluster UUID
https://<host>/app/monitoring#/elasticsearch/indices/<index>?_g=(cluster_uuid:'foobar'))

Worth noting that this issue doesn't only impact the Shard size rule, but many other rule types, namely:

  • CPU usage
  • Disk usage
  • Memory usage
  • CCR read exception
  • ES version mismatch
  • Kibana version mismatch
  • Logstash version mismatch
  • Missing monitoring data
  • Thread pool search rejections
  • Thread pool write rejections

@obltmachine
Copy link

🤖 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!)

@consulthys consulthys marked this pull request as ready for review August 26, 2024 03:38
@consulthys consulthys requested a review from a team as a code owner August 26, 2024 03:38
@consulthys consulthys added release_note:skip Skip the PR/issue when compiling release notes Feature:Stack Monitoring backport labels Aug 26, 2024
Copy link

@musabdogan musabdogan left a comment

Choose a reason for hiding this comment

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

LGTM

@consulthys consulthys requested a review from a team August 27, 2024 05:56
@consulthys consulthys added v8.15.0 v8.15.1 backport:version Backport to applied version labels labels Aug 27, 2024
@consulthys consulthys changed the title shard size rule - quote cluster uuid in global state link [Rules and Alerting][Stack Monitoring] Quote cluster uuid in global state link sent via alerting rules Aug 27, 2024
@consulthys consulthys added release_note:fix and removed release_note:skip Skip the PR/issue when compiling release notes labels Aug 27, 2024
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #47 / Cloud Security Posture Test adding Cloud Security Posture Integrations CSPM AZURE Azure Single Manual Managed Identity Azure Single Manual Workflow

Metrics [docs]

✅ unchanged

History

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

@dominiqueclarke dominiqueclarke merged commit 6ba4d74 into elastic:main Aug 27, 2024
23 checks passed
@dominiqueclarke dominiqueclarke deleted the fix/shard-size-rule-cluser-uuid-quoted branch August 27, 2024 12:50
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Aug 27, 2024
…tate link sent via alerting rules (elastic#190341)

## Summary

Closes elastic#191250

This PR fixes the URL contained in the Shard size alerting rule when the
email body contains the `{{ context.internalFullMessage}}` action
variable.

The generated URL which triggers a `rison decoder error`

`https://<host>/app/monitoring#/elasticsearch/indices/<index>?_g=(cluster_uuid:foobar))`

is fixed by adding a pair of single quotes around the cluster UUID

`https://<host>/app/monitoring#/elasticsearch/indices/<index>?_g=(cluster_uuid:'foobar'))`

Worth noting that this issue doesn't only impact the Shard size rule,
but many other rule types, namely:
* CPU usage
* Disk usage
* Memory usage
* CCR read exception
* ES version mismatch
* Kibana version mismatch
* Logstash version mismatch
* Missing monitoring data
* Thread pool search rejections
* Thread pool write rejections

---------

Co-authored-by: Valentin Crettaz <valentin.crettaz@consulthys.com>
Co-authored-by: Valentin Crettaz <valentin.crettaz@elastic.co>
(cherry picked from commit 6ba4d74)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.15

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 Aug 27, 2024
…lobal state link sent via alerting rules (#190341) (#191496)

# Backport

This will backport the following commits from `main` to `8.15`:
- [[Rules and Alerting][Stack Monitoring] Quote cluster uuid in global
state link sent via alerting rules
(#190341)](#190341)

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

### 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":"2024-08-27T12:50:48Z","message":"[Rules
and Alerting][Stack Monitoring] Quote cluster uuid in global state link
sent via alerting rules (#190341)\n\n## Summary\r\n\r\nCloses
#191250 PR fixes the
URL contained in the Shard size alerting rule when the\r\nemail body
contains the `` action\r\nvariable.\r\n\r\nThe generated URL which
triggers a `rison decoder
error`\r\n\r\n`https://<host>/app/monitoring#/elasticsearch/indices/<index>?_g=(cluster_uuid:foobar))`\r\n\r\nis
fixed by adding a pair of single quotes around the cluster
UUID\r\n\r\n`https://<host>/app/monitoring#/elasticsearch/indices/<index>?_g=(cluster_uuid:'foobar'))`\r\n\r\nWorth
noting that this issue doesn't only impact the Shard size rule,\r\nbut
many other rule types, namely:\r\n* CPU usage\r\n* Disk usage\r\n*
Memory usage\r\n* CCR read exception\r\n* ES version mismatch\r\n*
Kibana version mismatch\r\n* Logstash version mismatch\r\n* Missing
monitoring data\r\n* Thread pool search rejections\r\n* Thread pool
write rejections\r\n\r\n---------\r\n\r\nCo-authored-by: Valentin
Crettaz <valentin.crettaz@consulthys.com>\r\nCo-authored-by: Valentin
Crettaz
<valentin.crettaz@elastic.co>","sha":"6ba4d7440d34bbea11699fbe218a0020ff88a4f4","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["backport","release_note:fix","Feature:Stack
Monitoring","v8.15.0","v8.16.0","v8.15.1","backport:version"],"title":"[Rules
and Alerting][Stack Monitoring] Quote cluster uuid in global state link
sent via alerting
rules","number":190341,"url":"#190341
and Alerting][Stack Monitoring] Quote cluster uuid in global state link
sent via alerting rules (#190341)\n\n## Summary\r\n\r\nCloses
#191250 PR fixes the
URL contained in the Shard size alerting rule when the\r\nemail body
contains the `` action\r\nvariable.\r\n\r\nThe generated URL which
triggers a `rison decoder
error`\r\n\r\n`https://<host>/app/monitoring#/elasticsearch/indices/<index>?_g=(cluster_uuid:foobar))`\r\n\r\nis
fixed by adding a pair of single quotes around the cluster
UUID\r\n\r\n`https://<host>/app/monitoring#/elasticsearch/indices/<index>?_g=(cluster_uuid:'foobar'))`\r\n\r\nWorth
noting that this issue doesn't only impact the Shard size rule,\r\nbut
many other rule types, namely:\r\n* CPU usage\r\n* Disk usage\r\n*
Memory usage\r\n* CCR read exception\r\n* ES version mismatch\r\n*
Kibana version mismatch\r\n* Logstash version mismatch\r\n* Missing
monitoring data\r\n* Thread pool search rejections\r\n* Thread pool
write rejections\r\n\r\n---------\r\n\r\nCo-authored-by: Valentin
Crettaz <valentin.crettaz@consulthys.com>\r\nCo-authored-by: Valentin
Crettaz
<valentin.crettaz@elastic.co>","sha":"6ba4d7440d34bbea11699fbe218a0020ff88a4f4"}},"sourceBranch":"main","suggestedTargetBranches":["8.15"],"targetPullRequestStates":[{"branch":"8.15","label":"v8.15.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"#190341
and Alerting][Stack Monitoring] Quote cluster uuid in global state link
sent via alerting rules (#190341)\n\n## Summary\r\n\r\nCloses
#191250 PR fixes the
URL contained in the Shard size alerting rule when the\r\nemail body
contains the `` action\r\nvariable.\r\n\r\nThe generated URL which
triggers a `rison decoder
error`\r\n\r\n`https://<host>/app/monitoring#/elasticsearch/indices/<index>?_g=(cluster_uuid:foobar))`\r\n\r\nis
fixed by adding a pair of single quotes around the cluster
UUID\r\n\r\n`https://<host>/app/monitoring#/elasticsearch/indices/<index>?_g=(cluster_uuid:'foobar'))`\r\n\r\nWorth
noting that this issue doesn't only impact the Shard size rule,\r\nbut
many other rule types, namely:\r\n* CPU usage\r\n* Disk usage\r\n*
Memory usage\r\n* CCR read exception\r\n* ES version mismatch\r\n*
Kibana version mismatch\r\n* Logstash version mismatch\r\n* Missing
monitoring data\r\n* Thread pool search rejections\r\n* Thread pool
write rejections\r\n\r\n---------\r\n\r\nCo-authored-by: Valentin
Crettaz <valentin.crettaz@consulthys.com>\r\nCo-authored-by: Valentin
Crettaz
<valentin.crettaz@elastic.co>","sha":"6ba4d7440d34bbea11699fbe218a0020ff88a4f4"}}]}]
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Rules and Alerting][Stack Monitoring] Shard size rule type returns wrong URL with context.internalFullMessage
6 participants