From 8c54bba8d35c86d6f3b77e6fafced49965e2433a Mon Sep 17 00:00:00 2001 From: Sonia Aguilar <33540275+soniaAguilarPeiron@users.noreply.github.com> Date: Tue, 10 Jun 2025 14:28:10 +0200 Subject: [PATCH] Alerting: Add details to the payload when tracking import to GMA (#106404) add details to the payload when tracking import to GMA --- public/app/features/alerting/unified/Analytics.ts | 9 ++++++++- .../components/import-to-gma/ConfirmConvertModal.tsx | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/public/app/features/alerting/unified/Analytics.ts b/public/app/features/alerting/unified/Analytics.ts index efaae6b6fc1..ebe07e43f9f 100644 --- a/public/app/features/alerting/unified/Analytics.ts +++ b/public/app/features/alerting/unified/Analytics.ts @@ -229,7 +229,14 @@ export const trackDeletedRuleRestoreFail = async () => { reportInteraction('grafana_alerting_deleted_rule_restore_error'); }; -export const trackImportToGMASuccess = async (payload: { importSource: 'yaml' | 'datasource' }) => { +export const trackImportToGMASuccess = async (payload: { + importSource: 'yaml' | 'datasource'; + isRootFolder: boolean; + namespace?: string; + ruleGroup?: string; + pauseRecordingRules: boolean; + pauseAlertingRules: boolean; +}) => { reportInteraction('grafana_alerting_import_to_gma_success', { ...payload }); }; diff --git a/public/app/features/alerting/unified/components/import-to-gma/ConfirmConvertModal.tsx b/public/app/features/alerting/unified/components/import-to-gma/ConfirmConvertModal.tsx index 024dbaf0f1b..e0288e1a995 100644 --- a/public/app/features/alerting/unified/components/import-to-gma/ConfirmConvertModal.tsx +++ b/public/app/features/alerting/unified/components/import-to-gma/ConfirmConvertModal.tsx @@ -152,7 +152,14 @@ export const ConfirmConversionModal = ({ importPayload, isOpen, onDismiss }: Mod const isRootFolder = isEmpty(targetFolder?.uid); - trackImportToGMASuccess({ importSource }); + trackImportToGMASuccess({ + importSource, + isRootFolder, + namespace, + ruleGroup, + pauseRecordingRules, + pauseAlertingRules, + }); const ruleListUrl = createListFilterLink(isRootFolder ? [] : [['namespace', targetFolder?.title ?? '']], { skipSubPath: true, });