From f51b58488c70bb1d98a0020e5808b52e362912b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Fern=C3=A1ndez?= Date: Wed, 11 Dec 2024 12:24:19 +0100 Subject: [PATCH] EmptyState: Add event tracking to `CommandPalette` and `BrowseDashboards` (#97780) --- .../app/features/browse-dashboards/BrowseDashboardsPage.tsx | 4 +++- public/app/features/commandPalette/CommandPalette.tsx | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/public/app/features/browse-dashboards/BrowseDashboardsPage.tsx b/public/app/features/browse-dashboards/BrowseDashboardsPage.tsx index 7e8e3d4135c..12b31ff4974 100644 --- a/public/app/features/browse-dashboards/BrowseDashboardsPage.tsx +++ b/public/app/features/browse-dashboards/BrowseDashboardsPage.tsx @@ -60,6 +60,9 @@ const BrowseDashboardsPage = memo(() => { if (!isSearching && searchState.result) { stateManager.setState({ result: undefined, includePanels: undefined }); } + if (isSearching && searchState.result?.totalRows === 0) { + reportInteraction('grafana_empty_state_shown', { source: 'browse_dashboards' }); + } }, [isSearching, searchState.result, stateManager]); const { data: folderDTO } = useGetFolderQuery(folderUID ?? skipToken); @@ -114,7 +117,6 @@ const BrowseDashboardsPage = memo(() => { origin: window.location.pathname === getConfig().appSubUrl + '/dashboards' ? 'Dashboards' : 'Folder view', }); }; - return ( { + showEmptyState && reportInteraction('grafana_empty_state_shown', { source: 'command_palette' }); + }, [showEmptyState]); return showEmptyState ? (