Skip to content

Commit

Permalink
Merge master into feature/emr
Browse files Browse the repository at this point in the history
  • Loading branch information
aws-toolkit-automation authored Nov 26, 2024
2 parents 68cc251 + 6a4a746 commit c9f5ba5
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions packages/core/src/codewhisperer/util/telemetryHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,39 @@ export class TelemetryHelper {
credentialStartUrl: AuthUtil.instance.startUrl,
traceId: this.traceId,
})

client
.sendTelemetryEvent({
telemetryEvent: {
userTriggerDecisionEvent: {
sessionId: sessionId,
requestId: requestIdList[0],
customizationArn: selectedCustomization.arn === '' ? undefined : selectedCustomization.arn,
programmingLanguage: {
languageName: runtimeLanguageContext.toRuntimeLanguage(language),
},
completionType: 'LINE',
suggestionState: 'EMPTY',
recommendationLatencyMilliseconds: 0,
triggerToResponseLatencyMilliseconds: session.timeToFirstRecommendation,
perceivedLatencyMilliseconds: session.perceivedLatency,
timestamp: new Date(Date.now()),
suggestionReferenceCount: 0,
generatedLine: 0,
numberOfRecommendations: 0,
acceptedCharacterCount: 0,
},
},
})
.then()
.catch((error) => {
let requestId: string | undefined
if (isAwsError(error)) {
requestId = error.requestId
}

getLogger().error(`Failed to invoke sendTelemetryEvent, requestId: ${requestId ?? ''}`)
})
}

/**
Expand Down

0 comments on commit c9f5ba5

Please sign in to comment.