From 9cae8a114f782552b4efcc678c9f6353168f28b0 Mon Sep 17 00:00:00 2001 From: Aditya Kalia <32119652+akalia25@users.noreply.github.com> Date: Fri, 24 Jan 2025 16:25:51 -0500 Subject: [PATCH 1/2] fix(telemetry): add billing metadata to onebox.filterSidebar event This change adds billing metadata to the `onebox.filterSidebar` telemetry event, including the product name 'cody' and the category 'billable'. This will help with billing and cost tracking for the Cody product. --- .../chat/cells/messageCell/assistant/SearchResults.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vscode/webviews/chat/cells/messageCell/assistant/SearchResults.tsx b/vscode/webviews/chat/cells/messageCell/assistant/SearchResults.tsx index e620bf7a343f..467e08edcdad 100644 --- a/vscode/webviews/chat/cells/messageCell/assistant/SearchResults.tsx +++ b/vscode/webviews/chat/cells/messageCell/assistant/SearchResults.tsx @@ -153,7 +153,12 @@ export const SearchResults = ({ ) const onFilterSidebarClose = useCallback(() => { - telemetryRecorder.recordEvent('onebox.filterSidebar', 'closed') + telemetryRecorder.recordEvent('onebox.filterSidebar', 'closed', { + billingMetadata: { + product: 'cody', + category: 'billable', + }, + }) setShowFiltersSidebar(false) }, [telemetryRecorder]) From 3f684729158195550236f8c4da017c2bfb44cd0d Mon Sep 17 00:00:00 2001 From: Aditya Kalia <32119652+akalia25@users.noreply.github.com> Date: Mon, 27 Jan 2025 11:06:51 -0500 Subject: [PATCH 2/2] add billingMetadata to searchResult clicked for onebox --- vscode/webviews/components/FileLink.tsx | 4 ++++ vscode/webviews/components/NLSResultSnippet.tsx | 1 + 2 files changed, 5 insertions(+) diff --git a/vscode/webviews/components/FileLink.tsx b/vscode/webviews/components/FileLink.tsx index a426b0ad7ff9..2a7a5e322a3e 100644 --- a/vscode/webviews/components/FileLink.tsx +++ b/vscode/webviews/components/FileLink.tsx @@ -128,6 +128,10 @@ export const FileLink: React.FunctionComponent< privateMetadata: { filename: displayPath(uri), }, + billingMetadata: { + product: 'cody', + category: 'core', + }, }) }, [telemetryRecorder, oneboxEnabled, uri]) diff --git a/vscode/webviews/components/NLSResultSnippet.tsx b/vscode/webviews/components/NLSResultSnippet.tsx index 561dd828f679..e3796ec2c845 100644 --- a/vscode/webviews/components/NLSResultSnippet.tsx +++ b/vscode/webviews/components/NLSResultSnippet.tsx @@ -37,6 +37,7 @@ export const NLSResultSnippet: FC = ({ if (result.__typename === 'FileMatch') { telemetryRecorder.recordEvent('onebox.searchResult', 'clicked', { privateMetadata: { filename: result.file.path }, + billingMetadata: { product: 'cody', category: 'core' }, }) } }, [telemetryRecorder, result])