[ResponseOps][Alerting v2] Move episodes time filter inside query, include previous actions - #290452
Open
umbopepato wants to merge 1 commit into
Open
Conversation
|
🤖 Jobs for this PR can be triggered through checkboxes. 🚧
ℹ️ To trigger the CI, please tick the checkbox below 👇
|
Contributor
💛 Build succeeded, but was flaky
Failed CI Steps
Metrics [docs]Async chunks
Page load bundle
Unknown metric groupstotal optimizer output size
warm start memory
|
umbopepato
marked this pull request as ready for review
September 11, 2026 10:32
|
Pinging @elastic/response-ops (Team:ResponseOps) |
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.
📄 Summary
Important
Alerting v2 work under feature flag disabled by default. See 🧪 Verification steps > ⚙️ Environment Setup for more information.
≥ 14 min, with a tooltip) when the episode started before the range, sincefirst_timestampcannot be outside the range. The flyout still shows the full value.🧪 Verification steps
⚙️ Environment Setup
Add the following flag to your
kibana.dev.yml:Then navigate to Stack Management > Advanced settings > Global, and enable Alerting v2
You need an episode that has been active for a while (i.e. more than an hour), with a tag and an ack added shortly after it started.
✅ Happy Path
Last 15 minutesselected≥followed by the duration seen inside the range, and hovering it explains why≥goes away and the duration becomes the full one⚡️ Edge Cases
≥row: it shows the full duration and the same tags and ack🐞 Known issues & potential improvements
pending_count: 0skip thependingstate, so when no earlier episode of the same series is in range we can't tell whether we saw the start, and the row shows≥even when the duration is exact.$.alert-episodesview has the same aggregation shape and Discover pushes its own range down, so the profile is not covered by this change.🧰 Implementation details
The range is sent as a request filter (
bool.should: [type == "alert" AND range, exists(action_type)]) throughinput.filtersinstead of theesqlfunction'stimeField, so ES still bounds the.rule-eventsscan at the Lucene level and every.alert-actionsdoc passes. Measured on 2M events at 12h: 0.18s vs 0.11s before.I first tried selecting the episodes in range with an
IN (subquery)and aggregating their full history (@adcoelho's suggestion), to fix the duration too. ES does not push the subquery down: 28s on the same data. A literal id list is pushed down (0.3s), but that means two requests.📷 Screenshots
⏪ Backport rationale
Alerting v2 pre-GA work, not backporting
🔗 References
Fixes https://github.com/elastic/rna-program/issues/1030
☑️ Checklist
backport:*labels.