Menu

Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.

Enterprise Open source

getDataSourceSrv() function

getDataSourceSrv() function

Used to retrieve the DataSourceSrv that is the entry point for communicating with a datasource that is added as a plugin (both external and internal).

Signature

typescript
export declare function getDataSourceSrv(): DataSourceSrv;

Import

typescript
import { getDataSourceSrv } from '@grafana/runtime';

Returns:

DataSourceSrv