@grafana/data#DataSourcePlugin TypeScript Examples
The following examples show how to use
@grafana/data#DataSourcePlugin.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: module.tsx From grafana-chinese with Apache License 2.0 | 6 votes |
plugin = new DataSourcePlugin(TestDataDataSource)
.setConfigEditor(ConfigEditor)
.setQueryCtrl(TestDataQueryCtrl)
.setAnnotationQueryCtrl(TestDataAnnotationsQueryCtrl)
.addConfigPage({
title: 'Setup',
icon: 'fa fa-list-alt',
body: TestInfoTab,
id: 'setup',
})
Example #2
Source File: plugin_loader.ts From grafana-chinese with Apache License 2.0 | 6 votes |
export function importDataSourcePlugin(meta: DataSourcePluginMeta): Promise<GenericDataSourcePlugin> {
return importPluginModule(meta.module).then(pluginExports => {
if (pluginExports.plugin) {
const dsPlugin = pluginExports.plugin as GenericDataSourcePlugin;
dsPlugin.meta = meta;
return dsPlugin;
}
if (pluginExports.Datasource) {
const dsPlugin = new DataSourcePlugin<
DataSourceApi<DataQuery, DataSourceJsonData>,
DataQuery,
DataSourceJsonData
>(pluginExports.Datasource);
dsPlugin.setComponentsFromLegacyExports(pluginExports);
dsPlugin.meta = meta;
return dsPlugin;
}
throw new Error('Plugin module is missing DataSourcePlugin or Datasource constructor export');
});
}
Example #3
Source File: module.tsx From grafana-chinese with Apache License 2.0 | 5 votes |
plugin = new DataSourcePlugin<Datasource, AzureMonitorQuery, AzureDataSourceJsonData>(Datasource)
.setConfigEditor(ConfigEditor)
.setQueryCtrl(AzureMonitorQueryCtrl)
.setAnnotationQueryCtrl(AzureMonitorAnnotationsQueryCtrl)
Example #4
Source File: module.ts From grafana-s3-plugin with Apache License 2.0 | 5 votes |
plugin = new DataSourcePlugin<DataSource, Query, DataSourceOptions>(DataSource)
.setConfigEditor(ConfigEditor)
.setQueryEditor(QueryEditor)
Example #5
Source File: module.ts From grafana-chinese with Apache License 2.0 | 5 votes |
plugin = new DataSourcePlugin(PrometheusDatasource)
.setQueryEditor(PromQueryEditor)
.setConfigEditor(ConfigEditor)
.setExploreMetricsQueryField(PromExploreQueryEditor)
.setAnnotationQueryCtrl(PrometheusAnnotationsQueryCtrl)
.setExploreStartPage(PromCheatSheet)
Example #6
Source File: module.ts From grafana-chinese with Apache License 2.0 | 5 votes |
plugin = new DataSourcePlugin(OpenTsDatasource)
.setQueryCtrl(OpenTsQueryCtrl)
.setConfigEditor(ConfigEditor)
.setAnnotationQueryCtrl(AnnotationsQueryCtrl)
Example #7
Source File: module.ts From grafana-chinese with Apache License 2.0 | 5 votes |
plugin = new DataSourcePlugin(Datasource)
.setQueryEditor(LokiQueryEditor)
.setConfigEditor(ConfigEditor)
.setExploreQueryField(LokiExploreQueryEditor)
.setExploreStartPage(LokiCheatSheet)
.setAnnotationQueryCtrl(LokiAnnotationsQueryCtrl)
Example #8
Source File: module.ts From grafana-chinese with Apache License 2.0 | 5 votes |
plugin = new DataSourcePlugin<InputDatasource, InputQuery, InputOptions>(InputDatasource)
.setConfigEditor(InputConfigEditor)
.setQueryEditor(InputQueryEditor)
Example #9
Source File: module.ts From grafana-chinese with Apache License 2.0 | 5 votes |
plugin = new DataSourcePlugin(InfluxDatasource)
.setConfigEditor(ConfigEditor)
.setQueryCtrl(InfluxQueryCtrl)
.setAnnotationQueryCtrl(InfluxAnnotationsQueryCtrl)
.setExploreLogsQueryField(InfluxLogsQueryField)
.setExploreStartPage(InfluxStartPage)
Example #10
Source File: module.ts From grafana-chinese with Apache License 2.0 | 5 votes |
plugin = new DataSourcePlugin(GraphiteDatasource)
.setQueryCtrl(GraphiteQueryCtrl)
.setConfigEditor(ConfigEditor)
.setMetadataInspector(MetricTankMetaInspector)
.setAnnotationQueryCtrl(AnnotationsQueryCtrl)
Example #11
Source File: module.ts From grafana-kdb-datasource-ws with Apache License 2.0 | 5 votes |
plugin = new DataSourcePlugin<DataSource, MyQuery, MyDataSourceOptions>(DataSource)
.setConfigEditor(ConfigEditor)
.setQueryEditor(QueryEditor)
Example #12
Source File: module.ts From grafana-chinese with Apache License 2.0 | 5 votes |
plugin = new DataSourcePlugin(ElasticDatasource)
.setQueryCtrl(ElasticQueryCtrl)
.setConfigEditor(ConfigEditor)
.setExploreLogsQueryField(ElasticsearchQueryField)
.setAnnotationQueryCtrl(ElasticAnnotationsQueryCtrl)
Example #13
Source File: module.ts From grafana-chinese with Apache License 2.0 | 5 votes |
plugin = new DataSourcePlugin(DashboardDatasource)
Example #14
Source File: module.tsx From grafana-chinese with Apache License 2.0 | 5 votes |
plugin = new DataSourcePlugin<CloudWatchDatasource, CloudWatchQuery, CloudWatchJsonData>(
CloudWatchDatasource
)
.setConfigEditor(ConfigEditor)
.setQueryEditor(QueryEditor)
.setExploreQueryField(QueryEditor)
.setAnnotationQueryCtrl(CloudWatchAnnotationsQueryCtrl)
Example #15
Source File: plugin_loader.ts From grafana-chinese with Apache License 2.0 | 5 votes |
grafanaUI.DataSourcePlugin = grafanaData.DataSourcePlugin;
Example #16
Source File: DataSourceSettingsPage.test.tsx From grafana-chinese with Apache License 2.0 | 5 votes |
pluginMock = new DataSourcePlugin({} as DataSourceConstructor<any>)
Example #17
Source File: module.ts From druid-grafana with Apache License 2.0 | 5 votes |
plugin = new DataSourcePlugin<DruidDataSource, DruidQuery, DruidSettings>(DruidDataSource)
.setConfigEditor(ConfigEditor)
.setQueryEditor(QueryEditor)
.setVariableQueryEditor(VariableQueryEditor)