From a0122187b0400c7ee42d5ae87e97356645b29be8 Mon Sep 17 00:00:00 2001 From: Tokoro Date: Wed, 25 Sep 2024 04:18:15 +0900 Subject: [PATCH] Dashboards: Check if Grafana Javascript agent is enabled before using faro.api (#90509) Check if Grafana Javascript agent is enabled before using faro.api --- public/app/features/dashboard/dashgrid/panelOptionsLogger.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/app/features/dashboard/dashgrid/panelOptionsLogger.ts b/public/app/features/dashboard/dashgrid/panelOptionsLogger.ts index 21748075306..0e75d7fdad1 100644 --- a/public/app/features/dashboard/dashgrid/panelOptionsLogger.ts +++ b/public/app/features/dashboard/dashgrid/panelOptionsLogger.ts @@ -1,5 +1,6 @@ import { FieldConfigSource } from '@grafana/data'; import { faro } from '@grafana/faro-web-sdk'; +import { config } from 'app/core/config'; import { FIELD_CONFIG_CUSTOM_KEY, FIELD_CONFIG_OVERRIDES_KEY, PanelLogEvents } from 'app/core/log_events'; interface PanelLogInfo { @@ -29,6 +30,9 @@ export class PanelOptionsLogger { }; logPanelEvent = (eventName: string, newKey: string, newVal: string, oldVal?: string) => { + if (!config.grafanaJavascriptAgent.enabled) { + return; + } const logObj = { key: newKey, newValue: newVal,