Skip to content

Commit f5010b5

Browse files
authored
feat(billing): Update notification settings for Logs (#95289)
Closes: https://linear.app/getsentry/issue/BIL-1077/add-setting-exclusions-as-necessary
1 parent b352476 commit f5010b5

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

static/app/views/settings/account/notifications/notificationSettingsByType.spec.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ describe('NotificationSettingsByType', function () {
324324
'am3-tier',
325325
'continuous-profiling-billing',
326326
'seer-billing',
327+
'logs-billing',
327328
],
328329
});
329330
renderComponent({
@@ -343,6 +344,7 @@ describe('NotificationSettingsByType', function () {
343344
).toBeInTheDocument();
344345
expect(screen.getByText('UI Profile Hours', {exact: true})).toBeInTheDocument();
345346
expect(screen.getByText('Seer Budget')).toBeInTheDocument();
347+
expect(screen.getByText('Logs')).toBeInTheDocument();
346348
expect(screen.queryByText('Transactions')).not.toBeInTheDocument();
347349

348350
const editSettingMock = MockApiClient.addMockResponse({
@@ -494,6 +496,7 @@ describe('NotificationSettingsByType', function () {
494496
'am3-tier',
495497
// No continuous-profiling-billing feature
496498
// No seer-billing feature
499+
// No logs-billing feature
497500
],
498501
});
499502
renderComponent({
@@ -517,5 +520,6 @@ describe('NotificationSettingsByType', function () {
517520
expect(screen.queryByText('UI Profile Hours', {exact: true})).not.toBeInTheDocument();
518521
expect(screen.queryByText('Transactions')).not.toBeInTheDocument();
519522
expect(screen.queryByText('Seer Budget')).not.toBeInTheDocument();
523+
expect(screen.queryByText('Logs')).not.toBeInTheDocument();
520524
});
521525
});

static/app/views/settings/account/notifications/notificationSettingsByType.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,16 @@ export function NotificationSettingsByType({notificationType}: Props) {
208208
organization.features?.includes('seer-billing')
209209
);
210210

211+
const hasLogsBilling = organizations.some(organization =>
212+
organization.features?.includes('logs-billing')
213+
);
214+
211215
const excludeTransactions = hasOrgWithAm3 && !hasOrgWithoutAm3;
212216
const includeSpans = hasOrgWithAm3;
213217
const includeProfileDuration =
214218
(hasOrgWithAm2 || hasOrgWithAm3) && hasOrgWithContinuousProfilingBilling;
215219
const includeSeer = hasSeerBilling;
220+
const includeLogs = hasLogsBilling;
216221

217222
return fields.filter(field => {
218223
if (field.name === 'quotaSpans' && !includeSpans) {
@@ -230,6 +235,9 @@ export function NotificationSettingsByType({notificationType}: Props) {
230235
if (field.name.startsWith('quotaSeer') && !includeSeer) {
231236
return false;
232237
}
238+
if (field.name.startsWith('quotaLogBytes') && !includeLogs) {
239+
return false;
240+
}
233241
return true;
234242
});
235243
};

static/gsApp/components/gsBanner.spec.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2171,12 +2171,14 @@ describe('GSBanner Overage Alerts', function () {
21712171
// this would never happen in practice, but we're asserting that we properly filter out non-billed categories
21722172
logItems: MetricHistoryFixture({usageExceeded: true}),
21732173
profileChunks: MetricHistoryFixture({usageExceeded: true}),
2174+
profiles: MetricHistoryFixture({usageExceeded: true}),
21742175
},
21752176
});
21762177
subscription.planDetails.categories = [
21772178
...subscription.planDetails.categories,
21782179
DataCategory.LOG_ITEM,
21792180
DataCategory.PROFILE_CHUNKS,
2181+
DataCategory.PROFILES,
21802182
];
21812183
SubscriptionStore.set(organization.slug, subscription);
21822184

@@ -2199,6 +2201,7 @@ describe('GSBanner Overage Alerts', function () {
21992201
const nonBilledOveragePrompts = [
22002202
'log_items_overage_alert',
22012203
'profile_chunks_overage_alert',
2204+
'profiles_overage_alert',
22022205
];
22032206
expect(
22042207
(lastCall[1].query.feature as string[]).some(prompt =>

0 commit comments

Comments
 (0)