Skip to content

feat(notifications): Add notification data and renderer for metric alerts#111674

Merged
Christinarlong merged 16 commits into
masterfrom
crl/meetric-alert-data
Mar 30, 2026
Merged

feat(notifications): Add notification data and renderer for metric alerts#111674
Christinarlong merged 16 commits into
masterfrom
crl/meetric-alert-data

Merge branch 'master' into crl/meetric-alert-data

dc5aefb
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden: sentry-backend-bugs completed Mar 30, 2026 in 3m 25s

1 issue

sentry-backend-bugs: Found 1 issue (1 medium)

Medium

Activity.objects.get() missing DoesNotExist handler causes notification failures - `src/sentry/notifications/platform/slack/renderers/metric_alert.py:51`

The Activity.objects.get(id=data.activity_id) call has no exception handling. When an activity is deleted between notification creation and rendering, this raises Activity.DoesNotExist. The notification will fail silently and create a Sentry issue.

Also found at:

  • src/sentry/notifications/platform/slack/renderers/metric_alert.py:52
  • src/sentry/notifications/platform/slack/renderers/metric_alert.py:72

Duration: 3m 22s · Tokens: 1.1M in / 16.5k out · Cost: $1.47 (+extraction: $0.00, +merge: $0.00)

Annotations

Check warning on line 51 in src/sentry/notifications/platform/slack/renderers/metric_alert.py

See this annotation in the file changed.

@sentry-warden sentry-warden / warden: sentry-backend-bugs

Activity.objects.get() missing DoesNotExist handler causes notification failures

The `Activity.objects.get(id=data.activity_id)` call has no exception handling. When an activity is deleted between notification creation and rendering, this raises `Activity.DoesNotExist`. The notification will fail silently and create a Sentry issue.

Check warning on line 52 in src/sentry/notifications/platform/slack/renderers/metric_alert.py

See this annotation in the file changed.

@sentry-warden sentry-warden / warden: sentry-backend-bugs

[PN2-B8B] Activity.objects.get() missing DoesNotExist handler causes notification failures (additional location)

The `Activity.objects.get(id=data.activity_id)` call has no exception handling. When an activity is deleted between notification creation and rendering, this raises `Activity.DoesNotExist`. The notification will fail silently and create a Sentry issue.

Check warning on line 72 in src/sentry/notifications/platform/slack/renderers/metric_alert.py

See this annotation in the file changed.

@sentry-warden sentry-warden / warden: sentry-backend-bugs

[PN2-B8B] Activity.objects.get() missing DoesNotExist handler causes notification failures (additional location)

The `Activity.objects.get(id=data.activity_id)` call has no exception handling. When an activity is deleted between notification creation and rendering, this raises `Activity.DoesNotExist`. The notification will fail silently and create a Sentry issue.