Skip to content

Commit 858cad6

Browse files
authored
telemetry(amazonq): align flare/vscode codewhisperer_serviceInvocation metric (#7244)
## Problem vscode keeps track of `codewhispererImportRecommendationEnabled` inside of the `codewhisperer_serviceInvocation` event but flare doesn't ## Solution add it before emitting telemetry, since this is purely a client side feature --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent ddad4ec commit 858cad6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/amazonq/src/lsp/chat/messages.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ import { v4 as uuidv4 } from 'uuid'
5656
import * as vscode from 'vscode'
5757
import { Disposable, LanguageClient, Position, TextDocumentIdentifier } from 'vscode-languageclient'
5858
import { AmazonQChatViewProvider } from './webviewProvider'
59-
import { AuthUtil, ReferenceLogViewProvider } from 'aws-core-vscode/codewhisperer'
59+
import { AuthUtil, CodeWhispererSettings, ReferenceLogViewProvider } from 'aws-core-vscode/codewhisperer'
6060
import { amazonQDiffScheme, AmazonQPromptSettings, messages, openUrl } from 'aws-core-vscode/shared'
6161
import {
6262
DefaultAmazonQAppInitContext,
@@ -95,6 +95,14 @@ export function registerLanguageServerEventListener(languageClient: LanguageClie
9595
const telemetryName: string = e.name
9696

9797
if (telemetryName in telemetry) {
98+
switch (telemetryName) {
99+
case 'codewhisperer_serviceInvocation': {
100+
// this feature is entirely client side right now
101+
e.data.codewhispererImportRecommendationEnabled =
102+
CodeWhispererSettings.instance.isImportRecommendationEnabled()
103+
break
104+
}
105+
}
98106
telemetry[telemetryName as keyof TelemetryBase].emit(e.data)
99107
}
100108
})

0 commit comments

Comments
 (0)