Browse Source

fix(workflow): Handle open in discover issue column when transaction dataset (#33268)

* fix(workflow): Handle open in discover issue column when transaction dataset

Previously, the Open in Discover button on a metric alert details page would link to a discover page with an Issue column for both error and transaction datasets. This PR checks if the eventType is transaction, and if it is, does not include the issue field.

FIXES WOR-1738

* move logic to metricChart
Kelly Carino 2 years ago
parent
commit
94495ae60a
1 changed files with 4 additions and 1 deletions
  1. 4 1
      static/app/views/alerts/rules/details/metricChart.tsx

+ 4 - 1
static/app/views/alerts/rules/details/metricChart.tsx

@@ -299,6 +299,9 @@ class MetricChart extends React.PureComponent<Props, State> {
     warningDuration: number
     warningDuration: number
   ) {
   ) {
     const {rule, orgId, project, timePeriod, query} = this.props;
     const {rule, orgId, project, timePeriod, query} = this.props;
+    const transactionFields = ['title', 'count()', 'count_unique(user)'];
+    const errorFields = ['issue', 'title', 'count()', 'count_unique(user)'];
+
     const ctaOpts = {
     const ctaOpts = {
       orgSlug: orgId,
       orgSlug: orgId,
       projects: [project],
       projects: [project],
@@ -306,7 +309,7 @@ class MetricChart extends React.PureComponent<Props, State> {
       eventType: query,
       eventType: query,
       start: timePeriod.start,
       start: timePeriod.start,
       end: timePeriod.end,
       end: timePeriod.end,
-      fields: ['issue', 'title', 'count()', 'count_unique(user)'],
+      fields: rule.dataset === 'transactions' ? transactionFields : errorFields,
     };
     };
 
 
     const {buttonText, ...props} = makeDefaultCta(ctaOpts);
     const {buttonText, ...props} = makeDefaultCta(ctaOpts);