mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 05:37:53 +08:00
CloudWatch: Enable feature adoption tracking in the plugin (#54299)
* improve typing for DashboardLoadedEvent * cleanup * add cloudwatch tracking event * add test * revert test change * fix typo * remove optional * pr feedback * reactor test * revert changes to api and azure * cleanup * refactoring test * pr feedback
This commit is contained in:
@ -1,10 +1,12 @@
|
||||
import { DataSourcePlugin } from '@grafana/data';
|
||||
import { DashboardLoadedEvent, DataSourcePlugin } from '@grafana/data';
|
||||
import { getAppEvents } from '@grafana/runtime';
|
||||
|
||||
import { ConfigEditor } from './components/ConfigEditor';
|
||||
import LogsCheatSheet from './components/LogsCheatSheet';
|
||||
import { MetaInspector } from './components/MetaInspector';
|
||||
import { PanelQueryEditor } from './components/PanelQueryEditor';
|
||||
import { CloudWatchDatasource } from './datasource';
|
||||
import { onDashboardLoadedHandler } from './tracking';
|
||||
import { CloudWatchJsonData, CloudWatchQuery } from './types';
|
||||
|
||||
export const plugin = new DataSourcePlugin<CloudWatchDatasource, CloudWatchQuery, CloudWatchJsonData>(
|
||||
@ -14,3 +16,6 @@ export const plugin = new DataSourcePlugin<CloudWatchDatasource, CloudWatchQuery
|
||||
.setConfigEditor(ConfigEditor)
|
||||
.setQueryEditor(PanelQueryEditor)
|
||||
.setMetadataInspector(MetaInspector);
|
||||
|
||||
// Subscribe to on dashboard loaded event so that we can track plugin adoption
|
||||
getAppEvents().subscribe<DashboardLoadedEvent<CloudWatchQuery>>(DashboardLoadedEvent, onDashboardLoadedHandler);
|
||||
|
Reference in New Issue
Block a user