Chore: Add tracking for dashboard load (#70057)

* Chore: Add tracking for dashboard load

* Address review comments
This commit is contained in:
Zoltán Bedi
2023-06-23 14:14:06 +02:00
committed by GitHub
parent 15e134215a
commit 6fbc0b9b9c
3 changed files with 70 additions and 0 deletions

View File

@@ -26,6 +26,7 @@ import {
import { createDashboardQueryRunner } from '../../query/state/DashboardQueryRunner/DashboardQueryRunner';
import { initVariablesTransaction } from '../../variables/state/actions';
import { getIfExistsLastKey } from '../../variables/state/selectors';
import { trackDashboardLoaded } from '../utils/tracking';
import { DashboardModel } from './DashboardModel';
import { PanelModel } from './PanelModel';
@@ -170,6 +171,8 @@ export function initDashboard(args: InitDashboardArgs): ThunkResult<void> {
// fetch dashboard data
const dashDTO = await fetchDashboard(args, dispatch, getState);
const versionBeforeMigration = dashDTO?.dashboard?.version;
// returns null if there was a redirect or error
if (!dashDTO) {
return;
@@ -271,6 +274,8 @@ export function initDashboard(args: InitDashboardArgs): ThunkResult<void> {
})
);
trackDashboardLoaded(dashboard, versionBeforeMigration);
// yay we are done
dispatch(dashboardInitCompleted(dashboard));
};