Skip to content

Commit 363779d

Browse files
committed
telemetry(amazonq): set telemetry trigger type
1 parent 42f6787 commit 363779d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/amazonq/src/app/inline/completion.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ import {
3232
ReferenceLogViewProvider,
3333
ImportAdderProvider,
3434
CodeSuggestionsState,
35-
TelemetryHelper,
3635
} from 'aws-core-vscode/codewhisperer'
36+
import { TelemetryHelper } from './telemetryHelper'
3737

3838
export class InlineCompletionManager implements Disposable {
3939
private disposable: Disposable
@@ -190,6 +190,7 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
190190
}
191191

192192
TelemetryHelper.instance.setInvokeSuggestionStartTime()
193+
TelemetryHelper.instance.setTriggerType(context.triggerKind)
193194

194195
// make service requests if it's a new session
195196
await this.recommendationService.getAllRecommendations(

packages/amazonq/src/app/inline/recommendationService.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ export class RecommendationService {
4444

4545
// Set telemetry data for the first response
4646
TelemetryHelper.instance.setSdkApiCallEndTime()
47-
TelemetryHelper.instance.setFirstResponseRequestId(firstResult.sessionId)
47+
if (firstResult.items.length > 0) {
48+
TelemetryHelper.instance.setFirstResponseRequestId(firstResult.items[0].itemId)
49+
}
4850
TelemetryHelper.instance.setFirstSuggestionShowTime()
4951

5052
const firstCompletionDisplayLatency = Date.now() - requestStartTime

0 commit comments

Comments
 (0)