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-25 04:18:15 +09:00 committed by GitHub
parent 377079d8b3
commit a0122187b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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,