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)