grafana/public/app/features/plugins/admin/tracking.ts
Levente Balogh f985f02584
Plugins: Track plugin install and uninstall events (#62300)
* chore: track plugin install and uninstall events

* chore: pass the type of the plugin to the tracking as well
2023-02-01 10:58:25 +01:00

19 lines
654 B
TypeScript

import { reportInteraction } from '@grafana/runtime';
type PluginTrackingProps = {
// The ID of the plugin (e.g. grafana-azure-monitor-datasource)
plugin_id: string;
// The type of the plugin (e.g. 'app' or 'datasource')
plugin_type?: string;
// The path where the plugin details page was rendered (e.g. /plugins/grafana-azure-monitor-datasource )
path: string;
};
export const trackPluginInstalled = (props: PluginTrackingProps) => {
reportInteraction('grafana_plugin_install_clicked', props);
};
export const trackPluginUninstalled = (props: PluginTrackingProps) => {
reportInteraction('grafana_plugin_uninstall_clicked', props);
};