Skip to content

Commit 2124e11

Browse files
Use generated trace ID instead of empty one
Co-authored-by: tomer doron <[email protected]>
1 parent 5369009 commit 2124e11

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/AWSLambdaRuntimeCore/ControlPlaneRequest.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ struct Invocation: Hashable {
5454
self.requestID = requestID
5555
self.deadlineInMillisSinceEpoch = unixTimeInMilliseconds
5656
self.invokedFunctionARN = invokedFunctionARN
57-
self.traceID = headers.first(name: AmazonHeaders.traceID) ?? ""
57+
self.traceID = headers.first(name: AmazonHeaders.traceID) ??
58+
"Root=\(AmazonHeaders.generateXRayTraceID());Sampled=0"
5859
self.clientContext = headers["Lambda-Runtime-Client-Context"].first
5960
self.cognitoIdentity = headers["Lambda-Runtime-Cognito-Identity"].first
6061
}

0 commit comments

Comments
 (0)