Skip to content

Commit

Permalink
fix(dynamic sampling): Correct spans nomenclature based on DS (#86213)
Browse files Browse the repository at this point in the history
Updates the usage alert to use the right term when one of the included
categories is spans ("accepted span" when DS has been used during the
monthly usage cycle, "span" otherwise).

Closes
https://www.notion.so/sentry/Usage-exceeded-banner-should-not-include-stored-spans-when-no-DS-has-been-used-1a58b10e4b5d80bd945bde6ec7f4854b?pvs=4

# before 

![image](https://github.com/user-attachments/assets/d5c3f378-c75b-4f5d-8580-1569305db9a7)


# after

![image](https://github.com/user-attachments/assets/659fb96e-3ca1-49a9-bcad-62fdce8724a9)


If DS hasn't been used, the alert remains unchanged:

![image](https://github.com/user-attachments/assets/ab4d9b28-c75d-42fd-a6df-efa4a6a23687)
  • Loading branch information
isabellaenriquez authored Mar 3, 2025
1 parent 2463cfd commit b9b797a
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions static/gsApp/views/subscriptionPage/usageAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ function UsageAlert({organization, subscription, usage}: Props) {
plan: subscription.planDetails,
category,
capitalize: false,
hadCustomDynamicSampling: subscription.hadCustomDynamicSampling,
});

return category === DataCategory.ATTACHMENTS
Expand Down Expand Up @@ -161,21 +162,24 @@ function UsageAlert({organization, subscription, usage}: Props) {
}

function renderExceededInfo() {
const exceededList = sortCategoriesWithKeys(subscription.categories).reduce(
(acc, [category, currentHistory]) => {
const exceededList = sortCategoriesWithKeys(subscription.categories)
.filter(
([category]) =>
category !== DataCategory.SPANS_INDEXED || subscription.hadCustomDynamicSampling
)
.reduce((acc, [category, currentHistory]) => {
if (currentHistory.usageExceeded) {
acc.push(
getPlanCategoryName({
plan: subscription.planDetails,
category,
capitalize: false,
hadCustomDynamicSampling: subscription.hadCustomDynamicSampling,
})
);
}
return acc;
},
[] as string[]
);
}, [] as string[]);

const quotasExceeded =
exceededList.length > 0
Expand All @@ -184,6 +188,7 @@ function UsageAlert({organization, subscription, usage}: Props) {
plan: subscription.planDetails,
category: DataCategory.ERRORS,
capitalize: false,
hadCustomDynamicSampling: subscription.hadCustomDynamicSampling,
});

return (
Expand Down

0 comments on commit b9b797a

Please sign in to comment.