Alerting: Add tracking for the mode used in query and notifications step when c… (#100824)
Add tracking for the mode used in query and notifications step when creating a grafana rule
This commit is contained in:
@@ -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 = () => {
|
||||
|
||||
+5
-1
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user