The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/docs/sources/packages_api/data/datasourceplugin.md

286 lines
7.2 KiB

+++
# -----------------------------------------------------------------------
# Do not edit this file. It is automatically generated by API Documenter.
# -----------------------------------------------------------------------
title = "DataSourcePlugin"
keywords = ["grafana","documentation","sdk","@grafana/data"]
type = "docs"
+++
## DataSourcePlugin class
<b>Signature</b>
```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>>
```
<b>Import</b>
```typescript
import { DataSourcePlugin } from '@grafana/data';
```
<b>Constructors</b>
| Constructor | Modifiers | Description |
| --- | --- | --- |
| [constructor(DataSourceClass)](#constructor-datasourceclass) | | Constructs a new instance of the <code>DataSourcePlugin</code> class |
<b>Properties</b>
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [components](#components-property) | | <code>DataSourcePluginComponents&lt;DSType, TQuery, TOptions, TSecureOptions&gt;</code> | |
| [DataSourceClass](#datasourceclass-property) | | <code>DataSourceConstructor&lt;DSType, TQuery, TOptions&gt;</code> | |
<b>Methods</b>
| 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
<b>Signature</b>
```typescript
constructor(DataSourceClass: DataSourceConstructor<DSType, TQuery, TOptions>);
```
<b>Parameters</b>
| Parameter | Type | Description |
| --- | --- | --- |
| DataSourceClass | <code>DataSourceConstructor&lt;DSType, TQuery, TOptions&gt;</code> | |
### components property
<b>Signature</b>
```typescript
components: DataSourcePluginComponents<DSType, TQuery, TOptions, TSecureOptions>;
```
### DataSourceClass property
<b>Signature</b>
```typescript
DataSourceClass: DataSourceConstructor<DSType, TQuery, TOptions>;
```
### setAnnotationQueryCtrl method
<b>Signature</b>
```typescript
setAnnotationQueryCtrl(AnnotationsQueryCtrl: any): this;
```
<b>Parameters</b>
| Parameter | Type | Description |
| --- | --- | --- |
| AnnotationsQueryCtrl | <code>any</code> | |
<b>Returns:</b>
`this`
### setComponentsFromLegacyExports method
<b>Signature</b>
```typescript
setComponentsFromLegacyExports(pluginExports: any): void;
```
<b>Parameters</b>
| Parameter | Type | Description |
| --- | --- | --- |
| pluginExports | <code>any</code> | |
<b>Returns:</b>
`void`
### setConfigCtrl method
<b>Signature</b>
```typescript
setConfigCtrl(ConfigCtrl: any): this;
```
<b>Parameters</b>
| Parameter | Type | Description |
| --- | --- | --- |
| ConfigCtrl | <code>any</code> | |
<b>Returns:</b>
`this`
### setConfigEditor method
<b>Signature</b>
```typescript
setConfigEditor(editor: ComponentType<DataSourcePluginOptionsEditorProps<TOptions, TSecureOptions>>): this;
```
<b>Parameters</b>
| Parameter | Type | Description |
| --- | --- | --- |
| editor | <code>ComponentType&lt;DataSourcePluginOptionsEditorProps&lt;TOptions, TSecureOptions&gt;&gt;</code> | |
<b>Returns:</b>
`this`
### setExploreLogsQueryField method
<b>Signature</b>
```typescript
setExploreLogsQueryField(ExploreQueryField: ComponentType<ExploreQueryFieldProps<DSType, TQuery, TOptions>>): this;
```
<b>Parameters</b>
| Parameter | Type | Description |
| --- | --- | --- |
| ExploreQueryField | <code>ComponentType&lt;ExploreQueryFieldProps&lt;DSType, TQuery, TOptions&gt;&gt;</code> | |
<b>Returns:</b>
`this`
### setExploreMetricsQueryField method
<b>Signature</b>
```typescript
setExploreMetricsQueryField(ExploreQueryField: ComponentType<ExploreQueryFieldProps<DSType, TQuery, TOptions>>): this;
```
<b>Parameters</b>
| Parameter | Type | Description |
| --- | --- | --- |
| ExploreQueryField | <code>ComponentType&lt;ExploreQueryFieldProps&lt;DSType, TQuery, TOptions&gt;&gt;</code> | |
<b>Returns:</b>
`this`
### setExploreQueryField method
<b>Signature</b>
```typescript
setExploreQueryField(ExploreQueryField: ComponentType<ExploreQueryFieldProps<DSType, TQuery, TOptions>>): this;
```
<b>Parameters</b>
| Parameter | Type | Description |
| --- | --- | --- |
| ExploreQueryField | <code>ComponentType&lt;ExploreQueryFieldProps&lt;DSType, TQuery, TOptions&gt;&gt;</code> | |
<b>Returns:</b>
`this`
### setExploreStartPage method
<b>Signature</b>
```typescript
setExploreStartPage(ExploreStartPage: ComponentType<ExploreStartPageProps>): this;
```
<b>Parameters</b>
| Parameter | Type | Description |
| --- | --- | --- |
| ExploreStartPage | <code>ComponentType&lt;ExploreStartPageProps&gt;</code> | |
<b>Returns:</b>
`this`
### setMetadataInspector method
<b>Signature</b>
```typescript
setMetadataInspector(MetadataInspector: ComponentType<MetadataInspectorProps<DSType, TQuery, TOptions>>): this;
```
<b>Parameters</b>
| Parameter | Type | Description |
| --- | --- | --- |
| MetadataInspector | <code>ComponentType&lt;MetadataInspectorProps&lt;DSType, TQuery, TOptions&gt;&gt;</code> | |
<b>Returns:</b>
`this`
### setQueryCtrl method
<b>Signature</b>
```typescript
setQueryCtrl(QueryCtrl: any): this;
```
<b>Parameters</b>
| Parameter | Type | Description |
| --- | --- | --- |
| QueryCtrl | <code>any</code> | |
<b>Returns:</b>
`this`
### setQueryEditor method
<b>Signature</b>
```typescript
setQueryEditor(QueryEditor: ComponentType<QueryEditorProps<DSType, TQuery, TOptions>>): this;
```
<b>Parameters</b>
| Parameter | Type | Description |
| --- | --- | --- |
| QueryEditor | <code>ComponentType&lt;QueryEditorProps&lt;DSType, TQuery, TOptions&gt;&gt;</code> | |
<b>Returns:</b>
`this`
### setVariableQueryEditor method
<b>Signature</b>
```typescript
setVariableQueryEditor(VariableQueryEditor: any): this;
```
<b>Parameters</b>
| Parameter | Type | Description |
| --- | --- | --- |
| VariableQueryEditor | <code>any</code> | |
<b>Returns:</b>
`this`