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
DataSourcePlugin class
Signature
typescript
export declare class DataSourcePlugin<DSType extends DataSourceApi<TQuery, TOptions>, TQuery extends DataQuery = DataSourceQueryType<DSType>, TOptions extends DataSourceJsonData = DataSourceOptionsType<DSType>, TSecureOptions = {}> extends GrafanaPlugin<DataSourcePluginMeta<TOptions>>
Import
typescript
import { DataSourcePlugin } from '@grafana/data';
Constructors
Constructor | Modifiers | Description |
---|---|---|
constructor(DataSourceClass) | Constructs a new instance of the DataSourcePlugin class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
components | DataSourcePluginComponents<DSType, TQuery, TOptions, TSecureOptions> | ||
DataSourceClass | DataSourceConstructor<DSType, TQuery, TOptions> |
Methods
constructor(DataSourceClass)
Constructs a new instance of the DataSourcePlugin
class
Signature
typescript
constructor(DataSourceClass: DataSourceConstructor<DSType, TQuery, TOptions>);
Parameters
Parameter | Type | Description |
---|---|---|
DataSourceClass | DataSourceConstructor<DSType, TQuery, TOptions> |
components property
Signature
typescript
components: DataSourcePluginComponents<DSType, TQuery, TOptions, TSecureOptions>;
DataSourceClass property
Signature
typescript
DataSourceClass: DataSourceConstructor<DSType, TQuery, TOptions>;
setAnnotationQueryCtrl method
Signature
typescript
setAnnotationQueryCtrl(AnnotationsQueryCtrl: any): this;
Parameters
Parameter | Type | Description |
---|---|---|
AnnotationsQueryCtrl | any |
Returns:
this
setComponentsFromLegacyExports method
Signature
typescript
setComponentsFromLegacyExports(pluginExports: any): void;
Parameters
Parameter | Type | Description |
---|---|---|
pluginExports | any |
Returns:
void
setConfigCtrl method
Signature
typescript
setConfigCtrl(ConfigCtrl: any): this;
Parameters
Parameter | Type | Description |
---|---|---|
ConfigCtrl | any |
Returns:
this
setConfigEditor method
Signature
typescript
setConfigEditor(editor: ComponentType<DataSourcePluginOptionsEditorProps<TOptions, TSecureOptions>>): this;
Parameters
Parameter | Type | Description |
---|---|---|
editor | ComponentType<DataSourcePluginOptionsEditorProps<TOptions, TSecureOptions>> |
Returns:
this
setExploreLogsQueryField method
Signature
typescript
setExploreLogsQueryField(ExploreQueryField: ComponentType<QueryEditorProps<DSType, TQuery, TOptions>>): this;
Parameters
Parameter | Type | Description |
---|---|---|
ExploreQueryField | ComponentType<QueryEditorProps<DSType, TQuery, TOptions>> |
Returns:
this
setExploreMetricsQueryField method
Signature
typescript
setExploreMetricsQueryField(ExploreQueryField: ComponentType<QueryEditorProps<DSType, TQuery, TOptions>>): this;
Parameters
Parameter | Type | Description |
---|---|---|
ExploreQueryField | ComponentType<QueryEditorProps<DSType, TQuery, TOptions>> |
Returns:
this
setExploreQueryField method
Signature
typescript
setExploreQueryField(ExploreQueryField: ComponentType<QueryEditorProps<DSType, TQuery, TOptions>>): this;
Parameters
Parameter | Type | Description |
---|---|---|
ExploreQueryField | ComponentType<QueryEditorProps<DSType, TQuery, TOptions>> |
Returns:
this
setExploreStartPage method
Signature
typescript
setExploreStartPage(ExploreStartPage: ComponentType<QueryEditorHelpProps<TQuery>>): this;
Parameters
Parameter | Type | Description |
---|---|---|
ExploreStartPage | ComponentType<QueryEditorHelpProps<TQuery>> |
Returns:
this
setMetadataInspector method
Signature
typescript
setMetadataInspector(MetadataInspector: ComponentType<MetadataInspectorProps<DSType, TQuery, TOptions>>): this;
Parameters
Parameter | Type | Description |
---|---|---|
MetadataInspector | ComponentType<MetadataInspectorProps<DSType, TQuery, TOptions>> |
Returns:
this
setQueryCtrl method
Signature
typescript
setQueryCtrl(QueryCtrl: any): this;
Parameters
Parameter | Type | Description |
---|---|---|
QueryCtrl | any |
Returns:
this
setQueryEditor method
Signature
typescript
setQueryEditor(QueryEditor: ComponentType<QueryEditorProps<DSType, TQuery, TOptions>>): this;
Parameters
Parameter | Type | Description |
---|---|---|
QueryEditor | ComponentType<QueryEditorProps<DSType, TQuery, TOptions>> |
Returns:
this
setQueryEditorHelp method
Signature
typescript
setQueryEditorHelp(QueryEditorHelp: ComponentType<QueryEditorHelpProps<TQuery>>): this;
Parameters
Parameter | Type | Description |
---|---|---|
QueryEditorHelp | ComponentType<QueryEditorHelpProps<TQuery>> |
Returns:
this
setVariableQueryEditor method
Signature
typescript
setVariableQueryEditor(VariableQueryEditor: any): this;
Parameters
Parameter | Type | Description |
---|---|---|
VariableQueryEditor | any |
Returns:
this
Was this page helpful?
Related resources from Grafana Labs
Additional helpful documentation, links, and articles:

Getting started with the Grafana LGTM Stack
In this webinar, we’ll demo how to get started using the LGTM Stack: Loki for logs, Grafana for visualization, Tempo for traces, and Mimir for metrics.

Getting started with Grafana dashboard design (EMEA Timezone)
In this webinar, you'll learn how to design stylish and easily accessible Grafana dashboards that tell a story.

Unify your data with Grafana plugins: Datadog, Splunk, MongoDB, and more
In this webinar, learn how to leverage Grafana's plugin ecosystem for access to 80+ data sources, including plugins for Datadog, Splunk, MongoDB, and more.