diff --git a/public/app/features/trails/Integrations/dashboardIntegration.ts b/public/app/features/trails/Integrations/dashboardIntegration.ts index ea2a34ea91f..4ff039f377b 100644 --- a/public/app/features/trails/Integrations/dashboardIntegration.ts +++ b/public/app/features/trails/Integrations/dashboardIntegration.ts @@ -1,4 +1,4 @@ -import { PanelMenuItem } from '@grafana/data'; +import { DataSourceApi, PanelMenuItem } from '@grafana/data'; import { PromQuery } from '@grafana/prometheus'; import { getDataSourceSrv } from '@grafana/runtime'; import { SceneTimeRangeState, VizPanel } from '@grafana/scenes'; @@ -34,7 +34,13 @@ export async function addDataTrailPanelAction(dashboard: DashboardScene, panel: return; } - const dataSourceApi = await getDataSourceSrv().get(datasource); + let dataSourceApi: DataSourceApi | undefined; + + try { + dataSourceApi = await getDataSourceSrv().get(datasource); + } catch (e) { + return; + } if (dataSourceApi.interpolateVariablesInQueries == null) { return;