Skip to content

Commit 90007d0

Browse files
opieter-awsashishrp-awslaileni-awszixlin7
authored
fix: add result attribute when emitting telemetry event (#1088)
* fix: add result attribute when emitting telemetry event * fix: remove comment * fix: unit test * fix: fix unit test * fix: fix unit test * feat(chat-client): open use input prompt for agentic chat and new prompt should st… (#1081) feat: open use input prompt for agentic chat and new prompt should stop current response * fix: ux polish for list directory tool messages. (#1075) ## Problem - Existing UX shows multiple context list chatItem cards for list directory tool messages. ## Solution - Use a `messageIdToUpdateListDir` state to store the messageId and update this for next list directory tool messages. ![image](https://github.com/user-attachments/assets/08fff204-0bbc-4467-b05b-7f90be062fc1) ## TODO: - Need to combine both read and list directory tool messages into one context list. - This code change is equivalent to this PR: aws/aws-toolkit-vscode#7006 in `feature/agentic-chat` branch. * fix: execute command should show when no approval required & add more loading (#1091) * fix: fix unit test --------- Co-authored-by: invictus <[email protected]> Co-authored-by: Laxman Reddy <[email protected]> Co-authored-by: Zoe Lin <[email protected]>
1 parent d68d148 commit 90007d0

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

server/aws-lsp-codewhisperer/src/language-server/chat/telemetry/chatTelemetryController.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe('TelemetryController', () => {
5454

5555
sinon.assert.calledOnceWithExactly(testFeatures.telemetry.emitMetric, {
5656
name: ChatTelemetryEventName.EnterFocusChat,
57-
data: { credentialStartUrl: undefined },
57+
data: { credentialStartUrl: undefined, result: 'Succeeded' },
5858
})
5959
})
6060

@@ -67,7 +67,7 @@ describe('TelemetryController', () => {
6767

6868
sinon.assert.calledOnceWithExactly(testFeatures.telemetry.emitMetric, {
6969
name: ChatTelemetryEventName.ExitFocusChat,
70-
data: { credentialStartUrl: undefined },
70+
data: { credentialStartUrl: undefined, result: 'Succeeded' },
7171
})
7272
})
7373

@@ -104,6 +104,7 @@ describe('TelemetryController', () => {
104104
data: {
105105
[CONVERSATION_ID_METRIC_KEY]: mockConversationId,
106106
credentialStartUrl: undefined,
107+
result: 'Succeeded',
107108
},
108109
})
109110
})

server/aws-lsp-codewhisperer/src/language-server/chat/telemetry/chatTelemetryController.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ export class ChatTelemetryController {
140140
data: {
141141
...metric.data,
142142
credentialStartUrl: this.#credentialsProvider.getConnectionMetadata()?.sso?.startUrl,
143+
result: 'Succeeded',
143144
},
144145
})
145146
}
@@ -161,6 +162,7 @@ export class ChatTelemetryController {
161162
...metric.data,
162163
credentialStartUrl: this.#credentialsProvider.getConnectionMetadata()?.sso?.startUrl,
163164
[CONVERSATION_ID_METRIC_KEY]: conversationId,
165+
result: 'Succeeded',
164166
},
165167
})
166168
}

server/aws-lsp-codewhisperer/src/shared/telemetry/telemetryService.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ describe('TelemetryService', () => {
446446
cwsprChatAcceptedCharactersLength: 100,
447447
cwsprChatConversationId: 'conv123',
448448
credentialStartUrl: 'idc-start-url',
449+
result: 'Succeeded',
449450
},
450451
})
451452
})
@@ -752,6 +753,7 @@ describe('TelemetryService', () => {
752753
cwsprChatModificationPercentage: 0.2,
753754
codewhispererCustomizationArn: 'test-arn',
754755
credentialStartUrl: 'idc-start-url',
756+
result: 'Succeeded',
755757
},
756758
})
757759
})
@@ -874,6 +876,7 @@ describe('TelemetryService', () => {
874876
cwsprChatActiveEditorTotalCharacters: 250,
875877
cwsprChatActiveEditorImportCount: undefined,
876878
codewhispererCustomizationArn: 'cust-123',
879+
result: 'Succeeded',
877880
},
878881
})
879882
})

server/aws-lsp-codewhisperer/src/shared/telemetry/telemetryService.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ export class TelemetryService {
254254
...metric,
255255
[CONVERSATION_ID_METRIC_KEY]: options.conversationId,
256256
credentialStartUrl: this.credentialsProvider.getConnectionMetadata()?.sso?.startUrl,
257+
result: 'Succeeded',
257258
},
258259
})
259260
}
@@ -290,6 +291,7 @@ export class TelemetryService {
290291
cwsprChatModificationPercentage: params.modificationPercentage,
291292
codewhispererCustomizationArn: params.customizationArn,
292293
credentialStartUrl: this.credentialsProvider.getConnectionMetadata()?.sso?.startUrl,
294+
result: 'Succeeded',
293295
},
294296
})
295297
}
@@ -420,6 +422,7 @@ export class TelemetryService {
420422
cwsprChatActiveEditorTotalCharacters: params.activeEditorTotalCharacters,
421423
cwsprChatActiveEditorImportCount: additionalParams.chatActiveEditorImportCount,
422424
codewhispererCustomizationArn: params.customizationArn,
425+
result: 'Succeeded',
423426
},
424427
})
425428
}

0 commit comments

Comments
 (0)