|
@@ -15,6 +15,7 @@ import {
|
|
} from 'sentry/icons';
|
|
} from 'sentry/icons';
|
|
import {t} from 'sentry/locale';
|
|
import {t} from 'sentry/locale';
|
|
import type {Organization} from 'sentry/types';
|
|
import type {Organization} from 'sentry/types';
|
|
|
|
+import {trackAnalytics} from 'sentry/utils/analytics';
|
|
import {isCustomMeasurement, isCustomMetric} from 'sentry/utils/metrics';
|
|
import {isCustomMeasurement, isCustomMetric} from 'sentry/utils/metrics';
|
|
import {
|
|
import {
|
|
convertToDashboardWidget,
|
|
convertToDashboardWidget,
|
|
@@ -63,6 +64,9 @@ export function MetricQueryContextMenu({
|
|
key: 'duplicate',
|
|
key: 'duplicate',
|
|
label: t('Duplicate'),
|
|
label: t('Duplicate'),
|
|
onAction: () => {
|
|
onAction: () => {
|
|
|
|
+ trackAnalytics('ddm.widget.duplicate', {
|
|
|
|
+ organization,
|
|
|
|
+ });
|
|
Sentry.metrics.increment('ddm.widget.duplicate');
|
|
Sentry.metrics.increment('ddm.widget.duplicate');
|
|
duplicateWidget(widgetIndex);
|
|
duplicateWidget(widgetIndex);
|
|
},
|
|
},
|
|
@@ -73,6 +77,10 @@ export function MetricQueryContextMenu({
|
|
label: t('Create Alert'),
|
|
label: t('Create Alert'),
|
|
disabled: !createAlert,
|
|
disabled: !createAlert,
|
|
onAction: () => {
|
|
onAction: () => {
|
|
|
|
+ trackAnalytics('ddm.create-alert', {
|
|
|
|
+ organization,
|
|
|
|
+ source: 'widget',
|
|
|
|
+ });
|
|
Sentry.metrics.increment('ddm.widget.alert');
|
|
Sentry.metrics.increment('ddm.widget.alert');
|
|
createAlert?.();
|
|
createAlert?.();
|
|
},
|
|
},
|
|
@@ -83,6 +91,10 @@ export function MetricQueryContextMenu({
|
|
label: t('Add to Dashboard'),
|
|
label: t('Add to Dashboard'),
|
|
disabled: !createDashboardWidget,
|
|
disabled: !createDashboardWidget,
|
|
onAction: () => {
|
|
onAction: () => {
|
|
|
|
+ trackAnalytics('ddm.add-to-dashboard', {
|
|
|
|
+ organization,
|
|
|
|
+ source: 'widget',
|
|
|
|
+ });
|
|
Sentry.metrics.increment('ddm.widget.dashboard');
|
|
Sentry.metrics.increment('ddm.widget.dashboard');
|
|
createDashboardWidget?.();
|
|
createDashboardWidget?.();
|
|
},
|
|
},
|
|
@@ -93,6 +105,9 @@ export function MetricQueryContextMenu({
|
|
label: t('Metric Settings'),
|
|
label: t('Metric Settings'),
|
|
disabled: !isCustomMetric({mri: metricsQuery.mri}),
|
|
disabled: !isCustomMetric({mri: metricsQuery.mri}),
|
|
onAction: () => {
|
|
onAction: () => {
|
|
|
|
+ trackAnalytics('ddm.widget.settings', {
|
|
|
|
+ organization,
|
|
|
|
+ });
|
|
Sentry.metrics.increment('ddm.widget.settings');
|
|
Sentry.metrics.increment('ddm.widget.settings');
|
|
navigateTo(
|
|
navigateTo(
|
|
`/settings/projects/:projectId/metrics/${encodeURIComponent(
|
|
`/settings/projects/:projectId/metrics/${encodeURIComponent(
|
|
@@ -116,12 +131,13 @@ export function MetricQueryContextMenu({
|
|
[
|
|
[
|
|
createAlert,
|
|
createAlert,
|
|
createDashboardWidget,
|
|
createDashboardWidget,
|
|
|
|
+ metricsQuery.mri,
|
|
|
|
+ canDelete,
|
|
|
|
+ organization,
|
|
duplicateWidget,
|
|
duplicateWidget,
|
|
- removeWidget,
|
|
|
|
widgetIndex,
|
|
widgetIndex,
|
|
- canDelete,
|
|
|
|
- metricsQuery.mri,
|
|
|
|
router,
|
|
router,
|
|
|
|
+ removeWidget,
|
|
]
|
|
]
|
|
);
|
|
);
|
|
|
|
|