Browse Source

fix(metrics): Allow searching namespace and type only in mri mode (#71232)

Allow searching for metric type and namespace only in MRI mode as it is
confusing otherwise.

- Closes https://github.com/getsentry/sentry/issues/71211
ArthurKnaus 9 months ago
parent
commit
854796e826
1 changed files with 5 additions and 2 deletions
  1. 5 2
      static/app/views/metrics/queryBuilder.tsx

+ 5 - 2
static/app/views/metrics/queryBuilder.tsx

@@ -224,8 +224,11 @@ export const QueryBuilder = memo(function QueryBuilder({
         label: mriMode
           ? metric.mri
           : middleEllipsis(formatMRI(metric.mri) ?? '', 46, /\.|-|_/),
-        // enable search by mri, name, unit (millisecond), type (c:), and readable type (counter)
-        textValue: `${metric.mri}${getReadableMetricType(metric.type)}`,
+        textValue: mriMode
+          ? // enable search by mri, name, unit (millisecond), type (c:), and readable type (counter)
+            `${metric.mri}${getReadableMetricType(metric.type)}`
+          : // enable search in the full formatted string
+            formatMRI(metric.mri),
         value: metric.mri,
         details:
           metric.projectIds.length > 0 ? (