mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Add tracking for dashboard load (#70057)
* Chore: Add tracking for dashboard load * Address review comments
This commit is contained in:
@@ -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));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user