datadog-lambda-js
Advanced tools
Comparing version 6.80.0 to 6.81.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.datadogLambdaVersion = void 0; | ||
exports.datadogLambdaVersion = "6.80.0"; | ||
exports.datadogLambdaVersion = "6.81.0"; | ||
//# sourceMappingURL=constants.js.map |
@@ -171,2 +171,3 @@ "use strict"; | ||
return [4 /*yield*/, traceListener.onWrap(function (localEvent, localContext) { return __awaiter(_this, void 0, void 0, function () { | ||
var responseIs5xxError; | ||
return __generator(this, function (_a) { | ||
@@ -181,3 +182,6 @@ switch (_a.label) { | ||
case 2: | ||
traceListener.onEndingInvocation(localEvent, localResult, finalConfig.captureLambdaPayload); | ||
responseIs5xxError = traceListener.onEndingInvocation(localEvent, localResult, finalConfig.captureLambdaPayload); | ||
if (responseIs5xxError) { | ||
(0, metrics_1.incrementErrorsMetric)(metricsListener, context); | ||
} | ||
return [7 /*endfinally*/]; | ||
@@ -184,0 +188,0 @@ case 3: return [2 /*return*/, localResult]; |
@@ -56,3 +56,3 @@ import { Context } from "aws-lambda"; | ||
*/ | ||
onEndingInvocation(event: any, result: any, shouldTagPayload?: boolean): void; | ||
onEndingInvocation(event: any, result: any, shouldTagPayload?: boolean): boolean; | ||
onCompleteInvocation(error?: any): Promise<void>; | ||
@@ -59,0 +59,0 @@ onWrap<T = (...args: any[]) => any>(func: T): T; |
@@ -132,3 +132,3 @@ "use strict"; | ||
if (!this.tracerWrapper.currentSpan) | ||
return; | ||
return false; | ||
this.wrappedCurrentSpan = new span_wrapper_1.SpanWrapper(this.tracerWrapper.currentSpan, {}); | ||
@@ -148,4 +148,9 @@ if (shouldTagPayload) { | ||
this.inferredSpan.setTag("http.status_code", statusCode); | ||
if ((statusCode === null || statusCode === void 0 ? void 0 : statusCode.length) === 3 && (statusCode === null || statusCode === void 0 ? void 0 : statusCode.startsWith("5"))) { | ||
this.wrappedCurrentSpan.setTag("error", 1); | ||
return true; | ||
} | ||
} | ||
} | ||
return false; | ||
}; | ||
@@ -152,0 +157,0 @@ TraceListener.prototype.onCompleteInvocation = function (error) { |
{ | ||
"name": "datadog-lambda-js", | ||
"version": "6.80.0", | ||
"version": "6.81.0", | ||
"description": "Lambda client library that supports hybrid tracing in node js", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
383175
153
5480
22