Skip to content

fix(alerts): include hashed query when constructing idents#382

Merged
tronghn merged 1 commit intomainfrom
fix-duplicate-alert-ids
Apr 1, 2026
Merged

fix(alerts): include hashed query when constructing idents#382
tronghn merged 1 commit intomainfrom
fix-duplicate-alert-ids

Conversation

@tronghn
Copy link
Copy Markdown
Contributor

@tronghn tronghn commented Apr 1, 2026

PrometheusAlert.ID() built identifiers from (alertType, teamSlug, environment, ruleGroup, name). Prometheus allows multiple alerting rules with the same name in a rule group (differentiated by query/duration), so distinct alerts produced identical IDs.

We add a SHA-256 hash of the query as a 6th component in the ident, making each alert's ID unique.

`PrometheusAlert.ID()` built identifiers from (alertType, teamSlug, environment, ruleGroup, name). Prometheus allows multiple alerting rules with the same name in a rule group (differentiated by query/duration), so distinct alerts produced identical IDs.

We add a SHA-256 hash of the query as a 6th component in the ident, making each alert's ID unique.
@tronghn tronghn requested a review from a team as a code owner April 1, 2026 08:03
@tronghn tronghn merged commit da05186 into main Apr 1, 2026
10 checks passed
@tronghn tronghn deleted the fix-duplicate-alert-ids branch April 1, 2026 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant