From 76043606224e23b1015a4465bd81065ef34e5837 Mon Sep 17 00:00:00 2001 From: Virginia Cepeda Date: Mon, 9 Jan 2023 15:27:02 -0300 Subject: [PATCH] Alerting: Add info to alert rule creation metric (#61105) Add extra info to alert rule creation metrics --- public/app/features/alerting/unified/Analytics.ts | 2 +- public/app/features/alerting/unified/state/actions.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/app/features/alerting/unified/Analytics.ts b/public/app/features/alerting/unified/Analytics.ts index 51c150d968b..3efae8cf1e8 100644 --- a/public/app/features/alerting/unified/Analytics.ts +++ b/public/app/features/alerting/unified/Analytics.ts @@ -17,7 +17,7 @@ export const LogMessages = { }; // logInfo from '@grafana/runtime' should be used, but it doesn't handle Grafana JS Agent and Sentry correctly -export function logInfo(message: string, context: Record = {}) { +export function logInfo(message: string, context: Record = {}) { if (config.grafanaJavascriptAgent.enabled) { faro.api.pushLog([message], { level: GrafanaLogLevel.INFO, diff --git a/public/app/features/alerting/unified/state/actions.ts b/public/app/features/alerting/unified/state/actions.ts index 979307bed6a..873fb9f8e0c 100644 --- a/public/app/features/alerting/unified/state/actions.ts +++ b/public/app/features/alerting/unified/state/actions.ts @@ -484,7 +484,7 @@ export const saveRuleFormAction = createAsyncThunk( throw new Error('Unexpected rule form type'); } - logInfo(LogMessages.successSavingAlertRule); + logInfo(LogMessages.successSavingAlertRule, { type, isNew: !existing }); if (!existing) { trackNewAlerRuleFormSaved({