[Observability] [Alerting] Fix alert tags when source tags is a string#259729
Merged
benakansara merged 2 commits intoelastic:mainfrom Mar 26, 2026
Merged
[Observability] [Alerting] Fix alert tags when source tags is a string#259729benakansara merged 2 commits intoelastic:mainfrom
benakansara merged 2 commits intoelastic:mainfrom
Conversation
Contributor
ApprovabilityVerdict: Would Approve This is a small, focused bug fix that handles an edge case where source tags come in as a string rather than an array. The fix uses Macroscope would have approved this PR. A repo admin can enable approvability here. |
Contributor
|
Starting backport for target branches: 8.19, 9.2, 9.3 |
Contributor
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]
cc @benakansara |
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Mar 26, 2026
elastic#259729) Resolves elastic#259504 When source documents have tags as a string instead of an array, the spread syntax [...(additionalContext.tags ?? [])] iterates characters, producing per-character tags on the alert (e.g. t, e, s, t, ...). This PR normalizes tags to an array before merging with rule tags, fixing the inventory threshold, metric threshold, and custom threshold executors. (cherry picked from commit cd62e65)
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Mar 26, 2026
elastic#259729) Resolves elastic#259504 When source documents have tags as a string instead of an array, the spread syntax [...(additionalContext.tags ?? [])] iterates characters, producing per-character tags on the alert (e.g. t, e, s, t, ...). This PR normalizes tags to an array before merging with rule tags, fixing the inventory threshold, metric threshold, and custom threshold executors. (cherry picked from commit cd62e65)
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Mar 26, 2026
elastic#259729) Resolves elastic#259504 When source documents have tags as a string instead of an array, the spread syntax [...(additionalContext.tags ?? [])] iterates characters, producing per-character tags on the alert (e.g. t, e, s, t, ...). This PR normalizes tags to an array before merging with rule tags, fixing the inventory threshold, metric threshold, and custom threshold executors. (cherry picked from commit cd62e65)
Contributor
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
10 tasks
shahargl
pushed a commit
to shahargl/kibana
that referenced
this pull request
Mar 26, 2026
elastic#259729) Resolves elastic#259504 When source documents have tags as a string instead of an array, the spread syntax [...(additionalContext.tags ?? [])] iterates characters, producing per-character tags on the alert (e.g. t, e, s, t, ...). This PR normalizes tags to an array before merging with rule tags, fixing the inventory threshold, metric threshold, and custom threshold executors.
kibanamachine
added a commit
that referenced
this pull request
Mar 26, 2026
… string (#259729) (#259767) # Backport This will backport the following commits from `main` to `9.2`: - [[Observability] [Alerting] Fix alert tags when source tags is a string (#259729)](#259729) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Bena Kansara","email":"69037875+benakansara@users.noreply.github.com"},"sourceCommit":{"committedDate":"2026-03-26T12:02:31Z","message":"[Observability] [Alerting] Fix alert tags when source tags is a string (#259729)\n\nResolves https://github.com/elastic/kibana/issues/259504\n\nWhen source documents have tags as a string instead of an array, the\nspread syntax [...(additionalContext.tags ?? [])] iterates characters,\nproducing per-character tags on the alert (e.g. t, e, s, t, ...). This\nPR normalizes tags to an array before merging with rule tags, fixing the\ninventory threshold, metric threshold, and custom threshold executors.","sha":"cd62e658addd633767c0c56cea66c0353bb52cec","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","backport:all-open","v9.4.0","author:actionable-obs"],"title":"[Observability] [Alerting] Fix alert tags when source tags is a string","number":259729,"url":"https://github.com/elastic/kibana/pull/259729","mergeCommit":{"message":"[Observability] [Alerting] Fix alert tags when source tags is a string (#259729)\n\nResolves https://github.com/elastic/kibana/issues/259504\n\nWhen source documents have tags as a string instead of an array, the\nspread syntax [...(additionalContext.tags ?? [])] iterates characters,\nproducing per-character tags on the alert (e.g. t, e, s, t, ...). This\nPR normalizes tags to an array before merging with rule tags, fixing the\ninventory threshold, metric threshold, and custom threshold executors.","sha":"cd62e658addd633767c0c56cea66c0353bb52cec"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/259729","number":259729,"mergeCommit":{"message":"[Observability] [Alerting] Fix alert tags when source tags is a string (#259729)\n\nResolves https://github.com/elastic/kibana/issues/259504\n\nWhen source documents have tags as a string instead of an array, the\nspread syntax [...(additionalContext.tags ?? [])] iterates characters,\nproducing per-character tags on the alert (e.g. t, e, s, t, ...). This\nPR normalizes tags to an array before merging with rule tags, fixing the\ninventory threshold, metric threshold, and custom threshold executors.","sha":"cd62e658addd633767c0c56cea66c0353bb52cec"}}]}] BACKPORT--> Co-authored-by: Bena Kansara <69037875+benakansara@users.noreply.github.com>
kibanamachine
added a commit
that referenced
this pull request
Mar 26, 2026
… string (#259729) (#259768) # Backport This will backport the following commits from `main` to `9.3`: - [[Observability] [Alerting] Fix alert tags when source tags is a string (#259729)](#259729) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Bena Kansara","email":"69037875+benakansara@users.noreply.github.com"},"sourceCommit":{"committedDate":"2026-03-26T12:02:31Z","message":"[Observability] [Alerting] Fix alert tags when source tags is a string (#259729)\n\nResolves https://github.com/elastic/kibana/issues/259504\n\nWhen source documents have tags as a string instead of an array, the\nspread syntax [...(additionalContext.tags ?? [])] iterates characters,\nproducing per-character tags on the alert (e.g. t, e, s, t, ...). This\nPR normalizes tags to an array before merging with rule tags, fixing the\ninventory threshold, metric threshold, and custom threshold executors.","sha":"cd62e658addd633767c0c56cea66c0353bb52cec","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","backport:all-open","v9.4.0","author:actionable-obs"],"title":"[Observability] [Alerting] Fix alert tags when source tags is a string","number":259729,"url":"https://github.com/elastic/kibana/pull/259729","mergeCommit":{"message":"[Observability] [Alerting] Fix alert tags when source tags is a string (#259729)\n\nResolves https://github.com/elastic/kibana/issues/259504\n\nWhen source documents have tags as a string instead of an array, the\nspread syntax [...(additionalContext.tags ?? [])] iterates characters,\nproducing per-character tags on the alert (e.g. t, e, s, t, ...). This\nPR normalizes tags to an array before merging with rule tags, fixing the\ninventory threshold, metric threshold, and custom threshold executors.","sha":"cd62e658addd633767c0c56cea66c0353bb52cec"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/259729","number":259729,"mergeCommit":{"message":"[Observability] [Alerting] Fix alert tags when source tags is a string (#259729)\n\nResolves https://github.com/elastic/kibana/issues/259504\n\nWhen source documents have tags as a string instead of an array, the\nspread syntax [...(additionalContext.tags ?? [])] iterates characters,\nproducing per-character tags on the alert (e.g. t, e, s, t, ...). This\nPR normalizes tags to an array before merging with rule tags, fixing the\ninventory threshold, metric threshold, and custom threshold executors.","sha":"cd62e658addd633767c0c56cea66c0353bb52cec"}}]}] BACKPORT--> Co-authored-by: Bena Kansara <69037875+benakansara@users.noreply.github.com>
kibanamachine
added a commit
that referenced
this pull request
Mar 26, 2026
…a string (#259729) (#259766) # Backport This will backport the following commits from `main` to `8.19`: - [[Observability] [Alerting] Fix alert tags when source tags is a string (#259729)](#259729) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Bena Kansara","email":"69037875+benakansara@users.noreply.github.com"},"sourceCommit":{"committedDate":"2026-03-26T12:02:31Z","message":"[Observability] [Alerting] Fix alert tags when source tags is a string (#259729)\n\nResolves https://github.com/elastic/kibana/issues/259504\n\nWhen source documents have tags as a string instead of an array, the\nspread syntax [...(additionalContext.tags ?? [])] iterates characters,\nproducing per-character tags on the alert (e.g. t, e, s, t, ...). This\nPR normalizes tags to an array before merging with rule tags, fixing the\ninventory threshold, metric threshold, and custom threshold executors.","sha":"cd62e658addd633767c0c56cea66c0353bb52cec","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","backport:all-open","v9.4.0","author:actionable-obs"],"title":"[Observability] [Alerting] Fix alert tags when source tags is a string","number":259729,"url":"https://github.com/elastic/kibana/pull/259729","mergeCommit":{"message":"[Observability] [Alerting] Fix alert tags when source tags is a string (#259729)\n\nResolves https://github.com/elastic/kibana/issues/259504\n\nWhen source documents have tags as a string instead of an array, the\nspread syntax [...(additionalContext.tags ?? [])] iterates characters,\nproducing per-character tags on the alert (e.g. t, e, s, t, ...). This\nPR normalizes tags to an array before merging with rule tags, fixing the\ninventory threshold, metric threshold, and custom threshold executors.","sha":"cd62e658addd633767c0c56cea66c0353bb52cec"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/259729","number":259729,"mergeCommit":{"message":"[Observability] [Alerting] Fix alert tags when source tags is a string (#259729)\n\nResolves https://github.com/elastic/kibana/issues/259504\n\nWhen source documents have tags as a string instead of an array, the\nspread syntax [...(additionalContext.tags ?? [])] iterates characters,\nproducing per-character tags on the alert (e.g. t, e, s, t, ...). This\nPR normalizes tags to an array before merging with rule tags, fixing the\ninventory threshold, metric threshold, and custom threshold executors.","sha":"cd62e658addd633767c0c56cea66c0353bb52cec"}}]}] BACKPORT--> --------- Co-authored-by: Bena Kansara <69037875+benakansara@users.noreply.github.com>
jeramysoucy
pushed a commit
to jeramysoucy/kibana
that referenced
this pull request
Apr 1, 2026
elastic#259729) Resolves elastic#259504 When source documents have tags as a string instead of an array, the spread syntax [...(additionalContext.tags ?? [])] iterates characters, producing per-character tags on the alert (e.g. t, e, s, t, ...). This PR normalizes tags to an array before merging with rule tags, fixing the inventory threshold, metric threshold, and custom threshold executors.
paulinashakirova
pushed a commit
to paulinashakirova/kibana
that referenced
this pull request
Apr 2, 2026
elastic#259729) Resolves elastic#259504 When source documents have tags as a string instead of an array, the spread syntax [...(additionalContext.tags ?? [])] iterates characters, producing per-character tags on the alert (e.g. t, e, s, t, ...). This PR normalizes tags to an array before merging with rule tags, fixing the inventory threshold, metric threshold, and custom threshold executors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #259504
When source documents have tags as a string instead of an array, the spread syntax [...(additionalContext.tags ?? [])] iterates characters, producing per-character tags on the alert (e.g. t, e, s, t, ...). This PR normalizes tags to an array before merging with rule tags, fixing the inventory threshold, metric threshold, and custom threshold executors.