getsentry / getsentry/sentry

Slack alert notification broken when updating alert rule

Open
#81,816 3 comments 0 reactions 0 assignees View on GitHub
Bug Product Area: Settings - Integrations
Dominant language
Python
Stars
44.8k
Forks
4.9k
Avg merge
22h 21m
Merged PRs (30d)
586

Description

Steps to reproduce:

1. Create a metric alert with a slack notification & have it trigger an incident
2. While there is an ongoing incident, update the alert rule

This results in a "resolved" notification on the slack channel but the link in the message is broken.
Here's an example alert: [https://sentry.sentry.io/alerts/rules/details/301046/]()
Fired a critical alert correctly: [https://sentry.slack.com/archives/C084970JVS5/p1733506448573949]()
Then I updated the alert rule, and I got this: [https://sentry.slack.com/archives/C084970JVS5/p1733506455001009]()
This link is [broken]() (it's pointing to the snapshotted alert rule id).
Subsequent notifications link correctly.

Looks like this is happening because when we update an alert rule, [we snapshot it]().
As a part of snapshotting it, we [autoresolve snapshot incidents]() - we pass down
the snapshotted alert id here. If there are any open incidents at this time, we mark them
as closed and kick off the [incident triggers]().
Since the incident triggers happen on an snapshot alert id, it goes to a broken page.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.