2022-09-19 08:53:42 +02:00
|
|
|
import { DashboardLoadedEvent, DataSourcePlugin } from '@grafana/data';
|
|
|
|
|
import { getAppEvents } from '@grafana/runtime';
|
2022-04-22 14:33:13 +01:00
|
|
|
|
|
|
|
|
import { ConfigEditor } from './components/ConfigEditor';
|
|
|
|
|
import LogsCheatSheet from './components/LogsCheatSheet';
|
2021-11-30 10:53:31 +01:00
|
|
|
import { MetaInspector } from './components/MetaInspector';
|
2022-04-22 14:33:13 +01:00
|
|
|
import { PanelQueryEditor } from './components/PanelQueryEditor';
|
|
|
|
|
import { CloudWatchDatasource } from './datasource';
|
2022-09-19 08:53:42 +02:00
|
|
|
import { onDashboardLoadedHandler } from './tracking';
|
2022-04-22 14:33:13 +01:00
|
|
|
import { CloudWatchJsonData, CloudWatchQuery } from './types';
|
2019-11-14 10:59:41 +01:00
|
|
|
|
|
|
|
|
export const plugin = new DataSourcePlugin<CloudWatchDatasource, CloudWatchQuery, CloudWatchJsonData>(
|
|
|
|
|
CloudWatchDatasource
|
|
|
|
|
)
|
2021-01-19 22:52:09 +00:00
|
|
|
.setQueryEditorHelp(LogsCheatSheet)
|
2019-11-14 10:59:41 +01:00
|
|
|
.setConfigEditor(ConfigEditor)
|
2020-04-25 21:48:20 +01:00
|
|
|
.setQueryEditor(PanelQueryEditor)
|
2022-05-05 10:36:50 +01:00
|
|
|
.setMetadataInspector(MetaInspector);
|
2022-09-19 08:53:42 +02:00
|
|
|
|
|
|
|
|
// Subscribe to on dashboard loaded event so that we can track plugin adoption
|
|
|
|
|
getAppEvents().subscribe<DashboardLoadedEvent<CloudWatchQuery>>(DashboardLoadedEvent, onDashboardLoadedHandler);
|