Skip to content

Commit

Permalink
telemetry(amazonq): include trace id in amazonq_addMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
jpinkney-aws committed Nov 6, 2024
1 parent 34b695a commit df19df2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion packages/core/src/amazonq/messages/chatMessageDuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -464,6 +464,7 @@ export class CWCTelemetryHelper {
credentialStartUrl: AuthUtil.instance.startUrl,
codewhispererCustomizationArn: triggerPayload.customization.arn,
cwsprChatHasProjectContext: hasProjectLevelContext,
traceId,
}

telemetry.amazonq_addMessage.emit(event)
Expand Down

0 comments on commit df19df2

Please sign in to comment.