File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -136,16 +136,16 @@ export function datadog<TEvent, TResult>(
136
136
try {
137
137
localResult = await promHandler ( localEvent , localContext ) ;
138
138
} finally {
139
+ if ( traceListener . currentSpan && finalConfig . captureLambdaPayload ) {
140
+ tagObject ( traceListener . currentSpan , "function.request" , localEvent ) ;
141
+ tagObject ( traceListener . currentSpan , "function.response" , localResult ) ;
142
+ }
139
143
if ( traceListener . triggerTags ) {
140
144
const statusCode = extractHTTPStatusCodeTag ( traceListener . triggerTags , localResult ) ;
141
145
if ( statusCode ) {
142
146
// Store the status tag in the listener to send to Xray on invocation completion
143
147
traceListener . triggerTags [ "http.status_code" ] = statusCode ;
144
148
if ( traceListener . currentSpan ) {
145
- if ( finalConfig . captureLambdaPayload ) {
146
- tagObject ( traceListener . currentSpan , "function.request" , localEvent ) ;
147
- tagObject ( traceListener . currentSpan , "function.response" , localResult ) ;
148
- }
149
149
traceListener . currentSpan . setTag ( "http.status_code" , statusCode ) ;
150
150
}
151
151
}
You can’t perform that action at this time.
0 commit comments