Skip to content

Commit 68de5a0

Browse files
committed
fix: pass validation for metric 'aws_modifySetting'
1 parent 8307db8 commit 68de5a0

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

src/codewhisperer/commands/basicCommands.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,19 @@ import { FeatureConfigProvider } from '../service/featureConfigProvider'
4141
export const toggleCodeSuggestions = Commands.declare(
4242
{ id: 'aws.codeWhisperer.toggleCodeSuggestion', compositeKey: { 1: 'source' } },
4343
(suggestionState: CodeSuggestionsState) => async (_: VsCodeCommandArg, source: CodeWhispererSource) => {
44-
const isSuggestionsEnabled = await suggestionState.toggleSuggestions()
45-
await vscode.commands.executeCommand('aws.codeWhisperer.refresh')
46-
telemetry.aws_modifySetting.emit({
47-
settingId: CodeWhispererConstants.autoSuggestionConfig.settingId,
48-
settingState: isSuggestionsEnabled
49-
? CodeWhispererConstants.autoSuggestionConfig.activated
50-
: CodeWhispererConstants.autoSuggestionConfig.deactivated,
44+
await telemetry.aws_modifySetting.run(async span => {
45+
span.record({
46+
settingId: CodeWhispererConstants.autoSuggestionConfig.settingId,
47+
})
48+
49+
const isSuggestionsEnabled = await suggestionState.toggleSuggestions()
50+
span.record({
51+
settingState: isSuggestionsEnabled
52+
? CodeWhispererConstants.autoSuggestionConfig.activated
53+
: CodeWhispererConstants.autoSuggestionConfig.deactivated,
54+
})
55+
56+
await vscode.commands.executeCommand('aws.codeWhisperer.refresh')
5157
})
5258
}
5359
)

src/shared/telemetry/exemptMetrics.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ const validationExemptMetrics: Set<string> = new Set([
1919
'amazonq_isReviewedChanges',
2020
'apigateway_copyUrl',
2121
'aws_loadCredentials',
22-
'aws_modifySetting',
2322
'aws_validateCredentials',
2423
'cloudwatchlogs_download',
2524
'codeTransform_isDoubleClickedToTriggerInvalidProject',

0 commit comments

Comments
 (0)