import { DataSourceApi } from '@grafana/data'; import { getDataSourceSrv } from '@grafana/runtime'; export async function getDS(uid?: string): Promise { if (!uid) { return undefined; } const dsSrv = getDataSourceSrv(); try { return await dsSrv.get(uid); } catch (error) { console.error('Failed to load data source', error); return undefined; } }