Skip to content

[Streams][SigEvents] Prevent editing feature of significant event queries#249716

Merged
cesco-f merged 2 commits intoelastic:mainfrom
cesco-f:remove-edit-features
Jan 21, 2026
Merged

[Streams][SigEvents] Prevent editing feature of significant event queries#249716
cesco-f merged 2 commits intoelastic:mainfrom
cesco-f:remove-edit-features

Conversation

@cesco-f
Copy link
Contributor

@cesco-f cesco-f commented Jan 20, 2026

Summary

This PR prevents modifying the feature field of existing significant event queries in both the UI and API. Feature selection remains available when creating new significant events, but becomes read-only when editing existing ones.

Background

When creating a significant event, a detection rule is created combining the KQL query with the feature condition. The rule ID is generated from the ASSET_UUID and kql.query only - it does not include the feature field. When the feature changes, the rule ID stays the same, causing alerts from the previous rule configuration to still appear.

Since features are being removed from significant events, this is a temporary fix to prevent the bug from occurring.

Before:

Screen.Recording.2026-01-20.at.14.15.51.mov

After:

Screen.Recording.2026-01-20.at.14.14.53.mov
@cesco-f cesco-f requested review from a team as code owners January 20, 2026 13:17
@cesco-f cesco-f added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Feature:SigEvents Significant events feature, related to streams and rules/alerts (RnA) labels Jan 20, 2026
@github-actions github-actions bot added the author:actionable-obs PRs authored by the actionable obs team label Jan 20, 2026
@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
streamsApp 1.5MB 1.5MB +29.0B
@cesco-f cesco-f added release_note:fix backport:version Backport to applied version labels v9.3.1 and removed release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting labels Jan 21, 2026
@klacabane klacabane self-requested a review January 21, 2026 12:20
@klacabane
Copy link
Contributor

When creating a significant event, a detection rule is created combining the KQL query with the feature condition. The rule ID is generated from the ASSET_UUID and kql.query only - it does not include the feature field. When the feature changes, the rule ID stays the same, causing alerts from the previous rule configuration to still appear.

I thought we’d have the same problem when updating the feature’s filter itself, but since we save the feature by value rather than reference, it continues to work as expected. This does however create an inconsistency in the UI, a feature can be attached to a query with an active filter that was updated but this update is not reflected in the query (in the alert rule and Discover link)

Copy link
Contributor

@klacabane klacabane left a comment

Choose a reason for hiding this comment

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

LGTM

@cesco-f cesco-f merged commit 2a33453 into elastic:main Jan 21, 2026
24 checks passed
@cesco-f cesco-f deleted the remove-edit-features branch January 21, 2026 14:02
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 9.3

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 21, 2026
…ries (elastic#249716)

### Summary

This PR prevents modifying the `feature` field of existing significant
event queries in both the UI and API. Feature selection remains
available when **creating** new significant events, but becomes
read-only when **editing** existing ones.

### Background

When creating a significant event, a detection rule is created combining
the KQL query with the feature condition. The rule ID is generated from
the `ASSET_UUID` and `kql.query` only - it does not include the
`feature` field. When the feature changes, the rule ID stays the same,
causing alerts from the previous rule configuration to still appear.

Since features are being removed from significant events, this is a
temporary fix to prevent the bug from occurring.

Before:

https://github.com/user-attachments/assets/bf5e21ea-c55e-487c-9f32-163d767b13ad

After:

https://github.com/user-attachments/assets/268f4e65-1861-4a46-b07b-9473238995df
(cherry picked from commit 2a33453)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
9.3

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 Jan 21, 2026
…nt queries (#249716) (#249879)

# Backport

This will backport the following commits from `main` to `9.3`:
- [[Streams][SigEvents] Prevent editing feature of significant event
queries (#249716)](#249716)

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

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

<!--BACKPORT [{"author":{"name":"Francesco
Fagnani","email":"fagnani.francesco@gmail.com"},"sourceCommit":{"committedDate":"2026-01-21T14:02:28Z","message":"[Streams][SigEvents]
Prevent editing feature of significant event queries (#249716)\n\n###
Summary\n\nThis PR prevents modifying the `feature` field of existing
significant\nevent queries in both the UI and API. Feature selection
remains\navailable when **creating** new significant events, but
becomes\nread-only when **editing** existing ones.\n\n###
Background\n\nWhen creating a significant event, a detection rule is
created combining\nthe KQL query with the feature condition. The rule ID
is generated from\nthe `ASSET_UUID` and `kql.query` only - it does not
include the\n`feature` field. When the feature changes, the rule ID
stays the same,\ncausing alerts from the previous rule configuration to
still appear.\n\nSince features are being removed from significant
events, this is a\ntemporary fix to prevent the bug from
occurring.\n\nBefore:\n\n\nhttps://github.com/user-attachments/assets/bf5e21ea-c55e-487c-9f32-163d767b13ad\n\nAfter:\n\n\nhttps://github.com/user-attachments/assets/268f4e65-1861-4a46-b07b-9473238995df","sha":"2a334537c8304aff48176fa671fc3698fd2f393a","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","backport:version","v9.4.0","author:actionable-obs","Feature:SigEvents","v9.3.1"],"title":"[Streams][SigEvents]
Prevent editing feature of significant event
queries","number":249716,"url":"https://github.com/elastic/kibana/pull/249716","mergeCommit":{"message":"[Streams][SigEvents]
Prevent editing feature of significant event queries (#249716)\n\n###
Summary\n\nThis PR prevents modifying the `feature` field of existing
significant\nevent queries in both the UI and API. Feature selection
remains\navailable when **creating** new significant events, but
becomes\nread-only when **editing** existing ones.\n\n###
Background\n\nWhen creating a significant event, a detection rule is
created combining\nthe KQL query with the feature condition. The rule ID
is generated from\nthe `ASSET_UUID` and `kql.query` only - it does not
include the\n`feature` field. When the feature changes, the rule ID
stays the same,\ncausing alerts from the previous rule configuration to
still appear.\n\nSince features are being removed from significant
events, this is a\ntemporary fix to prevent the bug from
occurring.\n\nBefore:\n\n\nhttps://github.com/user-attachments/assets/bf5e21ea-c55e-487c-9f32-163d767b13ad\n\nAfter:\n\n\nhttps://github.com/user-attachments/assets/268f4e65-1861-4a46-b07b-9473238995df","sha":"2a334537c8304aff48176fa671fc3698fd2f393a"}},"sourceBranch":"main","suggestedTargetBranches":["9.3"],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/249716","number":249716,"mergeCommit":{"message":"[Streams][SigEvents]
Prevent editing feature of significant event queries (#249716)\n\n###
Summary\n\nThis PR prevents modifying the `feature` field of existing
significant\nevent queries in both the UI and API. Feature selection
remains\navailable when **creating** new significant events, but
becomes\nread-only when **editing** existing ones.\n\n###
Background\n\nWhen creating a significant event, a detection rule is
created combining\nthe KQL query with the feature condition. The rule ID
is generated from\nthe `ASSET_UUID` and `kql.query` only - it does not
include the\n`feature` field. When the feature changes, the rule ID
stays the same,\ncausing alerts from the previous rule configuration to
still appear.\n\nSince features are being removed from significant
events, this is a\ntemporary fix to prevent the bug from
occurring.\n\nBefore:\n\n\nhttps://github.com/user-attachments/assets/bf5e21ea-c55e-487c-9f32-163d767b13ad\n\nAfter:\n\n\nhttps://github.com/user-attachments/assets/268f4e65-1861-4a46-b07b-9473238995df","sha":"2a334537c8304aff48176fa671fc3698fd2f393a"}},{"branch":"9.3","label":"v9.3.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: Francesco Fagnani <fagnani.francesco@gmail.com>
Co-authored-by: Francesco Fagnani <francesco.fagnani@elastic.co>
qn895 pushed a commit to qn895/kibana that referenced this pull request Jan 22, 2026
…ries (elastic#249716)

### Summary

This PR prevents modifying the `feature` field of existing significant
event queries in both the UI and API. Feature selection remains
available when **creating** new significant events, but becomes
read-only when **editing** existing ones.

### Background

When creating a significant event, a detection rule is created combining
the KQL query with the feature condition. The rule ID is generated from
the `ASSET_UUID` and `kql.query` only - it does not include the
`feature` field. When the feature changes, the rule ID stays the same,
causing alerts from the previous rule configuration to still appear.

Since features are being removed from significant events, this is a
temporary fix to prevent the bug from occurring.

Before:


https://github.com/user-attachments/assets/bf5e21ea-c55e-487c-9f32-163d767b13ad

After:


https://github.com/user-attachments/assets/268f4e65-1861-4a46-b07b-9473238995df
dennis-tismenko pushed a commit to dennis-tismenko/kibana that referenced this pull request Jan 22, 2026
…ries (elastic#249716)

### Summary

This PR prevents modifying the `feature` field of existing significant
event queries in both the UI and API. Feature selection remains
available when **creating** new significant events, but becomes
read-only when **editing** existing ones.

### Background

When creating a significant event, a detection rule is created combining
the KQL query with the feature condition. The rule ID is generated from
the `ASSET_UUID` and `kql.query` only - it does not include the
`feature` field. When the feature changes, the rule ID stays the same,
causing alerts from the previous rule configuration to still appear.

Since features are being removed from significant events, this is a
temporary fix to prevent the bug from occurring.

Before:


https://github.com/user-attachments/assets/bf5e21ea-c55e-487c-9f32-163d767b13ad

After:


https://github.com/user-attachments/assets/268f4e65-1861-4a46-b07b-9473238995df
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author:actionable-obs PRs authored by the actionable obs team backport:version Backport to applied version labels Feature:SigEvents Significant events feature, related to streams and rules/alerts (RnA) release_note:fix v9.3.0 v9.3.1 v9.4.0

4 participants