From fd9e89e22eec1fd21ffd864e87b48bbde3dc054c Mon Sep 17 00:00:00 2001 From: Brendan Hy Date: Mon, 6 Apr 2026 13:08:03 -0700 Subject: [PATCH 1/2] feat(billing): Add notification setting for trace metric bytes Add QUOTA_TRACE_METRIC_BYTES to NotificationSettingEnum so users can manage quota notifications for the trace_metric_bytes data category, matching the pattern used for other quota notification types. Refs BIL-2216 Co-Authored-By: Claude Sonnet 4 Made-with: Cursor --- src/sentry/notifications/types.py | 5 +++++ .../api/endpoints/test_user_notification_settings_options.py | 1 + 2 files changed, 6 insertions(+) diff --git a/src/sentry/notifications/types.py b/src/sentry/notifications/types.py index a68d5c222b32f6..09ced27513c7cc 100644 --- a/src/sentry/notifications/types.py +++ b/src/sentry/notifications/types.py @@ -34,6 +34,7 @@ class NotificationSettingEnum(ValueEqualityEnum): QUOTA_SEER_BUDGET = "quotaSeerBudget" QUOTA_SPEND_ALLOCATIONS = "quotaSpendAllocations" QUOTA_LOG_BYTES = "quotaLogBytes" + QUOTA_TRACE_METRIC_BYTES = "quotaTraceMetricBytes" QUOTA_SEER_USERS = "quotaSeerUsers" QUOTA_SIZE_ANALYSIS = "quotaSizeAnalyses" SPIKE_PROTECTION = "spikeProtection" @@ -152,6 +153,10 @@ class UserOptionsSettingsKey(Enum): NotificationSettingsOptionEnum.ALWAYS, NotificationSettingsOptionEnum.NEVER, }, + NotificationSettingEnum.QUOTA_TRACE_METRIC_BYTES: { + NotificationSettingsOptionEnum.ALWAYS, + NotificationSettingsOptionEnum.NEVER, + }, NotificationSettingEnum.QUOTA_SEER_USERS: { NotificationSettingsOptionEnum.ALWAYS, NotificationSettingsOptionEnum.NEVER, diff --git a/tests/sentry/notifications/api/endpoints/test_user_notification_settings_options.py b/tests/sentry/notifications/api/endpoints/test_user_notification_settings_options.py index cfaa96c7e2b53f..4dbe450dc81c1e 100644 --- a/tests/sentry/notifications/api/endpoints/test_user_notification_settings_options.py +++ b/tests/sentry/notifications/api/endpoints/test_user_notification_settings_options.py @@ -104,6 +104,7 @@ def test_user_scope(self) -> None: NotificationSettingEnum.QUOTA_MONITOR_SEATS, NotificationSettingEnum.QUOTA_SPANS, NotificationSettingEnum.QUOTA_LOG_BYTES, + NotificationSettingEnum.QUOTA_TRACE_METRIC_BYTES, NotificationSettingEnum.QUOTA_SEER_USERS, NotificationSettingEnum.QUOTA_SIZE_ANALYSIS, ] From cac4891ce2c04829e90bdcb1782c3ee4a878be70 Mon Sep 17 00:00:00 2001 From: Brendan Hy Date: Mon, 6 Apr 2026 13:46:57 -0700 Subject: [PATCH 2/2] fix(billing): Add default notification setting for trace metric bytes Add QUOTA_TRACE_METRIC_BYTES to NOTIFICATION_SETTINGS_TYPE_DEFAULTS so it defaults to ALWAYS, consistent with all other quota notification types. Refs BIL-2216 Co-Authored-By: Claude Sonnet 4 Made-with: Cursor --- src/sentry/notifications/defaults.py | 1 + .../notifications/api/endpoints/test_notification_defaults.py | 1 + 2 files changed, 2 insertions(+) diff --git a/src/sentry/notifications/defaults.py b/src/sentry/notifications/defaults.py index 1c3edfc865f73f..ac67a5312c83ad 100644 --- a/src/sentry/notifications/defaults.py +++ b/src/sentry/notifications/defaults.py @@ -24,6 +24,7 @@ NotificationSettingEnum.QUOTA_PROFILE_DURATION_UI: NotificationSettingsOptionEnum.ALWAYS, NotificationSettingEnum.QUOTA_SEER_BUDGET: NotificationSettingsOptionEnum.ALWAYS, NotificationSettingEnum.QUOTA_LOG_BYTES: NotificationSettingsOptionEnum.ALWAYS, + NotificationSettingEnum.QUOTA_TRACE_METRIC_BYTES: NotificationSettingsOptionEnum.ALWAYS, NotificationSettingEnum.QUOTA_SEER_USERS: NotificationSettingsOptionEnum.ALWAYS, NotificationSettingEnum.QUOTA_SIZE_ANALYSIS: NotificationSettingsOptionEnum.ALWAYS, NotificationSettingEnum.QUOTA_WARNINGS: NotificationSettingsOptionEnum.ALWAYS, diff --git a/tests/sentry/notifications/api/endpoints/test_notification_defaults.py b/tests/sentry/notifications/api/endpoints/test_notification_defaults.py index 99475074dbc880..d66877c298ab48 100644 --- a/tests/sentry/notifications/api/endpoints/test_notification_defaults.py +++ b/tests/sentry/notifications/api/endpoints/test_notification_defaults.py @@ -30,6 +30,7 @@ def test_basic(self) -> None: "quotaProfileDurationUI": "always", "quotaSeerBudget": "always", "quotaLogBytes": "always", + "quotaTraceMetricBytes": "always", "reports": "always", "spikeProtection": "always", "workflow": "subscribe_only",