Skip to content

Commit fd27a81

Browse files
authored
telemetry: add result field to metric #4171
1) transformByQ "before all" hook for "WHEN upload payload with missing sha256 in headers THEN fails to upload": Error: Metric `codeTransform_jobCreateZipEndTime` was emitted without the `result` property. This property is always required. Consider using `.run()` instead of `.emit()`, which will set these properties automatically. See https://github.com/aws/aws-toolkit-vscode/blob/master/docs/telemetry.md#guidelines
1 parent 5838159 commit fd27a81

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/codewhisperer/service/transformByQHandler.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,11 +389,14 @@ export async function zipCode(modulePath: string) {
389389
fs.rmSync(dependencyFolderPath, { recursive: true, force: true })
390390
}
391391

392+
// for now, use the pass/fail status of the maven command to determine this metric status
393+
const mavenStatus = mavenFailed ? MetadataResult.Fail : MetadataResult.Pass
392394
telemetry.codeTransform_jobCreateZipEndTime.emit({
393395
codeTransformSessionId: codeTransformTelemetryState.getSessionId(),
394396
// TODO: A nice to have would be getting the zipUploadSize
395397
codeTransformTotalByteSize: 0,
396398
codeTransformRunTimeLatency: calculateTotalLatency(zipStartTime),
399+
result: mavenStatus,
397400
})
398401
return tempFilePath
399402
}

0 commit comments

Comments
 (0)