datadog-lambda-js
Advanced tools
Comparing version 4.66.0 to 4.67.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.datadogLambdaVersion = void 0; | ||
exports.datadogLambdaVersion = "4.66.0"; | ||
exports.datadogLambdaVersion = "4.67.0"; | ||
//# sourceMappingURL=constants.js.map |
@@ -124,2 +124,7 @@ "use strict"; | ||
} | ||
var sampled = convertToSampleMode(parseInt(context.xraySampled, 10)); | ||
if (sampled === constants_1.SampleMode.USER_REJECT || sampled === constants_1.SampleMode.AUTO_REJECT) { | ||
(0, utils_1.logDebug)("discarding xray metadata subsegment due to sampling"); | ||
return; | ||
} | ||
// Convert from milliseconds to seconds | ||
@@ -126,0 +131,0 @@ var time = Date.now() * 0.001; |
{ | ||
"name": "datadog-lambda-js", | ||
"version": "4.66.0", | ||
"version": "4.67.0", | ||
"description": "Lambda client library that supports hybrid tracing in node js", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -8,3 +8,3 @@ # datadog-lambda-js | ||
Datadog Lambda Library for Node.js enables enhanced Lambda metrics, distributed tracing, and custom metric submission from AWS Lambda functions. | ||
Datadog Lambda Library for Node.js (12.x and 14.x) enables enhanced Lambda metrics, distributed tracing, and custom metric submission from AWS Lambda functions. | ||
@@ -55,2 +55,17 @@ ## Installation | ||
## Handler wrapper | ||
In order to instrument individual invocations, the Datadog Lambda library needs to wrap around your Lambda handler function. This is usually achieved by pointing your function's handler setting to the provided Datadog handler function and passing the original handler function through an environment variable to be called by the Datadog handler. | ||
If this method doesn't work for you, instead of overriding the handler and setting the `DD_LAMBDA_HANDLER` environment variable, you can apply the Datadog Lambda library wrapper in your function code like below: | ||
```js | ||
const { datadog } = require("datadog-lambda-js"); | ||
const tracer = require('dd-trace').init({}); | ||
module.exports.myHandler = datadog(myHandler, { | ||
// my function code | ||
}); | ||
``` | ||
## Custom logger | ||
@@ -57,0 +72,0 @@ |
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
346268
161
4913
162