feat(billing): Gate trace metric bytes notification behind feature flag#112285
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c3f80d6. Configure here.
| 'continuous-profiling-billing', | ||
| 'seer-billing', | ||
| 'logs-billing', | ||
| 'expose-category-trace-metric-byte', |
There was a problem hiding this comment.
Positive test missing assertion for Metrics (Bytes) visibility
Low Severity
The positive test case adds expose-category-trace-metric-byte to the features list but never asserts that Metrics (Bytes) is visible. Every other feature-gated category (profile hours, seer budget, logs, active contributors) has a corresponding getByText assertion in this test. The negative test at line 530 also passes vacuously because isBilledCategory is false for TRACE_METRIC_BYTE in DATA_CATEGORY_INFO, meaning the field quotaTraceMetricBytes is never generated by CATEGORY_QUOTA_FIELDS — so the feature flag gating is never actually exercised by either test.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit c3f80d6. Configure here.
| if (field.name.startsWith('quotaTraceMetricBytes') && !hasTraceMetricsBilling) { | ||
| return false; | ||
| } |
There was a problem hiding this comment.
Bug: The feature flag gate for quotaTraceMetricBytes is dead code because the field is never generated due to its data category having isBilledCategory: false.
Severity: MEDIUM
Suggested Fix
To make the feature functional, change isBilledCategory to true for the TRACE_METRIC_BYTE data category in constants/index.tsx. Additionally, add a test case that asserts the 'Metrics (Bytes)' option is visible when the feature flag is enabled.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location:
static/app/views/settings/account/notifications/notificationSettingsByType.tsx#L289-L291
Potential issue: The feature flag gate intended to control the visibility of the
'Metrics (Bytes)' notification setting will never execute. The field it checks for,
`quotaTraceMetricBytes`, is never generated because the field generation logic filters
for data categories with `isBilledCategory: true`. However, the `TRACE_METRIC_BYTE`
category is configured with `isBilledCategory: false`, causing it to be filtered out
before the feature flag check is ever reached. As a result, the feature is
non-functional, and the setting will not appear for users even when the flag is enabled.
This is corroborated by a missing assertion in the test suite for the positive case
where the flag is enabled.
Did we get this right? 👍 / 👎 to inform future reviews.
There was a problem hiding this comment.
will be added in a separate PR i'm gating it first
…ag (#112285) The backend notification setting is added in #112282 — this PR handles the frontend ff gating. closes https://linear.app/getsentry/issue/BIL-2216/update-notifications-backend-for-trace-metrics-settings


The backend notification setting is added in #112282 — this PR handles the frontend ff gating.
closes https://linear.app/getsentry/issue/BIL-2216/update-notifications-backend-for-trace-metrics-settings