From df19df27e8bd8d464882f1941b549e5b11190dfb Mon Sep 17 00:00:00 2001 From: Josh Pinkney Date: Wed, 6 Nov 2024 12:27:20 -0500 Subject: [PATCH] telemetry(amazonq): include trace id in amazonq_addMessage --- packages/core/src/amazonq/messages/chatMessageDuration.ts | 7 ++++++- .../codewhispererChat/controllers/chat/telemetryHelper.ts | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/core/src/amazonq/messages/chatMessageDuration.ts b/packages/core/src/amazonq/messages/chatMessageDuration.ts index e2abdf82246..5898392e1ff 100644 --- a/packages/core/src/amazonq/messages/chatMessageDuration.ts +++ b/packages/core/src/amazonq/messages/chatMessageDuration.ts @@ -96,7 +96,12 @@ export class AmazonQChatMessageDuration { }) } - CWCTelemetryHelper.instance.emitAddMessage(tabID, totalDuration, metrics.events.chatMessageSent) + CWCTelemetryHelper.instance.emitAddMessage( + tabID, + totalDuration, + metrics.traceId, + metrics.events.chatMessageSent + ) uiEventRecorder.delete(tabID) }) diff --git a/packages/core/src/codewhispererChat/controllers/chat/telemetryHelper.ts b/packages/core/src/codewhispererChat/controllers/chat/telemetryHelper.ts index c6e12d601c2..feaeec75969 100644 --- a/packages/core/src/codewhispererChat/controllers/chat/telemetryHelper.ts +++ b/packages/core/src/codewhispererChat/controllers/chat/telemetryHelper.ts @@ -420,7 +420,7 @@ export class CWCTelemetryHelper { }) } - public emitAddMessage(tabID: string, fullDisplayLatency: number, startTime?: number) { + public emitAddMessage(tabID: string, fullDisplayLatency: number, traceId: string, startTime?: number) { const payload = this.messageStorage.get(tabID) if (!payload) { return @@ -464,6 +464,7 @@ export class CWCTelemetryHelper { credentialStartUrl: AuthUtil.instance.startUrl, codewhispererCustomizationArn: triggerPayload.customization.arn, cwsprChatHasProjectContext: hasProjectLevelContext, + traceId, } telemetry.amazonq_addMessage.emit(event)