Skip to content

Commit 4e85929

Browse files
authored
Merge branch 'main' into ivan.topolcic/automatically-create-documentation-pr
2 parents a72f94c + 7fca5df commit 4e85929

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "datadog-lambda-js",
3-
"version": "4.63.0",
3+
"version": "4.64.0",
44
"description": "Lambda client library that supports hybrid tracing in node js",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,16 +136,16 @@ export function datadog<TEvent, TResult>(
136136
try {
137137
localResult = await promHandler(localEvent, localContext);
138138
} finally {
139+
if (traceListener.currentSpan && finalConfig.captureLambdaPayload) {
140+
tagObject(traceListener.currentSpan, "function.request", localEvent);
141+
tagObject(traceListener.currentSpan, "function.response", localResult);
142+
}
139143
if (traceListener.triggerTags) {
140144
const statusCode = extractHTTPStatusCodeTag(traceListener.triggerTags, localResult);
141145
if (statusCode) {
142146
// Store the status tag in the listener to send to Xray on invocation completion
143147
traceListener.triggerTags["http.status_code"] = statusCode;
144148
if (traceListener.currentSpan) {
145-
if (finalConfig.captureLambdaPayload) {
146-
tagObject(traceListener.currentSpan, "function.request", localEvent);
147-
tagObject(traceListener.currentSpan, "function.response", localResult);
148-
}
149149
traceListener.currentSpan.setTag("http.status_code", statusCode);
150150
}
151151
}

0 commit comments

Comments
 (0)