analyticsProcessor.ts 516 B

123456789101112131415
  1. import { reportMetaAnalytics, MetaAnalyticsEventName, DashboardViewEventPayload } from '@grafana/runtime';
  2. import { DashboardModel } from './DashboardModel';
  3. export function emitDashboardViewEvent(dashboard: DashboardModel) {
  4. const eventData: DashboardViewEventPayload = {
  5. dashboardId: dashboard.id,
  6. dashboardName: dashboard.title,
  7. dashboardUid: dashboard.uid,
  8. folderName: dashboard.meta.folderTitle,
  9. eventName: MetaAnalyticsEventName.DashboardView,
  10. };
  11. reportMetaAnalytics(eventData);
  12. }