Dashboards: Check if Grafana Javascript agent is enabled before using faro.api (#90509)

Check if Grafana Javascript agent is enabled before using faro.api
This commit is contained in:
Tokoro
2024-09-24 22:18:15 +03:00
committed by GitHub
parent 377079d8b3
commit a0122187b0
@@ -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,