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

fix test

0e49895
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden completed Mar 26, 2026 in 2m 14s

1 issue

High

QuerySubscription.DoesNotExist not handled in get_metric_issue_context call - `src/sentry/notifications/platform/slack/renderers/metric_alert.py:32-33`

The call to MetricAlertNotificationData.get_metric_issue_context(event) at line 32-33 internally calls QuerySubscription.objects.get() without exception handling. If the subscription was deleted between notification data creation and rendering, this raises QuerySubscription.DoesNotExist and crashes the entire render operation. This matches the stale reference pattern (Check 2) seen in 81 production issues with 1.4M events.

Also found at:

  • src/sentry/notifications/platform/templates/metric_alert.py:150-151
2 skills analyzed
Skill Findings Duration Cost
sentry-security 0 1m 12s $1.40
sentry-backend-bugs 1 2m 8s $1.31

Duration: 3m 20s · Tokens: 1.8M in / 18.3k out · Cost: $2.72 (+extraction: $0.01, +merge: $0.00, +dedup: $0.00)