From ec7d09b8e0a3d3a39993d31f6fdabea3958d961a Mon Sep 17 00:00:00 2001 From: Matias Chomicki Date: Tue, 28 Nov 2023 13:44:08 +0100 Subject: [PATCH] Popover menu: refactor event tracking (#78733) --- public/app/features/logs/components/PopoverMenu.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/public/app/features/logs/components/PopoverMenu.tsx b/public/app/features/logs/components/PopoverMenu.tsx index 22c26782194..6d062d4f4bc 100644 --- a/public/app/features/logs/components/PopoverMenu.tsx +++ b/public/app/features/logs/components/PopoverMenu.tsx @@ -56,7 +56,7 @@ export const PopoverMenu = ({ onClick={() => { copyText(selection, containerRef); close(); - track('copy_selection_clicked', selection.length, row.datasourceType); + track('copy', selection.length, row.datasourceType); }} /> {onClickFilterValue && ( @@ -65,7 +65,7 @@ export const PopoverMenu = ({ onClick={() => { onClickFilterValue(selection, row.dataFrame.refId); close(); - track('line_filter_clicked', selection.length, row.datasourceType); + track('line_contains', selection.length, row.datasourceType); }} /> )} @@ -75,7 +75,7 @@ export const PopoverMenu = ({ onClick={() => { onClickFilterOutValue(selection, row.dataFrame.refId); close(); - track('line_filter_out_clicked', selection.length, row.datasourceType); + track('line_does_not_contain', selection.length, row.datasourceType); }} /> )} @@ -84,8 +84,9 @@ export const PopoverMenu = ({ ); }; -function track(event: string, selectionLength: number, dataSourceType: string | undefined) { - reportInteraction(`grafana_explore_logs_${event}`, { +function track(action: string, selectionLength: number, dataSourceType: string | undefined) { + reportInteraction(`grafana_explore_logs_popover_menu`, { + action, selection_length: selectionLength, ds_type: dataSourceType || 'unknown', });