+++ # ----------------------------------------------------------------------- # Do not edit this file. It is automatically generated by API Documenter. # ----------------------------------------------------------------------- title = "DataSourcePlugin" keywords = ["grafana","documentation","sdk","@grafana/data"] type = "docs" +++ ## DataSourcePlugin class Signature ```typescript export declare class DataSourcePlugin, TQuery extends DataQuery = DataSourceQueryType, TOptions extends DataSourceJsonData = DataSourceOptionsType, TSecureOptions = {}> extends GrafanaPlugin> ``` Import ```typescript import { DataSourcePlugin } from '@grafana/data'; ``` Constructors | Constructor | Modifiers | Description | | --- | --- | --- | | [constructor(DataSourceClass)](#constructor-datasourceclass) | | Constructs a new instance of the DataSourcePlugin class | Properties | Property | Modifiers | Type | Description | | --- | --- | --- | --- | | [components](#components-property) | | DataSourcePluginComponents<DSType, TQuery, TOptions, TSecureOptions> | | | [DataSourceClass](#datasourceclass-property) | | DataSourceConstructor<DSType, TQuery, TOptions> | | Methods | Method | Modifiers | Description | | --- | --- | --- | | [setAnnotationQueryCtrl(AnnotationsQueryCtrl)](#setannotationqueryctrl-method) | | | | [setComponentsFromLegacyExports(pluginExports)](#setcomponentsfromlegacyexports-method) | | | | [setConfigCtrl(ConfigCtrl)](#setconfigctrl-method) | | | | [setConfigEditor(editor)](#setconfigeditor-method) | | | | [setExploreLogsQueryField(ExploreQueryField)](#setexplorelogsqueryfield-method) | | | | [setExploreMetricsQueryField(ExploreQueryField)](#setexploremetricsqueryfield-method) | | | | [setExploreQueryField(ExploreQueryField)](#setexplorequeryfield-method) | | | | [setExploreStartPage(ExploreStartPage)](#setexplorestartpage-method) | | | | [setMetadataInspector(MetadataInspector)](#setmetadatainspector-method) | | | | [setQueryCtrl(QueryCtrl)](#setqueryctrl-method) | | | | [setQueryEditor(QueryEditor)](#setqueryeditor-method) | | | | [setVariableQueryEditor(VariableQueryEditor)](#setvariablequeryeditor-method) | | | ### constructor(DataSourceClass) Constructs a new instance of the `DataSourcePlugin` class Signature ```typescript constructor(DataSourceClass: DataSourceConstructor); ``` Parameters | Parameter | Type | Description | | --- | --- | --- | | DataSourceClass | DataSourceConstructor<DSType, TQuery, TOptions> | | ### components property Signature ```typescript components: DataSourcePluginComponents; ``` ### DataSourceClass property Signature ```typescript DataSourceClass: DataSourceConstructor; ``` ### 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>): this; ``` Parameters | Parameter | Type | Description | | --- | --- | --- | | editor | ComponentType<DataSourcePluginOptionsEditorProps<TOptions, TSecureOptions>> | | Returns: `this` ### setExploreLogsQueryField method Signature ```typescript setExploreLogsQueryField(ExploreQueryField: ComponentType>): this; ``` Parameters | Parameter | Type | Description | | --- | --- | --- | | ExploreQueryField | ComponentType<ExploreQueryFieldProps<DSType, TQuery, TOptions>> | | Returns: `this` ### setExploreMetricsQueryField method Signature ```typescript setExploreMetricsQueryField(ExploreQueryField: ComponentType>): this; ``` Parameters | Parameter | Type | Description | | --- | --- | --- | | ExploreQueryField | ComponentType<ExploreQueryFieldProps<DSType, TQuery, TOptions>> | | Returns: `this` ### setExploreQueryField method Signature ```typescript setExploreQueryField(ExploreQueryField: ComponentType>): this; ``` Parameters | Parameter | Type | Description | | --- | --- | --- | | ExploreQueryField | ComponentType<ExploreQueryFieldProps<DSType, TQuery, TOptions>> | | Returns: `this` ### setExploreStartPage method Signature ```typescript setExploreStartPage(ExploreStartPage: ComponentType): this; ``` Parameters | Parameter | Type | Description | | --- | --- | --- | | ExploreStartPage | ComponentType<ExploreStartPageProps> | | Returns: `this` ### setMetadataInspector method Signature ```typescript setMetadataInspector(MetadataInspector: ComponentType>): 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>): this; ``` Parameters | Parameter | Type | Description | | --- | --- | --- | | QueryEditor | ComponentType<QueryEditorProps<DSType, TQuery, TOptions>> | | Returns: `this` ### setVariableQueryEditor method Signature ```typescript setVariableQueryEditor(VariableQueryEditor: any): this; ``` Parameters | Parameter | Type | Description | | --- | --- | --- | | VariableQueryEditor | any | | Returns: `this`