Browse Source

feat(alerts): Add custom metrics illustration (#60754)

Add illustration for custom metrics.
Rename performance > custom metrics into custom measurements.

- closes https://github.com/getsentry/sentry/issues/60249
- closes https://github.com/getsentry/sentry/issues/60577
ArthurKnaus 1 year ago
parent
commit
8d12cd66d4

+ 2 - 2
static/app/views/alerts/rules/metric/ruleForm.spec.tsx

@@ -266,11 +266,11 @@ describe('Incident Rules Form', () => {
       });
 
       await userEvent.click(screen.getAllByText('Number of Errors').at(1)!);
-      await userEvent.click(await screen.findByText('Custom Metric'));
+      await userEvent.click(await screen.findByText('Custom Measurement'));
 
       await userEvent.click(screen.getAllByText('event.type:transaction').at(1)!);
       await userEvent.click(await screen.findByText('event.type:error'));
-      expect(screen.getAllByText('Custom Metric')).toHaveLength(2);
+      expect(screen.getAllByText('Custom Measurement')).toHaveLength(2);
       await userEvent.click(screen.getByLabelText('Save Rule'));
 
       expect(createRule).toHaveBeenLastCalledWith(

+ 10 - 7
static/app/views/alerts/rules/metric/wizardField.tsx

@@ -108,7 +108,7 @@ export default function WizardField({
         ...(hasDdmAlertsSupport(organization)
           ? [
               {
-                label: AlertWizardAlertNames.custom_metrics,
+                label: AlertWizardAlertNames.custom_transactions,
                 value: 'custom_transactions' as const,
               },
             ]
@@ -118,12 +118,15 @@ export default function WizardField({
     {
       label: hasDdmAlertsSupport(organization) ? t('METRICS') : t('CUSTOM'),
       options: [
-        {
-          label: AlertWizardAlertNames.custom_metrics,
-          value: hasDdmAlertsSupport(organization)
-            ? 'custom_metrics'
-            : 'custom_transactions',
-        },
+        hasDdmAlertsSupport(organization)
+          ? {
+              label: AlertWizardAlertNames.custom_metrics,
+              value: 'custom_metrics',
+            }
+          : {
+              label: AlertWizardAlertNames.custom_transactions,
+              value: 'custom_transactions',
+            },
       ],
     },
   ];

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

@@ -71,7 +71,7 @@ export const AlertWizardAlertNames: Record<AlertType, string> = {
   fid: t('First Input Delay'),
   cls: t('Cumulative Layout Shift'),
   custom_metrics: t('Custom Metric'),
-  custom_transactions: t('Custom Metric'),
+  custom_transactions: t('Custom Measurement'),
   crash_free_sessions: t('Crash Free Session Rate'),
   crash_free_users: t('Crash Free User Rate'),
 };

+ 4 - 3
static/app/views/alerts/wizard/panelContent.tsx

@@ -2,7 +2,8 @@ import diagramApdex from 'sentry-images/spot/alerts-wizard-apdex.svg';
 import diagramCLS from 'sentry-images/spot/alerts-wizard-cls.svg';
 import diagramCrashFreeSessions from 'sentry-images/spot/alerts-wizard-crash-free-sessions.svg';
 import diagramCrashFreeUsers from 'sentry-images/spot/alerts-wizard-crash-free-users.svg';
-import diagramCustom from 'sentry-images/spot/alerts-wizard-custom.svg';
+import diagramCustomTransaction from 'sentry-images/spot/alerts-wizard-custom.svg';
+import diagramCustomMetrics from 'sentry-images/spot/alerts-wizard-custom-metrics.svg';
 import diagramErrors from 'sentry-images/spot/alerts-wizard-errors.svg';
 import diagramFailureRate from 'sentry-images/spot/alerts-wizard-failure-rate.svg';
 import diagramFID from 'sentry-images/spot/alerts-wizard-fid.svg';
@@ -127,7 +128,7 @@ export const AlertWizardPanelContent: Record<AlertType, PanelContent> = {
       t('When the 95th percentile FP of a page is longer than 250 milliseconds.'),
       t('When the average TTFB of a page is longer than 600 millliseconds.'),
     ],
-    illustration: diagramCustom,
+    illustration: diagramCustomTransaction,
   },
   custom_metrics: {
     description: t(
@@ -139,7 +140,7 @@ export const AlertWizardPanelContent: Record<AlertType, PanelContent> = {
         'When the 75th percentile of your login flow is taking longer than 500 milliseconds.'
       ),
     ],
-    illustration: diagramCustom,
+    illustration: diagramCustomMetrics,
   },
   crash_free_sessions: {
     description: t(

File diff suppressed because it is too large
+ 14 - 0
static/images/spot/alerts-wizard-custom-metrics.svg


Some files were not shown because too many files changed in this diff