Browse Source

ref(js): Use UPPER_CASE for field enums (#50354)

Evan Purkhiser 1 year ago
parent
commit
0457fc23bc

+ 4 - 4
static/app/components/discover/performanceCardTable.tsx

@@ -451,10 +451,10 @@ function PerformanceCardTable({
 
   function renderMobilePerformance() {
     const mobileVitals = [
-      MobileVital.AppStartCold,
-      MobileVital.AppStartWarm,
-      MobileVital.FramesSlow,
-      MobileVital.FramesFrozen,
+      MobileVital.APP_START_COLD,
+      MobileVital.APP_START_WARM,
+      MobileVital.FRAMES_SLOW,
+      MobileVital.FRAMES_FROZEN,
     ];
     const mobileVitalTitles = mobileVitals.map(mobileVital => {
       return (

+ 2 - 2
static/app/components/events/interfaces/spans/utils.tsx

@@ -556,8 +556,8 @@ export function getMeasurements(
     WebVital.FID,
     WebVital.LCP,
     WebVital.TTFB,
-    MobileVital.TimeToFullDisplay,
-    MobileVital.TimeToInitialDisplay,
+    MobileVital.TIME_TO_FULL_DISPLAY,
+    MobileVital.TIME_TO_INITIAL_DISPLAY,
   ]);
 
   const measurements = Object.keys(event.measurements)

+ 47 - 47
static/app/utils/discover/fields.tsx

@@ -172,14 +172,14 @@ const getDocsAndOutputType = (key: AggregationKey) => {
 // Refer to src/sentry/search/events/fields.py
 // Try to keep functions logically sorted, ie. all the count functions are grouped together
 export const AGGREGATIONS = {
-  [AggregationKey.Count]: {
-    ...getDocsAndOutputType(AggregationKey.Count),
+  [AggregationKey.COUNT]: {
+    ...getDocsAndOutputType(AggregationKey.COUNT),
     parameters: [],
     isSortable: true,
     multiPlotType: 'area',
   },
-  [AggregationKey.CountUnique]: {
-    ...getDocsAndOutputType(AggregationKey.CountUnique),
+  [AggregationKey.COUNT_UNIQUE]: {
+    ...getDocsAndOutputType(AggregationKey.COUNT_UNIQUE),
     parameters: [
       {
         kind: 'column',
@@ -191,8 +191,8 @@ export const AGGREGATIONS = {
     isSortable: true,
     multiPlotType: 'area',
   },
-  [AggregationKey.CountMiserable]: {
-    ...getDocsAndOutputType(AggregationKey.CountMiserable),
+  [AggregationKey.COUNT_MISERABLE]: {
+    ...getDocsAndOutputType(AggregationKey.COUNT_MISERABLE),
     getFieldOverrides({parameter}: DefaultValueInputs) {
       if (parameter.kind === 'column') {
         return {defaultValue: 'user'};
@@ -218,8 +218,8 @@ export const AGGREGATIONS = {
     isSortable: true,
     multiPlotType: 'area',
   },
-  [AggregationKey.CountIf]: {
-    ...getDocsAndOutputType(AggregationKey.CountIf),
+  [AggregationKey.COUNT_IF]: {
+    ...getDocsAndOutputType(AggregationKey.COUNT_IF),
     parameters: [
       {
         kind: 'column',
@@ -247,8 +247,8 @@ export const AGGREGATIONS = {
     isSortable: true,
     multiPlotType: 'area',
   },
-  [AggregationKey.CountWebVitals]: {
-    ...getDocsAndOutputType(AggregationKey.CountWebVitals),
+  [AggregationKey.COUNT_WEB_VITALS]: {
+    ...getDocsAndOutputType(AggregationKey.COUNT_WEB_VITALS),
     parameters: [
       {
         kind: 'column',
@@ -273,26 +273,26 @@ export const AGGREGATIONS = {
     isSortable: true,
     multiPlotType: 'area',
   },
-  [AggregationKey.Eps]: {
-    ...getDocsAndOutputType(AggregationKey.Eps),
+  [AggregationKey.EPS]: {
+    ...getDocsAndOutputType(AggregationKey.EPS),
     parameters: [],
     isSortable: true,
     multiPlotType: 'area',
   },
-  [AggregationKey.Epm]: {
-    ...getDocsAndOutputType(AggregationKey.Epm),
+  [AggregationKey.EPM]: {
+    ...getDocsAndOutputType(AggregationKey.EPM),
     parameters: [],
     isSortable: true,
     multiPlotType: 'area',
   },
-  [AggregationKey.FailureCount]: {
-    ...getDocsAndOutputType(AggregationKey.FailureCount),
+  [AggregationKey.FAILURE_COUNT]: {
+    ...getDocsAndOutputType(AggregationKey.FAILURE_COUNT),
     parameters: [],
     isSortable: true,
     multiPlotType: 'line',
   },
-  [AggregationKey.Min]: {
-    ...getDocsAndOutputType(AggregationKey.Min),
+  [AggregationKey.MIN]: {
+    ...getDocsAndOutputType(AggregationKey.MIN),
     parameters: [
       {
         kind: 'column',
@@ -310,8 +310,8 @@ export const AGGREGATIONS = {
     isSortable: true,
     multiPlotType: 'line',
   },
-  [AggregationKey.Max]: {
-    ...getDocsAndOutputType(AggregationKey.Max),
+  [AggregationKey.MAX]: {
+    ...getDocsAndOutputType(AggregationKey.MAX),
     parameters: [
       {
         kind: 'column',
@@ -329,8 +329,8 @@ export const AGGREGATIONS = {
     isSortable: true,
     multiPlotType: 'line',
   },
-  [AggregationKey.Sum]: {
-    ...getDocsAndOutputType(AggregationKey.Sum),
+  [AggregationKey.SUM]: {
+    ...getDocsAndOutputType(AggregationKey.SUM),
     parameters: [
       {
         kind: 'column',
@@ -342,8 +342,8 @@ export const AGGREGATIONS = {
     isSortable: true,
     multiPlotType: 'area',
   },
-  [AggregationKey.Any]: {
-    ...getDocsAndOutputType(AggregationKey.Any),
+  [AggregationKey.ANY]: {
+    ...getDocsAndOutputType(AggregationKey.ANY),
     parameters: [
       {
         kind: 'column',
@@ -420,8 +420,8 @@ export const AGGREGATIONS = {
     isSortable: true,
     multiPlotType: 'line',
   },
-  [AggregationKey.Percentile]: {
-    ...getDocsAndOutputType(AggregationKey.Percentile),
+  [AggregationKey.PERCENTILE]: {
+    ...getDocsAndOutputType(AggregationKey.PERCENTILE),
     parameters: [
       {
         kind: 'column',
@@ -439,8 +439,8 @@ export const AGGREGATIONS = {
     isSortable: true,
     multiPlotType: 'line',
   },
-  [AggregationKey.Avg]: {
-    ...getDocsAndOutputType(AggregationKey.Avg),
+  [AggregationKey.AVG]: {
+    ...getDocsAndOutputType(AggregationKey.AVG),
     parameters: [
       {
         kind: 'column',
@@ -452,8 +452,8 @@ export const AGGREGATIONS = {
     isSortable: true,
     multiPlotType: 'line',
   },
-  [AggregationKey.Apdex]: {
-    ...getDocsAndOutputType(AggregationKey.Apdex),
+  [AggregationKey.APDEX]: {
+    ...getDocsAndOutputType(AggregationKey.APDEX),
     parameters: [
       {
         kind: 'value',
@@ -465,8 +465,8 @@ export const AGGREGATIONS = {
     isSortable: true,
     multiPlotType: 'line',
   },
-  [AggregationKey.UserMisery]: {
-    ...getDocsAndOutputType(AggregationKey.UserMisery),
+  [AggregationKey.USER_MISERY]: {
+    ...getDocsAndOutputType(AggregationKey.USER_MISERY),
     parameters: [
       {
         kind: 'value',
@@ -478,14 +478,14 @@ export const AGGREGATIONS = {
     isSortable: true,
     multiPlotType: 'line',
   },
-  [AggregationKey.FailureRate]: {
-    ...getDocsAndOutputType(AggregationKey.FailureRate),
+  [AggregationKey.FAILURE_RATE]: {
+    ...getDocsAndOutputType(AggregationKey.FAILURE_RATE),
     parameters: [],
     isSortable: true,
     multiPlotType: 'line',
   },
-  [AggregationKey.LastSeen]: {
-    ...getDocsAndOutputType(AggregationKey.LastSeen),
+  [AggregationKey.LAST_SEEN]: {
+    ...getDocsAndOutputType(AggregationKey.LAST_SEEN),
     parameters: [],
     isSortable: true,
   },
@@ -493,8 +493,8 @@ export const AGGREGATIONS = {
 
 // TPM and TPS are aliases that are only used in Performance
 export const ALIASES = {
-  tpm: AggregationKey.Epm,
-  tps: AggregationKey.Eps,
+  tpm: AggregationKey.EPM,
+  tps: AggregationKey.EPS,
 };
 
 assert(AGGREGATIONS as Readonly<{[key in AggregationKey]: Aggregation}>);
@@ -606,8 +606,8 @@ export const SPAN_OP_BREAKDOWN_FIELDS = Object.values(SpanOpBreakdown);
 
 // This list contains fields/functions that are available with performance-view feature.
 export const TRACING_FIELDS = [
-  AggregationKey.Avg,
-  AggregationKey.Sum,
+  AggregationKey.AVG,
+  AggregationKey.SUM,
   FieldKey.TRANSACTION_DURATION,
   FieldKey.TRANSACTION_OP,
   FieldKey.TRANSACTION_STATUS,
@@ -617,13 +617,13 @@ export const TRACING_FIELDS = [
   AggregationKey.P95,
   AggregationKey.P99,
   AggregationKey.P100,
-  AggregationKey.Percentile,
-  AggregationKey.FailureRate,
-  AggregationKey.Apdex,
-  AggregationKey.CountMiserable,
-  AggregationKey.UserMisery,
-  AggregationKey.Eps,
-  AggregationKey.Epm,
+  AggregationKey.PERCENTILE,
+  AggregationKey.FAILURE_RATE,
+  AggregationKey.APDEX,
+  AggregationKey.COUNT_MISERABLE,
+  AggregationKey.USER_MISERY,
+  AggregationKey.EPS,
+  AggregationKey.EPM,
   'team_key_transaction',
   ...Object.keys(MEASUREMENT_FIELDS),
   ...SPAN_OP_BREAKDOWN_FIELDS,

+ 77 - 77
static/app/utils/fields/index.ts

@@ -142,53 +142,53 @@ export enum WebVital {
 }
 
 export enum MobileVital {
-  AppStartCold = 'measurements.app_start_cold',
-  AppStartWarm = 'measurements.app_start_warm',
-  FramesTotal = 'measurements.frames_total',
-  FramesSlow = 'measurements.frames_slow',
-  FramesFrozen = 'measurements.frames_frozen',
-  FramesSlowRate = 'measurements.frames_slow_rate',
-  FramesFrozenRate = 'measurements.frames_frozen_rate',
-  StallCount = 'measurements.stall_count',
-  StallTotalTime = 'measurements.stall_total_time',
-  StallLongestTime = 'measurements.stall_longest_time',
-  StallPercentage = 'measurements.stall_percentage',
-  TimeToFullDisplay = 'measurements.time_to_full_display',
-  TimeToInitialDisplay = 'measurements.time_to_initial_display',
+  APP_START_COLD = 'measurements.app_start_cold',
+  APP_START_WARM = 'measurements.app_start_warm',
+  FRAMES_TOTAL = 'measurements.frames_total',
+  FRAMES_SLOW = 'measurements.frames_slow',
+  FRAMES_FROZEN = 'measurements.frames_frozen',
+  FRAMES_SLOW_RATE = 'measurements.frames_slow_rate',
+  FRAMES_FROZEN_RATE = 'measurements.frames_frozen_rate',
+  STALL_COUNT = 'measurements.stall_count',
+  STALL_TOTAL_TIME = 'measurements.stall_total_time',
+  STALL_LONGEST_TIME = 'measurements.stall_longest_time',
+  STALL_PERCENTAGE = 'measurements.stall_percentage',
+  TIME_TO_FULL_DISPLAY = 'measurements.time_to_full_display',
+  TIME_TO_INITIAL_DISPLAY = 'measurements.time_to_initial_display',
 }
 
 export enum SpanOpBreakdown {
-  SpansBrowser = 'spans.browser',
-  SpansDb = 'spans.db',
-  SpansHttp = 'spans.http',
-  SpansResource = 'spans.resource',
-  SpansUi = 'spans.ui',
+  SPANS_BROWSER = 'spans.browser',
+  SPANS_DB = 'spans.db',
+  SPANS_HTTP = 'spans.http',
+  SPANS_RESOURCE = 'spans.resource',
+  SPANS_UI = 'spans.ui',
 }
 
 export enum AggregationKey {
-  Count = 'count',
-  CountUnique = 'count_unique',
-  CountMiserable = 'count_miserable',
-  CountIf = 'count_if',
-  CountWebVitals = 'count_web_vitals',
-  Eps = 'eps',
-  Epm = 'epm',
-  FailureCount = 'failure_count',
-  Min = 'min',
-  Max = 'max',
-  Sum = 'sum',
-  Any = 'any',
+  COUNT = 'count',
+  COUNT_UNIQUE = 'count_unique',
+  COUNT_MISERABLE = 'count_miserable',
+  COUNT_IF = 'count_if',
+  COUNT_WEB_VITALS = 'count_web_vitals',
+  EPS = 'eps',
+  EPM = 'epm',
+  FAILURE_COUNT = 'failure_count',
+  MIN = 'min',
+  MAX = 'max',
+  SUM = 'sum',
+  ANY = 'any',
   P50 = 'p50',
   P75 = 'p75',
   P95 = 'p95',
   P99 = 'p99',
   P100 = 'p100',
-  Percentile = 'percentile',
-  Avg = 'avg',
-  Apdex = 'apdex',
-  UserMisery = 'user_misery',
-  FailureRate = 'failure_rate',
-  LastSeen = 'last_seen',
+  PERCENTILE = 'percentile',
+  AVG = 'avg',
+  APDEX = 'apdex',
+  USER_MISERY = 'user_misery',
+  FAILURE_RATE = 'failure_rate',
+  LAST_SEEN = 'last_seen',
 }
 
 export interface FieldDefinition {
@@ -213,67 +213,67 @@ export interface FieldDefinition {
 }
 
 export const AGGREGATION_FIELDS: Record<AggregationKey, FieldDefinition> = {
-  [AggregationKey.Count]: {
+  [AggregationKey.COUNT]: {
     desc: t('count of events'),
     kind: FieldKind.FUNCTION,
     valueType: FieldValueType.NUMBER,
   },
-  [AggregationKey.CountUnique]: {
+  [AggregationKey.COUNT_UNIQUE]: {
     desc: t('Unique count of the field values'),
     kind: FieldKind.FUNCTION,
     valueType: FieldValueType.INTEGER,
   },
-  [AggregationKey.CountMiserable]: {
+  [AggregationKey.COUNT_MISERABLE]: {
     desc: t('Count of unique miserable users'),
     kind: FieldKind.FUNCTION,
     valueType: FieldValueType.NUMBER,
   },
-  [AggregationKey.CountIf]: {
+  [AggregationKey.COUNT_IF]: {
     desc: t('Count of events matching the parameter conditions'),
     kind: FieldKind.FUNCTION,
     valueType: FieldValueType.NUMBER,
   },
-  [AggregationKey.CountWebVitals]: {
+  [AggregationKey.COUNT_WEB_VITALS]: {
     desc: t('Count of web vitals with a specific status'),
     kind: FieldKind.FUNCTION,
     valueType: FieldValueType.NUMBER,
   },
-  [AggregationKey.Eps]: {
+  [AggregationKey.EPS]: {
     desc: t('Events per second'),
     kind: FieldKind.FUNCTION,
     valueType: FieldValueType.NUMBER,
   },
-  [AggregationKey.Epm]: {
+  [AggregationKey.EPM]: {
     desc: t('Events per minute'),
     kind: FieldKind.FUNCTION,
     valueType: FieldValueType.NUMBER,
   },
-  [AggregationKey.FailureRate]: {
+  [AggregationKey.FAILURE_RATE]: {
     desc: t('Failed event percentage based on transaction.status'),
     kind: FieldKind.FUNCTION,
     valueType: FieldValueType.PERCENTAGE,
   },
-  [AggregationKey.FailureCount]: {
+  [AggregationKey.FAILURE_COUNT]: {
     desc: t('Failed event count based on transaction.status'),
     kind: FieldKind.FUNCTION,
     valueType: FieldValueType.NUMBER,
   },
-  [AggregationKey.Min]: {
+  [AggregationKey.MIN]: {
     desc: t('Returns the minimum value of the selected field'),
     kind: FieldKind.FUNCTION,
     valueType: null,
   },
-  [AggregationKey.Max]: {
+  [AggregationKey.MAX]: {
     desc: t('Returns maximum value of the selected field'),
     kind: FieldKind.FUNCTION,
     valueType: null,
   },
-  [AggregationKey.Sum]: {
+  [AggregationKey.SUM]: {
     desc: t('Returns the total value for the selected field'),
     kind: FieldKind.FUNCTION,
     valueType: null,
   },
-  [AggregationKey.Any]: {
+  [AggregationKey.ANY]: {
     desc: t('Not Recommended, a random field value'),
     kind: FieldKind.FUNCTION,
     valueType: null,
@@ -303,29 +303,29 @@ export const AGGREGATION_FIELDS: Record<AggregationKey, FieldDefinition> = {
     kind: FieldKind.FUNCTION,
     valueType: null,
   },
-  [AggregationKey.Percentile]: {
+  [AggregationKey.PERCENTILE]: {
     desc: t('Returns the percentile of the selected field'),
     kind: FieldKind.FUNCTION,
     valueType: null,
   },
-  [AggregationKey.Avg]: {
+  [AggregationKey.AVG]: {
     desc: t('Returns averages for a selected field'),
     kind: FieldKind.FUNCTION,
     valueType: null,
   },
-  [AggregationKey.Apdex]: {
+  [AggregationKey.APDEX]: {
     desc: t('Performance score based on a duration threshold'),
     kind: FieldKind.FUNCTION,
     valueType: FieldValueType.NUMBER,
   },
-  [AggregationKey.UserMisery]: {
+  [AggregationKey.USER_MISERY]: {
     desc: t(
       'User-weighted performance metric that counts the number of unique users who were frustrated'
     ),
     kind: FieldKind.FUNCTION,
     valueType: null,
   },
-  [AggregationKey.LastSeen]: {
+  [AggregationKey.LAST_SEEN]: {
     desc: t('Issues last seen at a date and time'),
     kind: FieldKind.FUNCTION,
     valueType: FieldValueType.DATE,
@@ -368,69 +368,69 @@ export const MEASUREMENT_FIELDS: Record<WebVital | MobileVital, FieldDefinition>
     kind: FieldKind.METRICS,
     valueType: FieldValueType.DURATION,
   },
-  [MobileVital.AppStartCold]: {
+  [MobileVital.APP_START_COLD]: {
     desc: t('First launch (not in memory and no process exists)'),
     kind: FieldKind.METRICS,
     valueType: FieldValueType.DURATION,
   },
-  [MobileVital.AppStartWarm]: {
+  [MobileVital.APP_START_WARM]: {
     desc: t('Already launched (partial memory and process may exist)'),
     kind: FieldKind.METRICS,
     valueType: FieldValueType.DURATION,
   },
-  [MobileVital.FramesTotal]: {
+  [MobileVital.FRAMES_TOTAL]: {
     desc: t('Total number of frames'),
     kind: FieldKind.METRICS,
     valueType: FieldValueType.INTEGER,
   },
-  [MobileVital.FramesSlow]: {
+  [MobileVital.FRAMES_SLOW]: {
     desc: t('Number of slow frames'),
     kind: FieldKind.METRICS,
     valueType: FieldValueType.INTEGER,
   },
-  [MobileVital.FramesFrozen]: {
+  [MobileVital.FRAMES_FROZEN]: {
     desc: t('Number of frozen frames'),
     kind: FieldKind.METRICS,
     valueType: FieldValueType.INTEGER,
   },
-  [MobileVital.FramesSlowRate]: {
+  [MobileVital.FRAMES_SLOW_RATE]: {
     desc: t('Number of slow frames out of the total'),
     kind: FieldKind.METRICS,
     valueType: FieldValueType.PERCENTAGE,
   },
-  [MobileVital.FramesFrozenRate]: {
+  [MobileVital.FRAMES_FROZEN_RATE]: {
     desc: t('Number of frozen frames out of the total'),
     kind: FieldKind.METRICS,
     valueType: FieldValueType.PERCENTAGE,
   },
-  [MobileVital.StallCount]: {
+  [MobileVital.STALL_COUNT]: {
     desc: t('Count of slow Javascript event loops (React Native)'),
     kind: FieldKind.METRICS,
     valueType: FieldValueType.INTEGER,
   },
-  [MobileVital.StallTotalTime]: {
+  [MobileVital.STALL_TOTAL_TIME]: {
     desc: t('Total stall duration (React Native)'),
     kind: FieldKind.METRICS,
     valueType: FieldValueType.PERCENTAGE,
   },
-  [MobileVital.StallLongestTime]: {
+  [MobileVital.STALL_LONGEST_TIME]: {
     desc: t('Duration of slowest Javascript event loop (React Native)'),
     kind: FieldKind.METRICS,
     valueType: FieldValueType.INTEGER,
   },
-  [MobileVital.StallPercentage]: {
+  [MobileVital.STALL_PERCENTAGE]: {
     desc: t('Total stall duration out of the total transaction duration (React Native)'),
     kind: FieldKind.METRICS,
     valueType: FieldValueType.PERCENTAGE,
   },
-  [MobileVital.TimeToFullDisplay]: {
+  [MobileVital.TIME_TO_FULL_DISPLAY]: {
     desc: t(
       'The time between application launch and complete display of all resources and views'
     ),
     kind: FieldKind.METRICS,
     valueType: FieldValueType.DURATION,
   },
-  [MobileVital.TimeToInitialDisplay]: {
+  [MobileVital.TIME_TO_INITIAL_DISPLAY]: {
     desc: t('The time it takes for an application to produce its first frame'),
     kind: FieldKind.METRICS,
     valueType: FieldValueType.DURATION,
@@ -438,27 +438,27 @@ export const MEASUREMENT_FIELDS: Record<WebVital | MobileVital, FieldDefinition>
 };
 
 export const SPAN_OP_FIELDS: Record<SpanOpBreakdown, FieldDefinition> = {
-  [SpanOpBreakdown.SpansBrowser]: {
+  [SpanOpBreakdown.SPANS_BROWSER]: {
     desc: t('Cumulative time based on the browser operation'),
     kind: FieldKind.METRICS,
     valueType: FieldValueType.DURATION,
   },
-  [SpanOpBreakdown.SpansDb]: {
+  [SpanOpBreakdown.SPANS_DB]: {
     desc: t('Cumulative time based on the database operation'),
     kind: FieldKind.METRICS,
     valueType: FieldValueType.DURATION,
   },
-  [SpanOpBreakdown.SpansHttp]: {
+  [SpanOpBreakdown.SPANS_HTTP]: {
     desc: t('Cumulative time based on the http operation'),
     kind: FieldKind.METRICS,
     valueType: FieldValueType.DURATION,
   },
-  [SpanOpBreakdown.SpansResource]: {
+  [SpanOpBreakdown.SPANS_RESOURCE]: {
     desc: t('Cumulative time based on the resource operation'),
     kind: FieldKind.METRICS,
     valueType: FieldValueType.DURATION,
   },
-  [SpanOpBreakdown.SpansUi]: {
+  [SpanOpBreakdown.SPANS_UI]: {
     desc: t('Cumulative time based on the ui operation'),
     kind: FieldKind.METRICS,
     valueType: FieldValueType.DURATION,
@@ -1148,11 +1148,11 @@ export const DISCOVER_FIELDS = [
   FieldKey.USER_DISPLAY,
 
   // Span Op fields
-  SpanOpBreakdown.SpansBrowser,
-  SpanOpBreakdown.SpansDb,
-  SpanOpBreakdown.SpansHttp,
-  SpanOpBreakdown.SpansResource,
-  SpanOpBreakdown.SpansUi,
+  SpanOpBreakdown.SPANS_BROWSER,
+  SpanOpBreakdown.SPANS_DB,
+  SpanOpBreakdown.SPANS_HTTP,
+  SpanOpBreakdown.SPANS_RESOURCE,
+  SpanOpBreakdown.SPANS_UI,
 ];
 
 export enum ReplayFieldKey {

+ 26 - 26
static/app/utils/performance/vitals/constants.tsx

@@ -77,110 +77,110 @@ export const WEB_VITAL_DETAILS: Record<WebVital, Vital> = {
 };
 
 export const MOBILE_VITAL_DETAILS: Record<MobileVital, Vital> = {
-  [MobileVital.AppStartCold]: {
+  [MobileVital.APP_START_COLD]: {
     slug: 'app_start_cold',
     name: t('App Start Cold'),
     description: t(
       'Cold start is a measure of the application start up time from scratch.'
     ),
-    type: measurementType(MobileVital.AppStartCold),
+    type: measurementType(MobileVital.APP_START_COLD),
   },
-  [MobileVital.AppStartWarm]: {
+  [MobileVital.APP_START_WARM]: {
     slug: 'app_start_warm',
     name: t('App Start Warm'),
     description: t(
       'Warm start is a measure of the application start up time while still in memory.'
     ),
-    type: measurementType(MobileVital.AppStartWarm),
+    type: measurementType(MobileVital.APP_START_WARM),
   },
-  [MobileVital.FramesTotal]: {
+  [MobileVital.FRAMES_TOTAL]: {
     slug: 'frames_total',
     name: t('Total Frames'),
     description: t(
       'Total frames is a count of the number of frames recorded within a transaction.'
     ),
-    type: measurementType(MobileVital.FramesTotal),
+    type: measurementType(MobileVital.FRAMES_TOTAL),
   },
-  [MobileVital.FramesSlow]: {
+  [MobileVital.FRAMES_SLOW]: {
     slug: 'frames_slow',
     name: t('Slow Frames'),
     description: t(
       'Slow frames is a count of the number of slow frames recorded within a transaction.'
     ),
-    type: measurementType(MobileVital.FramesSlow),
+    type: measurementType(MobileVital.FRAMES_SLOW),
   },
-  [MobileVital.FramesFrozen]: {
+  [MobileVital.FRAMES_FROZEN]: {
     slug: 'frames_frozen',
     name: t('Frozen Frames'),
     description: t(
       'Frozen frames is a count of the number of frozen frames recorded within a transaction.'
     ),
-    type: measurementType(MobileVital.FramesFrozen),
+    type: measurementType(MobileVital.FRAMES_FROZEN),
   },
-  [MobileVital.FramesSlowRate]: {
+  [MobileVital.FRAMES_SLOW_RATE]: {
     slug: 'frames_slow_rate',
     name: t('Slow Frames Rate'),
     description: t(
       'Slow Frames Rate is the percentage of frames recorded within a transaction that is considered slow.'
     ),
-    type: measurementType(MobileVital.FramesSlowRate),
+    type: measurementType(MobileVital.FRAMES_SLOW_RATE),
   },
-  [MobileVital.FramesFrozenRate]: {
+  [MobileVital.FRAMES_FROZEN_RATE]: {
     slug: 'frames_frozen_rate',
     name: t('Frozen Frames Rate'),
     description: t(
       'Frozen Frames Rate is the percentage of frames recorded within a transaction that is considered frozen.'
     ),
-    type: measurementType(MobileVital.FramesFrozenRate),
+    type: measurementType(MobileVital.FRAMES_FROZEN_RATE),
   },
-  [MobileVital.StallCount]: {
+  [MobileVital.STALL_COUNT]: {
     slug: 'stall_count',
     name: t('Stalls'),
     description: t(
       'Stalls is the number of times the application stalled within a transaction.'
     ),
-    type: measurementType(MobileVital.StallCount),
+    type: measurementType(MobileVital.STALL_COUNT),
   },
-  [MobileVital.StallTotalTime]: {
+  [MobileVital.STALL_TOTAL_TIME]: {
     slug: 'stall_total_time',
     name: t('Total Stall Time'),
     description: t(
       'Stall Total Time is the total amount of time the application is stalled within a transaction.'
     ),
-    type: measurementType(MobileVital.StallTotalTime),
+    type: measurementType(MobileVital.STALL_TOTAL_TIME),
   },
-  [MobileVital.StallLongestTime]: {
+  [MobileVital.STALL_LONGEST_TIME]: {
     slug: 'stall_longest_time',
     name: t('Longest Stall Time'),
     description: t(
       'Stall Longest Time is the longest amount of time the application is stalled within a transaction.'
     ),
-    type: measurementType(MobileVital.StallLongestTime),
+    type: measurementType(MobileVital.STALL_LONGEST_TIME),
   },
-  [MobileVital.StallPercentage]: {
+  [MobileVital.STALL_PERCENTAGE]: {
     slug: 'stall_percentage',
     name: t('Stall Percentage'),
     description: t(
       'Stall Percentage is the percentage of the transaction duration the application was stalled.'
     ),
-    type: measurementType(MobileVital.StallPercentage),
+    type: measurementType(MobileVital.STALL_PERCENTAGE),
   },
-  [MobileVital.TimeToFullDisplay]: {
+  [MobileVital.TIME_TO_FULL_DISPLAY]: {
     slug: 'time_to_full_display',
     name: t('Time To Full Display'),
     acronym: 'TTFD',
     description: t(
       'The time between application launch and complete display of all resources and views.'
     ),
-    type: measurementType(MobileVital.TimeToFullDisplay),
+    type: measurementType(MobileVital.TIME_TO_FULL_DISPLAY),
   },
-  [MobileVital.TimeToInitialDisplay]: {
+  [MobileVital.TIME_TO_INITIAL_DISPLAY]: {
     slug: 'time_to_initial_display',
     name: t('Time To Initial Display'),
     acronym: 'TTID',
     description: t('The time it takes for an application to produce its first frame.'),
     poorThreshold: 2000,
-    type: measurementType(MobileVital.TimeToInitialDisplay),
+    type: measurementType(MobileVital.TIME_TO_INITIAL_DISPLAY),
   },
 };
 

+ 6 - 6
static/app/views/alerts/rules/metric/constants.tsx

@@ -51,13 +51,13 @@ export type OptionConfig = {
  * Allowed error aggregations for alerts
  */
 export const errorFieldConfig: OptionConfig = {
-  aggregations: [AggregationKey.Count, AggregationKey.CountUnique],
+  aggregations: [AggregationKey.COUNT, AggregationKey.COUNT_UNIQUE],
   fields: ['user'],
 };
 
 const commonAggregations = [
-  AggregationKey.Avg,
-  AggregationKey.Percentile,
+  AggregationKey.AVG,
+  AggregationKey.PERCENTILE,
   AggregationKey.P50,
   AggregationKey.P75,
   AggregationKey.P95,
@@ -67,9 +67,9 @@ const commonAggregations = [
 
 const allAggregations = [
   ...commonAggregations,
-  AggregationKey.FailureRate,
-  AggregationKey.Apdex,
-  AggregationKey.Count,
+  AggregationKey.FAILURE_RATE,
+  AggregationKey.APDEX,
+  AggregationKey.COUNT,
 ];
 
 export const DuplicateMetricFields: string[] = [

+ 5 - 5
static/app/views/performance/transactionSummary/filter.tsx

@@ -26,11 +26,11 @@ export enum SpanOperationBreakdownFilter {
 export const SPAN_OPERATION_BREAKDOWN_FILTER_TO_FIELD: Partial<
   Record<SpanOperationBreakdownFilter, string>
 > = {
-  [SpanOperationBreakdownFilter.Http]: SpanOpBreakdown.SpansHttp,
-  [SpanOperationBreakdownFilter.Db]: SpanOpBreakdown.SpansDb,
-  [SpanOperationBreakdownFilter.Browser]: SpanOpBreakdown.SpansBrowser,
-  [SpanOperationBreakdownFilter.Resource]: SpanOpBreakdown.SpansResource,
-  [SpanOperationBreakdownFilter.Ui]: SpanOpBreakdown.SpansUi,
+  [SpanOperationBreakdownFilter.Http]: SpanOpBreakdown.SPANS_HTTP,
+  [SpanOperationBreakdownFilter.Db]: SpanOpBreakdown.SPANS_DB,
+  [SpanOperationBreakdownFilter.Browser]: SpanOpBreakdown.SPANS_BROWSER,
+  [SpanOperationBreakdownFilter.Resource]: SpanOpBreakdown.SPANS_RESOURCE,
+  [SpanOperationBreakdownFilter.Ui]: SpanOpBreakdown.SPANS_UI,
 };
 
 const OPTIONS: SpanOperationBreakdownFilter[] = [

+ 7 - 7
static/app/views/releases/detail/overview/index.tsx

@@ -210,9 +210,9 @@ class ReleaseOverview extends AsyncView<Props> {
               `p75(${WebVital.FID})`,
               `p75(${WebVital.LCP})`,
               `p75(${WebVital.CLS})`,
-              `p75(${SpanOpBreakdown.SpansHttp})`,
-              `p75(${SpanOpBreakdown.SpansBrowser})`,
-              `p75(${SpanOpBreakdown.SpansResource})`,
+              `p75(${SpanOpBreakdown.SPANS_HTTP})`,
+              `p75(${SpanOpBreakdown.SPANS_BROWSER})`,
+              `p75(${SpanOpBreakdown.SPANS_RESOURCE})`,
             ],
           }) as EventView)
         : performanceType === PROJECT_PERFORMANCE_TYPE.BACKEND
@@ -225,10 +225,10 @@ class ReleaseOverview extends AsyncView<Props> {
             ...baseQuery,
             fields: [
               ...baseQuery.fields,
-              `p75(${MobileVital.AppStartCold})`,
-              `p75(${MobileVital.AppStartWarm})`,
-              `p75(${MobileVital.FramesSlow})`,
-              `p75(${MobileVital.FramesFrozen})`,
+              `p75(${MobileVital.APP_START_COLD})`,
+              `p75(${MobileVital.APP_START_WARM})`,
+              `p75(${MobileVital.FRAMES_SLOW})`,
+              `p75(${MobileVital.FRAMES_FROZEN})`,
             ],
           }) as EventView)
         : (EventView.fromSavedQuery({