Skip to content

Commit 7a89f55

Browse files
committed
feat(integrations): Send SLO lifecycle metrics to Sentry via SDK
Adds a direct sentry_sdk.metrics.count() call alongside the existing metrics.incr() in record_event() so SLO metrics (started, success, halted, failure) are sent to Sentry at 100% with integration_id, bypassing the DualWrite experimental backend's 5% sample rate.
1 parent 7041372 commit 7a89f55

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/sentry/integrations/utils/metrics.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from typing import Any, Self
99

1010
import sentry_sdk
11+
from django.conf import settings
1112

1213
from sentry import options
1314
from sentry.exceptions import RestrictedIPAddress
@@ -167,6 +168,7 @@ def record_event(
167168

168169
sample_rate = 1.0
169170
metrics.incr(key, tags=tags, sample_rate=sample_rate)
171+
sentry_sdk.metrics.count(f"{settings.SENTRY_METRICS_PREFIX}{key}", 1, attributes=dict(tags))
170172

171173
sentry_sdk.set_tags(tags)
172174

0 commit comments

Comments
 (0)