File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,9 @@ where
158158 trace ! ( "{}" , std:: str :: from_utf8( & body) ?) ; // this may be very verbose
159159 let body = serde_json:: from_slice ( & body) ?;
160160
161+ let xray_trace_id = & ctx. xray_trace_id . clone ( ) ;
162+ env:: set_var ( "_X_AMZN_TRACE_ID" , xray_trace_id) ;
163+
161164 let request_id = & ctx. request_id . clone ( ) ;
162165 let task = panic:: catch_unwind ( panic:: AssertUnwindSafe ( || handler. call ( body, ctx) ) ) ;
163166
Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ impl TryFrom<HeaderMap> for Context {
139139 . to_owned ( ) ,
140140 xray_trace_id : headers
141141 . get ( "lambda-runtime-trace-id" )
142- . unwrap_or ( & HeaderValue :: from_static ( "No header lambda-runtime-trace-id found. " ) )
142+ . unwrap_or ( & HeaderValue :: from_static ( "" ) )
143143 . to_str ( ) ?
144144 . to_owned ( ) ,
145145 ..Default :: default ( )
You can’t perform that action at this time.
0 commit comments