diff --git a/public/app/features/alerting/unified/Analytics.ts b/public/app/features/alerting/unified/Analytics.ts index e873fe6abd2..25e7e973c83 100644 --- a/public/app/features/alerting/unified/Analytics.ts +++ b/public/app/features/alerting/unified/Analytics.ts @@ -194,8 +194,11 @@ export const trackAlertRuleFormError = ( reportInteraction('grafana_alerting_rule_form_error', props); }; -export const trackNewGrafanaAlertRuleFormSavedSuccess = () => { - reportInteraction('grafana_alerting_grafana_rule_creation_new_success'); +export const trackNewGrafanaAlertRuleFormSavedSuccess = (payload: { + simplifiedQueryEditor: boolean; + simplifiedNotificationEditor: boolean; +}) => { + reportInteraction('grafana_alerting_grafana_rule_creation_new_success', payload); }; export const trackNewGrafanaAlertRuleFormCancelled = () => { diff --git a/public/app/features/alerting/unified/components/rule-editor/alert-rule-form/AlertRuleForm.tsx b/public/app/features/alerting/unified/components/rule-editor/alert-rule-form/AlertRuleForm.tsx index 3d46e0873e7..2a9846b0e62 100644 --- a/public/app/features/alerting/unified/components/rule-editor/alert-rule-form/AlertRuleForm.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/alert-rule-form/AlertRuleForm.tsx @@ -156,7 +156,11 @@ export const AlertRuleForm = ({ existing, prefill }: Props) => { // when creating a new rule, we save the manual routing setting , and editorSettings.simplifiedQueryEditor to the local storage storeInLocalStorageValues(values); await addRuleToRuleGroup.execute(ruleGroupIdentifier, ruleDefinition, evaluateEvery); - grafanaTypeRule && trackNewGrafanaAlertRuleFormSavedSuccess(); // new Grafana-managed rule + grafanaTypeRule && + trackNewGrafanaAlertRuleFormSavedSuccess({ + simplifiedQueryEditor: values.editorSettings?.simplifiedQueryEditor ?? false, + simplifiedNotificationEditor: values.editorSettings?.simplifiedNotificationEditor ?? false, + }); // new Grafana-managed rule } else { const ruleIdentifier = fromRulerRuleAndRuleGroupIdentifier(ruleGroupIdentifier, existing.rule); await updateRuleInRuleGroup.execute(