mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Add interactions for Fullstory (#94631)
add interactions for Fullstory
This commit is contained in:
parent
19a9a79467
commit
0dd5373e4a
@ -190,6 +190,18 @@ export const trackAlertRuleFormError = (
|
|||||||
reportInteraction('grafana_alerting_rule_form_error', props);
|
reportInteraction('grafana_alerting_rule_form_error', props);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const trackNewGrafanaAlertRuleFormSavedSuccess = () => {
|
||||||
|
reportInteraction('grafana_alerting_grafana_rule_creation_new_success');
|
||||||
|
};
|
||||||
|
|
||||||
|
export const trackNewGrafanaAlertRuleFormCancelled = () => {
|
||||||
|
reportInteraction('grafana_alerting_grafana_rule_creation_new_aborted');
|
||||||
|
};
|
||||||
|
|
||||||
|
export const trackNewGrafanaAlertRuleFormError = () => {
|
||||||
|
reportInteraction('grafana_alerting_grafana_rule_creation_new_error');
|
||||||
|
};
|
||||||
|
|
||||||
export const trackInsightsFeedback = async (props: { useful: boolean; panel: string }) => {
|
export const trackInsightsFeedback = async (props: { useful: boolean; panel: string }) => {
|
||||||
const defaults = {
|
const defaults = {
|
||||||
grafana_version: config.buildInfo.version,
|
grafana_version: config.buildInfo.version,
|
||||||
|
@ -29,6 +29,9 @@ import {
|
|||||||
trackAlertRuleFormCancelled,
|
trackAlertRuleFormCancelled,
|
||||||
trackAlertRuleFormError,
|
trackAlertRuleFormError,
|
||||||
trackAlertRuleFormSaved,
|
trackAlertRuleFormSaved,
|
||||||
|
trackNewGrafanaAlertRuleFormCancelled,
|
||||||
|
trackNewGrafanaAlertRuleFormError,
|
||||||
|
trackNewGrafanaAlertRuleFormSavedSuccess,
|
||||||
} from '../../../Analytics';
|
} from '../../../Analytics';
|
||||||
import { shouldUsePrometheusRulesPrimary } from '../../../featureToggles';
|
import { shouldUsePrometheusRulesPrimary } from '../../../featureToggles';
|
||||||
import { useDeleteRuleFromGroup } from '../../../hooks/ruleGroup/useDeleteRuleFromGroup';
|
import { useDeleteRuleFromGroup } from '../../../hooks/ruleGroup/useDeleteRuleFromGroup';
|
||||||
@ -138,6 +141,10 @@ export const AlertRuleForm = ({ existing, prefill }: Props) => {
|
|||||||
const submit = async (values: RuleFormValues, exitOnSave: boolean) => {
|
const submit = async (values: RuleFormValues, exitOnSave: boolean) => {
|
||||||
if (conditionErrorMsg !== '') {
|
if (conditionErrorMsg !== '') {
|
||||||
notifyApp.error(conditionErrorMsg);
|
notifyApp.error(conditionErrorMsg);
|
||||||
|
if (!existing && grafanaTypeRule) {
|
||||||
|
// new Grafana-managed rule
|
||||||
|
trackNewGrafanaAlertRuleFormError();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,6 +161,7 @@ export const AlertRuleForm = ({ existing, prefill }: Props) => {
|
|||||||
// when creating a new rule, we save the manual routing setting , and editorSettings.simplifiedQueryEditor to the local storage
|
// when creating a new rule, we save the manual routing setting , and editorSettings.simplifiedQueryEditor to the local storage
|
||||||
storeInLocalStorageValues(values);
|
storeInLocalStorageValues(values);
|
||||||
await addRuleToRuleGroup.execute(ruleGroupIdentifier, ruleDefinition, evaluateEvery);
|
await addRuleToRuleGroup.execute(ruleGroupIdentifier, ruleDefinition, evaluateEvery);
|
||||||
|
grafanaTypeRule && trackNewGrafanaAlertRuleFormSavedSuccess(); // new Grafana-managed rule
|
||||||
} else {
|
} else {
|
||||||
const ruleIdentifier = fromRulerRuleAndRuleGroupIdentifier(ruleGroupIdentifier, existing.rule);
|
const ruleIdentifier = fromRulerRuleAndRuleGroupIdentifier(ruleGroupIdentifier, existing.rule);
|
||||||
const targetRuleGroupIdentifier = getRuleGroupLocationFromFormValues(values);
|
const targetRuleGroupIdentifier = getRuleGroupLocationFromFormValues(values);
|
||||||
@ -207,6 +215,10 @@ export const AlertRuleForm = ({ existing, prefill }: Props) => {
|
|||||||
const cancelRuleCreation = () => {
|
const cancelRuleCreation = () => {
|
||||||
logInfo(LogMessages.cancelSavingAlertRule);
|
logInfo(LogMessages.cancelSavingAlertRule);
|
||||||
trackAlertRuleFormCancelled({ formAction: existing ? 'update' : 'create' });
|
trackAlertRuleFormCancelled({ formAction: existing ? 'update' : 'create' });
|
||||||
|
if (!existing && grafanaTypeRule) {
|
||||||
|
// new Grafana-managed rule
|
||||||
|
trackNewGrafanaAlertRuleFormCancelled();
|
||||||
|
}
|
||||||
locationService.getHistory().goBack();
|
locationService.getHistory().goBack();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user