Analytics: Send event when opening a dashboard (#22921)

* Analytics: add open dashboard event

* Analytics: move code to analyticsProcessor

* Dashboard: fix init tests

* Analytics: remove open event for new dashboard

* Analytics: rename analyticsProcessor functions
This commit is contained in:
Agnès Toulet
2020-03-25 09:01:49 +01:00
committed by GitHub
parent 8e1fe6a9dd
commit d825b9e799
5 changed files with 58 additions and 16 deletions

View File

@@ -1,18 +1,35 @@
import { EchoEvent, EchoEventType } from '../services/EchoSrv';
export interface MetaAnalyticsEventPayload {
eventName: string;
dashboardId?: number;
dashboardUid?: string;
dashboardName?: string;
export interface DashboardInfo {
dashboardId: number;
dashboardUid: string;
dashboardName: string;
folderName?: string;
panelId?: number;
panelName?: string;
}
export interface DataRequestInfo extends Partial<DashboardInfo> {
datasourceName: string;
datasourceId?: number;
error?: string;
panelId?: number;
panelName?: string;
duration: number;
error?: string;
dataSize?: number;
}
export enum MetaAnalyticsEventName {
DashboardView = 'dashboard-view',
DataRequest = 'data-request',
}
export interface DashboardViewEventPayload extends DashboardInfo {
eventName: MetaAnalyticsEventName.DashboardView;
}
export interface DataRequestEventPayload extends DataRequestInfo {
eventName: MetaAnalyticsEventName.DataRequest;
}
export type MetaAnalyticsEventPayload = DashboardViewEventPayload | DataRequestEventPayload;
export interface MetaAnalyticsEvent extends EchoEvent<EchoEventType.MetaAnalytics, MetaAnalyticsEventPayload> {}