2022-12-08 04:28:40 -06:00
|
|
|
import { DashboardLoadedEvent, DataSourcePlugin } from '@grafana/data';
|
|
|
|
import { getAppEvents } from '@grafana/runtime';
|
2022-04-22 08:33:13 -05:00
|
|
|
|
2020-12-04 08:29:40 -06:00
|
|
|
import { QueryEditor } from './components/QueryEditor';
|
2022-04-22 08:33:13 -05:00
|
|
|
import { ConfigEditor } from './configuration/ConfigEditor';
|
|
|
|
import { ElasticDatasource } from './datasource';
|
2022-12-08 04:28:40 -06:00
|
|
|
import { onDashboardLoadedHandler } from './tracking';
|
|
|
|
import { ElasticsearchQuery } from './types';
|
2016-02-03 09:31:07 -06:00
|
|
|
|
2022-05-31 03:26:40 -05:00
|
|
|
export const plugin = new DataSourcePlugin(ElasticDatasource).setQueryEditor(QueryEditor).setConfigEditor(ConfigEditor);
|
2022-12-08 04:28:40 -06:00
|
|
|
|
|
|
|
// Subscribe to on dashboard loaded event so that we can track plugin adoption
|
|
|
|
getAppEvents().subscribe<DashboardLoadedEvent<ElasticsearchQuery>>(DashboardLoadedEvent, onDashboardLoadedHandler);
|