Browse Source

feat(alerts): enable transaction.duration filter (#51679)

Ogi 1 year ago
parent
commit
5ce98ee7da
1 changed files with 8 additions and 1 deletions
  1. 8 1
      static/app/views/alerts/wizard/options.tsx

+ 8 - 1
static/app/views/alerts/wizard/options.tsx

@@ -244,7 +244,7 @@ export function datasetSupportedTags(
       [Dataset.ERRORS]: undefined,
       [Dataset.TRANSACTIONS]: org.features.includes('alert-allow-indexed')
         ? undefined
-        : TRANSACTION_SUPPORTED_TAGS,
+        : transactionSupportedTags(org),
       [Dataset.METRICS]: SESSION_SUPPORTED_TAGS,
       [Dataset.GENERIC_METRICS]: org.features.includes('alert-allow-indexed')
         ? undefined
@@ -257,6 +257,13 @@ export function datasetSupportedTags(
   )[dataset];
 }
 
+function transactionSupportedTags(org: Organization) {
+  if (org.features.includes('on-demand-metrics-extraction')) {
+    return [...TRANSACTION_SUPPORTED_TAGS, FieldKey.TRANSACTION_DURATION];
+  }
+  return TRANSACTION_SUPPORTED_TAGS;
+}
+
 // Some data sets support all tags except some. For these cases, define the
 // omissions only
 export function datasetOmittedTags(