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

ConstructorModifiersDescription
constructor(DataSourceClass)Constructs a new instance of the DataSourcePlugin class

Properties

PropertyModifiersTypeDescription
componentsDataSourcePluginComponents<DSType, TQuery, TOptions, TSecureOptions>
DataSourceClassDataSourceConstructor<DSType, TQuery, TOptions>

Methods

MethodModifiersDescription
setAnnotationQueryCtrl(AnnotationsQueryCtrl)
setComponentsFromLegacyExports(pluginExports)
setConfigCtrl(ConfigCtrl)
setConfigEditor(editor)
setExploreLogsQueryField(ExploreQueryField)
setExploreMetricsQueryField(ExploreQueryField)
setExploreQueryField(ExploreQueryField)
setExploreStartPage(ExploreStartPage)
setMetadataInspector(MetadataInspector)
setQueryCtrl(QueryCtrl)
setQueryEditor(QueryEditor)
setQueryEditorHelp(QueryEditorHelp)
setVariableQueryEditor(VariableQueryEditor)

constructor(DataSourceClass)

Constructs a new instance of the DataSourcePlugin class

Signature

typescript
constructor(DataSourceClass: DataSourceConstructor<DSType, TQuery, TOptions>);

Parameters

ParameterTypeDescription
DataSourceClassDataSourceConstructor<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

ParameterTypeDescription
AnnotationsQueryCtrlany

Returns:

this

setComponentsFromLegacyExports method

Signature

typescript
setComponentsFromLegacyExports(pluginExports: any): void;

Parameters

ParameterTypeDescription
pluginExportsany

Returns:

void

setConfigCtrl method

Signature

typescript
setConfigCtrl(ConfigCtrl: any): this;

Parameters

ParameterTypeDescription
ConfigCtrlany

Returns:

this

setConfigEditor method

Signature

typescript
setConfigEditor(editor: ComponentType<DataSourcePluginOptionsEditorProps<TOptions, TSecureOptions>>): this;

Parameters

ParameterTypeDescription
editorComponentType<DataSourcePluginOptionsEditorProps<TOptions, TSecureOptions>>

Returns:

this

setExploreLogsQueryField method

Signature

typescript
setExploreLogsQueryField(ExploreQueryField: ComponentType<ExploreQueryFieldProps<DSType, TQuery, TOptions>>): this;

Parameters

ParameterTypeDescription
ExploreQueryFieldComponentType<ExploreQueryFieldProps<DSType, TQuery, TOptions>>

Returns:

this

setExploreMetricsQueryField method

Signature

typescript
setExploreMetricsQueryField(ExploreQueryField: ComponentType<ExploreQueryFieldProps<DSType, TQuery, TOptions>>): this;

Parameters

ParameterTypeDescription
ExploreQueryFieldComponentType<ExploreQueryFieldProps<DSType, TQuery, TOptions>>

Returns:

this

setExploreQueryField method

Signature

typescript
setExploreQueryField(ExploreQueryField: ComponentType<ExploreQueryFieldProps<DSType, TQuery, TOptions>>): this;

Parameters

ParameterTypeDescription
ExploreQueryFieldComponentType<ExploreQueryFieldProps<DSType, TQuery, TOptions>>

Returns:

this

setExploreStartPage method

Signature

typescript
setExploreStartPage(ExploreStartPage: ComponentType<QueryEditorHelpProps<TQuery>>): this;

Parameters

ParameterTypeDescription
ExploreStartPageComponentType<QueryEditorHelpProps<TQuery>>

Returns:

this

setMetadataInspector method

Signature

typescript
setMetadataInspector(MetadataInspector: ComponentType<MetadataInspectorProps<DSType, TQuery, TOptions>>): this;

Parameters

ParameterTypeDescription
MetadataInspectorComponentType<MetadataInspectorProps<DSType, TQuery, TOptions>>

Returns:

this

setQueryCtrl method

Signature

typescript
setQueryCtrl(QueryCtrl: any): this;

Parameters

ParameterTypeDescription
QueryCtrlany

Returns:

this

setQueryEditor method

Signature

typescript
setQueryEditor(QueryEditor: ComponentType<QueryEditorProps<DSType, TQuery, TOptions>>): this;

Parameters

ParameterTypeDescription
QueryEditorComponentType<QueryEditorProps<DSType, TQuery, TOptions>>

Returns:

this

setQueryEditorHelp method

Signature

typescript
setQueryEditorHelp(QueryEditorHelp: ComponentType<QueryEditorHelpProps<TQuery>>): this;

Parameters

ParameterTypeDescription
QueryEditorHelpComponentType<QueryEditorHelpProps<TQuery>>

Returns:

this

setVariableQueryEditor method

Signature

typescript
setVariableQueryEditor(VariableQueryEditor: any): this;

Parameters

ParameterTypeDescription
VariableQueryEditorany

Returns:

this