Browse Source

feat(org-stats): Show spans + profile hours, hide txns (#71145)

Scott Cooper 9 months ago
parent
commit
9726b4f4a8

+ 1 - 1
static/app/constants/index.tsx

@@ -328,7 +328,7 @@ export const DATA_CATEGORY_INFO = {
   },
   },
   [DataCategoryExact.PROFILE_DURATION]: {
   [DataCategoryExact.PROFILE_DURATION]: {
     name: DataCategoryExact.PROFILE_DURATION,
     name: DataCategoryExact.PROFILE_DURATION,
-    apiName: 'profileDuration',
+    apiName: 'profile_duration',
     plural: 'profileDuration',
     plural: 'profileDuration',
     displayName: 'profile hours',
     displayName: 'profile hours',
     titleName: t('Profile Hours'),
     titleName: t('Profile Hours'),

+ 9 - 0
static/app/views/organizationStats/index.tsx

@@ -324,6 +324,15 @@ export class OrganizationStats extends Component<OrganizationStatsProps> {
       if (opt.value === DATA_CATEGORY_INFO.metrics.plural) {
       if (opt.value === DATA_CATEGORY_INFO.metrics.plural) {
         return hasCustomMetrics(organization);
         return hasCustomMetrics(organization);
       }
       }
+      if (
+        DATA_CATEGORY_INFO.profileDuration.plural === opt.value ||
+        DATA_CATEGORY_INFO.span.plural === opt.value
+      ) {
+        return organization.features.includes('spans-usage-tracking');
+      }
+      if (DATA_CATEGORY_INFO.transaction.plural === opt.value) {
+        return !organization.features.includes('spans-usage-tracking');
+      }
       return true;
       return true;
     });
     });
 
 

+ 12 - 0
static/app/views/organizationStats/usageChart/index.tsx

@@ -94,6 +94,18 @@ export const CHART_OPTIONS_DATACATEGORY: CategoryOption[] = [
     disabled: false,
     disabled: false,
     yAxisMinInterval: 100,
     yAxisMinInterval: 100,
   },
   },
+  {
+    label: DATA_CATEGORY_INFO.span.titleName,
+    value: DATA_CATEGORY_INFO.span.plural,
+    disabled: false,
+    yAxisMinInterval: 100,
+  },
+  {
+    label: DATA_CATEGORY_INFO.profileDuration.titleName,
+    value: DATA_CATEGORY_INFO.profileDuration.plural,
+    disabled: false,
+    yAxisMinInterval: 100,
+  },
 ];
 ];
 
 
 export enum ChartDataTransform {
 export enum ChartDataTransform {