From b1d98939e1a48fe4fd4a4a81ef7f9e0493cc0cae Mon Sep 17 00:00:00 2001 From: Darren Janeczek <38694490+darrenjaneczek@users.noreply.github.com> Date: Thu, 2 May 2024 09:55:58 -0400 Subject: [PATCH] datatrails: include step index and number of steps when reporting trail step navigation usage (#87068) * fix: include step index and number of steps --- public/app/features/trails/DataTrailsHistory.tsx | 2 +- public/app/features/trails/interactions.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/public/app/features/trails/DataTrailsHistory.tsx b/public/app/features/trails/DataTrailsHistory.tsx index 539174d277f..241e0cc662d 100644 --- a/public/app/features/trails/DataTrailsHistory.tsx +++ b/public/app/features/trails/DataTrailsHistory.tsx @@ -131,7 +131,7 @@ export class DataTrailHistory extends SceneObjectBase { const step = this.state.steps[stepIndex]; const type = step.type === 'metric' && step.trailState.metric === undefined ? 'metric-clear' : step.type; - reportExploreMetrics('history_step_clicked', { type }); + reportExploreMetrics('history_step_clicked', { type, step: stepIndex, numberOfSteps: this.state.steps.length }); this.stepTransitionInProgress = true; this.setState({ currentStep: stepIndex }); diff --git a/public/app/features/trails/interactions.ts b/public/app/features/trails/interactions.ts index 1883299b07c..4dd43de8c6b 100644 --- a/public/app/features/trails/interactions.ts +++ b/public/app/features/trails/interactions.ts @@ -64,6 +64,10 @@ type Interactions = { // The special metric step type that is created when the user de-selects the current metric | 'metric-clear' ); + // Which step index was clicked on + step: number; + // The total number of steps currently in the trail + numberOfSteps: number; }; // User clicks on tab to change the action view metric_action_view_changed: { view: ActionViewType };