remove show_all_group_by_instances from schema and change UI to selec…#8
Open
mgiota wants to merge 1 commit intoslo_alerts_schema_registrationfrom
Open
remove show_all_group_by_instances from schema and change UI to selec…#8mgiota wants to merge 1 commit intoslo_alerts_schema_registrationfrom
mgiota wants to merge 1 commit intoslo_alerts_schema_registrationfrom
Conversation
…t first slo definition and then instances
This was referenced Mar 17, 2026
mgiota
pushed a commit
that referenced
this pull request
Apr 2, 2026
Closes elastic#258318 Closes elastic#258319 ## Summary Adds logic to the alert episodes table to display `.alert_actions` information. This includes: - New action-specific API paths. - Snooze - **Per group hash.** - Button in the actions column opens a popover where an `until` can be picked. - **When snoozed** - A bell shows up in the status column. - Mouse over the bell icon to see until when the snooze is in effect. - Unsnooze - **Per group hash.** - Clicking the button removes the snooze. - Ack/Unack - **Per episode.** - Button in the actions column - When "acked", an icon shows in the status column. - Tags - This PR only handles displaying tags. They need to be created via API. - Resolve/Unresolve - **Per group hash.** - Button inside the ellipsis always - The status is turned to `inactive` **regardless of the "real" status.** <img width="1704" height="672" alt="Screenshot 2026-03-25 at 16 04 12" src="https://github.com/user-attachments/assets/5ef4111a-6e0c-4114-a60e-ce5f81a86ac6" /> ## Testing <details> <summary>POST mock episodes</summary> ``` POST _bulk { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:00:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-1" }, "group_hash": "gh-1", "episode": { "id": "ep-001", "status": "pending" }, "status": "breached" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:01:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-1" }, "group_hash": "gh-1", "episode": { "id": "ep-001", "status": "pending" }, "status": "no_data" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:02:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-1" }, "group_hash": "gh-1", "episode": { "id": "ep-001", "status": "inactive" }, "status": "recovered" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:03:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-1" }, "group_hash": "gh-1", "episode": { "id": "ep-001", "status": "inactive" }, "status": "no_data" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:04:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-1" }, "group_hash": "gh-1", "episode": { "id": "ep-001", "status": "inactive" }, "status": "recovered" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:05:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-1" }, "group_hash": "gh-1", "episode": { "id": "ep-001", "status": "pending" }, "status": "breached" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:06:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-1" }, "group_hash": "gh-1", "episode": { "id": "ep-001", "status": "active" }, "status": "breached" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:07:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-1" }, "group_hash": "gh-2", "episode": { "id": "ep-002", "status": "active" }, "status": "breached" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:08:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-1" }, "group_hash": "gh-2", "episode": { "id": "ep-002", "status": "active" }, "status": "no_data" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:09:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-1" }, "group_hash": "gh-2", "episode": { "id": "ep-002", "status": "recovering" }, "status": "recovered" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:10:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-1" }, "group_hash": "gh-2", "episode": { "id": "ep-002", "status": "recovering" }, "status": "no_data" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:11:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-1" }, "group_hash": "gh-2", "episode": { "id": "ep-002", "status": "active" }, "status": "breached" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:12:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-1" }, "group_hash": "gh-2", "episode": { "id": "ep-002", "status": "recovering" }, "status": "recovered" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:13:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-1" }, "group_hash": "gh-2", "episode": { "id": "ep-002", "status": "inactive" }, "status": "recovered" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:14:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-1" }, "group_hash": "gh-1", "episode": { "id": "ep-003", "status": "pending" }, "status": "breached" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:15:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-1" }, "group_hash": "gh-1", "episode": { "id": "ep-003", "status": "inactive" }, "status": "recovered" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:16:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-1" }, "group_hash": "gh-4", "episode": { "id": "ep-004", "status": "pending" }, "status": "breached" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:17:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-1" }, "group_hash": "gh-4", "episode": { "id": "ep-004", "status": "active" }, "status": "breached" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:18:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-1" }, "group_hash": "gh-4", "episode": { "id": "ep-004", "status": "recovering" }, "status": "recovered" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:19:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-1" }, "group_hash": "gh-4", "episode": { "id": "ep-004", "status": "inactive" }, "status": "recovered" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:20:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-1" }, "group_hash": "gh-5", "episode": { "id": "ep-005", "status": "pending" }, "status": "breached" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:21:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-1" }, "group_hash": "gh-5", "episode": { "id": "ep-005", "status": "pending" }, "status": "no_data" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:22:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-1" }, "group_hash": "gh-5", "episode": { "id": "ep-005", "status": "inactive" }, "status": "recovered" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:23:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-1" }, "group_hash": "elasticgh-9", "episode": { "id": "ep-006", "status": "pending" }, "status": "breached" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:24:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-1" }, "group_hash": "elasticgh-9", "episode": { "id": "ep-006", "status": "active" }, "status": "breached" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:25:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-1" }, "group_hash": "elasticgh-9", "episode": { "id": "ep-006", "status": "active" }, "status": "no_data" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:26:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-1" }, "group_hash": "elasticgh-9", "episode": { "id": "ep-006", "status": "inactive" }, "status": "recovered" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:14:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-2" }, "group_hash": "gh-7", "episode": { "id": "ep-007", "status": "pending" }, "status": "breached" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:15:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-2" }, "group_hash": "gh-7", "episode": { "id": "ep-007", "status": "inactive" }, "status": "recovered" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:16:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-3" }, "group_hash": "gh-8", "episode": { "id": "ep-008", "status": "pending" }, "status": "breached" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:17:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-3" }, "group_hash": "gh-8", "episode": { "id": "ep-008", "status": "active" }, "status": "breached" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:18:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-3" }, "group_hash": "gh-8", "episode": { "id": "ep-008", "status": "recovering" }, "status": "recovered" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:20:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-4" }, "group_hash": "elasticgh-9", "episode": { "id": "ep-009", "status": "pending" }, "status": "breached" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:21:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-4" }, "group_hash": "elasticgh-9", "episode": { "id": "ep-009", "status": "pending" }, "status": "no_data" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:23:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-5" }, "group_hash": "elasticgh-10", "episode": { "id": "ep-010", "status": "pending" }, "status": "breached" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:24:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-5" }, "group_hash": "elasticgh-10", "episode": { "id": "ep-010", "status": "active" }, "status": "breached" } { "create": { "_index": ".rule-events" }} { "@timestamp": "2026-01-27T16:25:00.000Z", "source": "internal", "type": "alert", "rule": { "id": "rule-5" }, "group_hash": "elasticgh-10", "episode": { "id": "ep-010", "status": "active" }, "status": "no_data" } ``` </details> - In the POST above, episodes 1 and 3, and episodes 6 and 9 have the same group hashes. - Go to `https://localhost:5601/app/observability/alerts-v2` and try all buttons. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
mgiota
added a commit
to elastic/kibana
that referenced
this pull request
Apr 2, 2026
Fixes #252816 Fixes #257868 Legacy alerts embeddable saved state contained `showAllGroupByInstances` and `slos` (`id`, `instanceId`, `name`, `groupBy`). As part of this PR we do following changes (More context on [this issue](#257868)): - remove `showAllGroupByInstances` and keep slo_instance_id as the sole source of truth - remove `name` and groupBy` from schema. An SLO with updated name for example can lead to stale UI representation in the dashboard app. ## Acceptance criteria - schemas are registered server side - transforms are registered, where legacy stored shape is converted to REST API shape - REST API should be snake_case - public embeddable code should be updated to use new snake_case shape - types should be derived from schemas, duplicative type declarations should be removed - ensure backwards compatibility: confirm previously stored SLO error alert embeddables continue to work as expected - drilldown support - register SLO embeddable transform out in embeddablePlugin.registerLegacyURLTransform: Dashboard allows users to share unsaved dashboard changes. This feature stores embeddable state in URLs. ## Testing OAS documentation - add `server.oas.enabled: true` to config/kibana.dev.yml - start kibana with `yarn start --no-base-path` - Copy paste URL http://localhost:5601/api/oas?pathStartsWith=/api/dashboard&access=internal&version=1 into your browser. - View panels schema and verify slo alerts embeddable schema appears in the list. ## Testing validation Try to create a few dashboards with alerts embeddable through API calls in Kibana dev tools and verify validation and creation work as expected. ``` POST kbn:/api/dashboards?apiVersion=1 { "title": "Testing empty alerts embeddable through API call", "panels": [ { "config": {}, "grid": { "x": 1, "y": 0 }, "type": "slo_alerts" } ] } ``` ``` POST kbn:/api/dashboards?apiVersion=1 { "title": "Test a group by SLO with all instances", "panels": [ { "config": { "slos": [ { "slo_id": "6b523190-9da5-4bbc-8c37-fa3f3a3f5046", "slo_instance_id": "*" } ] }, "grid": { "x": 1, "y": 0 }, "type": "slo_alerts" } ] } ``` ``` POST kbn:/api/dashboards?apiVersion=1 { "title": "Test a group by SLO with a specific instance", "panels": [ { "config": { "slos": [ { "slo_id": "6b523190-9da5-4bbc-8c37-fa3f3a3f5046", "slo_instance_id": "something" } ] }, "grid": { "x": 1, "y": 0 }, "type": "slo_alerts" } ] } ``` ## Reference Regarding removal of `showAllGroupByInstances` we explored two approaches, **1)** keep the flag and normalize on load and **2)** remove the flag entirely. <img width="400" height="676" alt="Screenshot 2026-03-18 at 11 18 47" src="https://github.com/user-attachments/assets/ea6909f6-e98c-4bad-ac66-05c738e54126" /> I proceeded with `Option 2: remove the flag entirely` plus the simplest required UI change, where SLO selector support picking all instances (*) for group-by SLOs. <img width="400" height="301" alt="Screenshot 2026-03-18 at 11 44 49" src="https://github.com/user-attachments/assets/6c0a966b-6481-4381-8608-a8e1afdff97f" /> I decided not to proceed with a full UI refactoring implemented in this [PR](mgiota#8). This change can be done as a follow up after the schema registration PR is merged, if we decide we want to change the way we select SLOs in the alerts embeddable. <img width="400" height="474" alt="Screenshot 2026-03-18 at 11 41 33" src="https://github.com/user-attachments/assets/710a816f-3c40-42ae-ac65-6f13aac846e7" /> --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Faisal Kanout <faisal@kanout.com>
paulinashakirova
pushed a commit
to paulinashakirova/kibana
that referenced
this pull request
Apr 2, 2026
Fixes elastic#252816 Fixes elastic#257868 Legacy alerts embeddable saved state contained `showAllGroupByInstances` and `slos` (`id`, `instanceId`, `name`, `groupBy`). As part of this PR we do following changes (More context on [this issue](elastic#257868)): - remove `showAllGroupByInstances` and keep slo_instance_id as the sole source of truth - remove `name` and groupBy` from schema. An SLO with updated name for example can lead to stale UI representation in the dashboard app. ## Acceptance criteria - schemas are registered server side - transforms are registered, where legacy stored shape is converted to REST API shape - REST API should be snake_case - public embeddable code should be updated to use new snake_case shape - types should be derived from schemas, duplicative type declarations should be removed - ensure backwards compatibility: confirm previously stored SLO error alert embeddables continue to work as expected - drilldown support - register SLO embeddable transform out in embeddablePlugin.registerLegacyURLTransform: Dashboard allows users to share unsaved dashboard changes. This feature stores embeddable state in URLs. ## Testing OAS documentation - add `server.oas.enabled: true` to config/kibana.dev.yml - start kibana with `yarn start --no-base-path` - Copy paste URL http://localhost:5601/api/oas?pathStartsWith=/api/dashboard&access=internal&version=1 into your browser. - View panels schema and verify slo alerts embeddable schema appears in the list. ## Testing validation Try to create a few dashboards with alerts embeddable through API calls in Kibana dev tools and verify validation and creation work as expected. ``` POST kbn:/api/dashboards?apiVersion=1 { "title": "Testing empty alerts embeddable through API call", "panels": [ { "config": {}, "grid": { "x": 1, "y": 0 }, "type": "slo_alerts" } ] } ``` ``` POST kbn:/api/dashboards?apiVersion=1 { "title": "Test a group by SLO with all instances", "panels": [ { "config": { "slos": [ { "slo_id": "6b523190-9da5-4bbc-8c37-fa3f3a3f5046", "slo_instance_id": "*" } ] }, "grid": { "x": 1, "y": 0 }, "type": "slo_alerts" } ] } ``` ``` POST kbn:/api/dashboards?apiVersion=1 { "title": "Test a group by SLO with a specific instance", "panels": [ { "config": { "slos": [ { "slo_id": "6b523190-9da5-4bbc-8c37-fa3f3a3f5046", "slo_instance_id": "something" } ] }, "grid": { "x": 1, "y": 0 }, "type": "slo_alerts" } ] } ``` ## Reference Regarding removal of `showAllGroupByInstances` we explored two approaches, **1)** keep the flag and normalize on load and **2)** remove the flag entirely. <img width="400" height="676" alt="Screenshot 2026-03-18 at 11 18 47" src="https://github.com/user-attachments/assets/ea6909f6-e98c-4bad-ac66-05c738e54126" /> I proceeded with `Option 2: remove the flag entirely` plus the simplest required UI change, where SLO selector support picking all instances (*) for group-by SLOs. <img width="400" height="301" alt="Screenshot 2026-03-18 at 11 44 49" src="https://github.com/user-attachments/assets/6c0a966b-6481-4381-8608-a8e1afdff97f" /> I decided not to proceed with a full UI refactoring implemented in this [PR](mgiota#8). This change can be done as a follow up after the schema registration PR is merged, if we decide we want to change the way we select SLOs in the alerts embeddable. <img width="400" height="474" alt="Screenshot 2026-03-18 at 11 41 33" src="https://github.com/user-attachments/assets/710a816f-3c40-42ae-ac65-6f13aac846e7" /> --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Faisal Kanout <faisal@kanout.com>
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.
Fixes elastic#257868 (comment)
Screen.Recording.2026-03-16.at.14.40.31.mov