Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

datadog-lambda-js

Package Overview
Dependencies
Maintainers
1
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

datadog-lambda-js - npm Package Compare versions

Comparing version 5.77.0 to 6.78.0

dist/handler.cjs

2

dist/constants.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.datadogLambdaVersion = void 0;
exports.datadogLambdaVersion = "5.77.0";
exports.datadogLambdaVersion = "6.78.0";
//# sourceMappingURL=constants.js.map

@@ -39,2 +39,3 @@ "use strict";

RuntimeTagValues["Node14"] = "nodejs14.x";
RuntimeTagValues["Node16"] = "nodejs16.x";
})(RuntimeTagValues || (RuntimeTagValues = {}));

@@ -59,2 +60,5 @@ function getVersionTag() {

}
if (processVersion.startsWith("v16")) {
processVersionTagString = RuntimeTagValues.Node16;
}
if (!processVersionTagString) {

@@ -61,0 +65,0 @@ return null;

@@ -1,2 +0,2 @@

export { load } from "./user-function";
export { load, loadSync } from "./user-function";
//# sourceMappingURL=index.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.load = void 0;
exports.loadSync = exports.load = void 0;
var user_function_1 = require("./user-function");
Object.defineProperty(exports, "load", { enumerable: true, get: function () { return user_function_1.load; } });
Object.defineProperty(exports, "loadSync", { enumerable: true, get: function () { return user_function_1.loadSync; } });
//# sourceMappingURL=index.js.map

@@ -30,3 +30,23 @@ /**

*/
export declare const load: (appRoot: string, fullHandlerString: string) => any;
export declare const load: (appRoot: string, fullHandlerString: string) => Promise<any>;
/**
* Load the user's function with the approot and the handler string.
* @param appRoot {string}
* The path to the application root.
* @param handlerString {string}
* The user-provided handler function in the form 'module.function'.
* @return userFuction {function}
* The user's handler function. This function will be passed the event body,
* the context object, and the callback function.
* @throws In five cases:-
* 1 - if the handler string is incorrectly formatted an error is thrown
* 2 - if the module referenced by the handler cannot be loaded
* 3 - if the function in the handler does not exist in the module
* 4 - if a property with the same name, but isn't a function, exists on the
* module
* 5 - the handler includes illegal character sequences (like relative paths
* for traversing up the filesystem '..')
* Errors for scenarios known by the runtime, will be wrapped by Runtime.* errors.
*/
export declare const loadSync: (appRoot: string, fullHandlerString: string) => any;
//# sourceMappingURL=user-function.d.ts.map

@@ -12,2 +12,38 @@ /**

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var __read = (this && this.__read) || function (o, n) {

@@ -33,6 +69,7 @@ var m = typeof Symbol === "function" && o[Symbol.iterator];

Object.defineProperty(exports, "__esModule", { value: true });
exports.load = void 0;
exports.loadSync = exports.load = void 0;
var path_1 = __importDefault(require("path"));
var fs_1 = __importDefault(require("fs"));
var errors_1 = require("./errors");
var errors_js_1 = require("./errors.js");
var module_importer = require("./module_importer");
var FUNCTION_EXPR = /^([^.]*)\.(.*)$/;

@@ -58,3 +95,3 @@ var RELATIVE_PATH_SUBSTRING = "..";

if (!match || match.length != 3) {
throw new errors_1.MalformedHandlerName("Bad handler");
throw new errors_js_1.MalformedHandlerName("Bad handler");
}

@@ -71,10 +108,108 @@ return [match[1], match[2]]; // [module, function-path]

}
function _tryRequireFile(file, extension) {
var path = file + (extension || "");
return fs_1.default.existsSync(path) ? require(path) : undefined;
}
function _tryAwaitImport(file, extension) {
return __awaiter(this, void 0, void 0, function () {
var path;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
path = file + (extension || "");
if (!fs_1.default.existsSync(path)) return [3 /*break*/, 2];
return [4 /*yield*/, module_importer.import(path)];
case 1: return [2 /*return*/, _a.sent()];
case 2: return [2 /*return*/];
}
});
});
}
function _hasFolderPackageJsonTypeModule(folder) {
// Check if package.json exists, return true if type === "module" in package json.
// If there is no package.json, and there is a node_modules, return false.
// Check parent folder otherwise, if there is one.
if (folder.endsWith("/node_modules")) {
return false;
}
var pj = path_1.default.join(folder, "/package.json");
if (fs_1.default.existsSync(pj)) {
try {
var pkg = JSON.parse(fs_1.default.readFileSync(pj, "utf-8"));
if (pkg) {
if (pkg.type === "module") {
return true;
}
else {
return false;
}
}
}
catch (e) {
console.warn("".concat(pj, " cannot be read, it will be ignored for ES module detection purposes."), e);
return false;
}
}
if (folder === "/") {
// We have reached root without finding either a package.json or a node_modules.
return false;
}
return _hasFolderPackageJsonTypeModule(path_1.default.resolve(folder, ".."));
}
function _hasPackageJsonTypeModule(file) {
// File must have a .js extension
var jsPath = file + ".js";
return fs_1.default.existsSync(jsPath)
? _hasFolderPackageJsonTypeModule(path_1.default.resolve(path_1.default.dirname(jsPath)))
: false;
}
/**
* Verify that the provided path can be loaded as a file per:
* https://nodejs.org/dist/latest-v10.x/docs/api/modules.html#modules_all_together
* @param string - the fully resolved file path to the module
* @return bool
* Attempt to load the user's module.
* Attempts to directly resolve the module relative to the application root,
* then falls back to the more general require().
*/
function _canLoadAsFile(modulePath) {
return fs_1.default.existsSync(modulePath) || fs_1.default.existsSync(modulePath + ".js");
function _tryRequire(appRoot, moduleRoot, module) {
return __awaiter(this, void 0, void 0, function () {
var lambdaStylePath, extensionless, pjHasModule, loaded_1, loaded, _a, _b, nodeStylePath;
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
lambdaStylePath = path_1.default.resolve(appRoot, moduleRoot, module);
extensionless = _tryRequireFile(lambdaStylePath);
if (extensionless) {
return [2 /*return*/, extensionless];
}
pjHasModule = _hasPackageJsonTypeModule(lambdaStylePath);
if (!pjHasModule) {
loaded_1 = _tryRequireFile(lambdaStylePath, ".js");
if (loaded_1) {
return [2 /*return*/, loaded_1];
}
}
_b = pjHasModule;
if (!_b) return [3 /*break*/, 2];
return [4 /*yield*/, _tryAwaitImport(lambdaStylePath, ".js")];
case 1:
_b = (_c.sent());
_c.label = 2;
case 2:
_a = (_b);
if (_a) return [3 /*break*/, 4];
return [4 /*yield*/, _tryAwaitImport(lambdaStylePath, ".mjs")];
case 3:
_a = (_c.sent());
_c.label = 4;
case 4:
loaded = _a ||
_tryRequireFile(lambdaStylePath, ".cjs");
if (loaded) {
return [2 /*return*/, loaded];
}
nodeStylePath = require.resolve(module, {
paths: [appRoot, moduleRoot],
});
return [2 /*return*/, require(nodeStylePath)];
}
});
});
}

@@ -86,15 +221,34 @@ /**

*/
function _tryRequire(appRoot, moduleRoot, module) {
function _tryRequireSync(appRoot, moduleRoot, module) {
var lambdaStylePath = path_1.default.resolve(appRoot, moduleRoot, module);
if (_canLoadAsFile(lambdaStylePath)) {
return require(lambdaStylePath);
// Extensionless files are loaded via require.
var extensionless = _tryRequireFile(lambdaStylePath);
if (extensionless) {
return extensionless;
}
else {
// Why not just require(module)?
// Because require() is relative to __dirname, not process.cwd()
var nodeStylePath = require.resolve(module, {
paths: [appRoot, moduleRoot],
});
return require(nodeStylePath);
// If package.json type != module, .js files are loaded via require.
var pjHasModule = _hasPackageJsonTypeModule(lambdaStylePath);
if (!pjHasModule) {
var loaded_2 = _tryRequireFile(lambdaStylePath, ".js");
if (loaded_2) {
return loaded_2;
}
}
// If still not loaded, try .js, .mjs, and .cjs in that order.
// Files ending with .js are loaded as ES modules when the nearest parent package.json
// file contains a top-level field "type" with a value of "module".
// https://nodejs.org/api/packages.html#packages_type
var loaded = _tryRequireFile(lambdaStylePath, ".cjs");
if (loaded) {
return loaded;
}
// Why not just require(module)?
// Because require() is relative to __dirname, not process.cwd(). And the
// runtime implementation is not located in /var/task
// This won't work (yet) for esModules as import.meta.resolve is still experimental
// See: https://nodejs.org/api/esm.html#esm_import_meta_resolve_specifier_parent
var nodeStylePath = require.resolve(module, {
paths: [appRoot, moduleRoot],
});
return require(nodeStylePath);
}

@@ -108,8 +262,36 @@ /**

function _loadUserApp(appRoot, moduleRoot, module) {
return __awaiter(this, void 0, void 0, function () {
var e_1;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_a.trys.push([0, 2, , 3]);
return [4 /*yield*/, _tryRequire(appRoot, moduleRoot, module)];
case 1: return [2 /*return*/, _a.sent()];
case 2:
e_1 = _a.sent();
if (e_1 instanceof SyntaxError) {
throw new errors_js_1.UserCodeSyntaxError(e_1);
// @ts-ignore
}
else if (e_1.code !== undefined && e_1.code === "MODULE_NOT_FOUND") {
// @ts-ignore
throw new errors_js_1.ImportModuleError(e_1);
}
else {
throw e_1;
}
return [3 /*break*/, 3];
case 3: return [2 /*return*/];
}
});
});
}
function _loadUserAppSync(appRoot, moduleRoot, module) {
try {
return _tryRequire(appRoot, moduleRoot, module);
return _tryRequireSync(appRoot, moduleRoot, module);
}
catch (e) {
if (e instanceof SyntaxError) {
throw new errors_1.UserCodeSyntaxError(e);
throw new errors_js_1.UserCodeSyntaxError(e);
// @ts-ignore

@@ -119,3 +301,3 @@ }

// @ts-ignore
throw new errors_1.ImportModuleError(e);
throw new errors_js_1.ImportModuleError(e);
}

@@ -129,3 +311,3 @@ else {

if (fullHandlerString.includes(RELATIVE_PATH_SUBSTRING)) {
throw new errors_1.MalformedHandlerName("'".concat(fullHandlerString, "' is not a valid handler name. Use absolute paths when specifying root directories in handler names."));
throw new errors_js_1.MalformedHandlerName("'".concat(fullHandlerString, "' is not a valid handler name.Use absolute paths when specifying root directories in handler names."));
}

@@ -153,16 +335,60 @@ }

var load = function (appRoot, fullHandlerString) {
return __awaiter(this, void 0, void 0, function () {
var _a, moduleRoot, moduleAndHandler, _b, module, handlerPath, userApp, handlerFunc;
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
_throwIfInvalidHandler(fullHandlerString);
_a = __read(_moduleRootAndHandler(fullHandlerString), 2), moduleRoot = _a[0], moduleAndHandler = _a[1];
_b = __read(_splitHandlerString(moduleAndHandler), 2), module = _b[0], handlerPath = _b[1];
return [4 /*yield*/, _loadUserApp(appRoot, moduleRoot, module)];
case 1:
userApp = _c.sent();
handlerFunc = _resolveHandler(userApp, handlerPath);
if (!handlerFunc) {
throw new errors_js_1.HandlerNotFound("".concat(fullHandlerString, " is undefined or not exported"));
}
if (typeof handlerFunc !== "function") {
throw new errors_js_1.HandlerNotFound("".concat(fullHandlerString, " is not a function"));
}
return [2 /*return*/, handlerFunc];
}
});
});
};
exports.load = load;
/**
* Load the user's function with the approot and the handler string.
* @param appRoot {string}
* The path to the application root.
* @param handlerString {string}
* The user-provided handler function in the form 'module.function'.
* @return userFuction {function}
* The user's handler function. This function will be passed the event body,
* the context object, and the callback function.
* @throws In five cases:-
* 1 - if the handler string is incorrectly formatted an error is thrown
* 2 - if the module referenced by the handler cannot be loaded
* 3 - if the function in the handler does not exist in the module
* 4 - if a property with the same name, but isn't a function, exists on the
* module
* 5 - the handler includes illegal character sequences (like relative paths
* for traversing up the filesystem '..')
* Errors for scenarios known by the runtime, will be wrapped by Runtime.* errors.
*/
var loadSync = function (appRoot, fullHandlerString) {
_throwIfInvalidHandler(fullHandlerString);
var _a = __read(_moduleRootAndHandler(fullHandlerString), 2), moduleRoot = _a[0], moduleAndHandler = _a[1];
var _b = __read(_splitHandlerString(moduleAndHandler), 2), module = _b[0], handlerPath = _b[1];
var userApp = _loadUserApp(appRoot, moduleRoot, module);
var userApp = _loadUserAppSync(appRoot, moduleRoot, module);
var handlerFunc = _resolveHandler(userApp, handlerPath);
if (!handlerFunc) {
throw new errors_1.HandlerNotFound("".concat(fullHandlerString, " is undefined or not exported"));
throw new errors_js_1.HandlerNotFound("".concat(fullHandlerString, " is undefined or not exported"));
}
if (typeof handlerFunc !== "function") {
throw new errors_1.HandlerNotFound("".concat(fullHandlerString, " is not a function"));
throw new errors_js_1.HandlerNotFound("".concat(fullHandlerString, " is not a function"));
}
return handlerFunc;
};
exports.load = load;
exports.loadSync = loadSync;
//# sourceMappingURL=user-function.js.map
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

@@ -15,3 +15,7 @@ "use strict";

if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -18,0 +22,0 @@ if (k2 === undefined) k2 = k;

@@ -15,3 +15,7 @@ "use strict";

if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -18,0 +22,0 @@ if (k2 === undefined) k2 = k;

{
"name": "datadog-lambda-js",
"version": "5.77.0",
"version": "6.78.0",
"description": "Lambda client library that supports hybrid tracing in node js",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -9,3 +9,3 @@ # datadog-lambda-js

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.
Datadog Lambda Library for Node.js (12.x, 14.x and 16.x) enables enhanced Lambda metrics, distributed tracing, and custom metric submission from AWS Lambda functions.

@@ -16,141 +16,23 @@ ## Installation

## Custom Metrics
## Configuration
Once [installed](#installation), you should be able to submit custom metrics from your Lambda function.
Follow the [configuration instructions](https://docs.datadoghq.com/serverless/configuration) to tag your telemetry, capture request/response payloads, filter or scrub sensitive information from logs or traces, and more.
Check out the instructions for [submitting custom metrics from AWS Lambda functions](https://docs.datadoghq.com/integrations/amazon_lambda/?tab=nodejs#custom-metrics).
For additional tracing configuration options, check out the [official documentation for Datadog trace client](https://datadoghq.dev/dd-trace-js/).
## Tracing
## Major Version Notes
Once [installed](#installation), you should be able to view your function's traces in Datadog.
### 5.x.x
For additional details on trace collection, take a look at [collecting traces from AWS Lambda functions](https://docs.datadoghq.com/integrations/amazon_lambda/?tab=nodejs#trace-collection).
The 5.x.x release introduces version 2 of the Datadog tracer, [dd-trace-js](https://github.com/DataDog/dd-trace-js/). This includes a few breaking changes, and the migration guide found [here](https://github.com/DataDog/dd-trace-js/blob/master/MIGRATING.md#nested-objects-as-tags).
For additional details on trace and log connection, check out the [official documentation for Datadog trace client](https://datadoghq.dev/dd-trace-js/).
The first 5.x.x version was released with Lambda Layer version `69`.
### Plugins
### 6.x.x
The `fs` module is disabled by default. If you want to enable it you have to set the environment variable `DD_TRACE_DISABLED_PLUGINS` to `''` or to a comma-separated list of the plugins you want to disable. See the full list of supported plugins [here](https://docs.datadoghq.com/tracing/compatibility_requirements/nodejs/).
The 6.x.x release introduces support for the node 16 runtime and esm modules.
### Tracer Initialization
#### Breaking Changes
If you are using node 12 and installing the NPM module instead of the layer, redirecting your handler to the path `node_modules/datadog-lambda-js/dist/handler.handler` will no longer work. The path should be updated to `node_modules/datadog-lambda-js/dist/handler.handler.cjs`. This won't affect users of node 14, 16, or users of node 12 with the lambda layer.
By default, the Datadog Lambda library automatically initializes the tracer. However, you can follow the steps below to initialize the tracer with [custom settings](https://datadoghq.dev/dd-trace-js/#tracer-settings) in your own function code.
1. Set enviornment variable `DD_TRACE_ENABLED` to `false`, so the Datadog Lambda library does not initialize the tracer.
1. Add the following snippet to the function code to manually initialize the tracer with your desired settings.
```js
const tracer = require("dd-trace").init({
enabled: true,
tags: {
"_dd.origin": "lambda",
},
sampleRate: 0.1, // e.g., keep 10% of traces
});
```
### Trace & Log Correlation
By default, the Datadog trace id gets automatically injected into the logs for correlation, if using `console` or a logging library supported for automatic trace id injection. You have to manually inject the trace id, if using other logging libraries. See additional details on [connecting logs and traces](https://docs.datadoghq.com/tracing/connect_logs_and_traces/nodejs/).
Set the environment variable `DD_LOGS_INJECTION` to `false` to disable this feature.
## 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
You can use your own logger to log layer error and debug logs instead of default `console`
usage.
For example, using the [Pino](https://getpino.io/) logger:
```typescript
const { datadog } = require("datadog-lambda-js");
const logger = require("pino")();
// convert message string to object metadata and message
const messageToObject = (stringMessage) => {
const { message, status, ...metadata } = JSON.parse(stringMessage);
return [metadata, message];
};
async function myHandler(event, context) {
// ...
}
// Use your own logger
module.exports.myHandler = datadog(myHandler, {
logger: {
debug: (message) => logger.debug(...messageToObject(message)),
error: (message) => logger.error(...messageToObject(message)),
},
});
```
## Environment Variables
### DD_FLUSH_TO_LOG
Set to `true` (recommended) to send custom metrics asynchronously (with no added latency to your Lambda function executions) through CloudWatch Logs with the help of [Datadog Forwarder](https://github.com/DataDog/datadog-serverless-functions/tree/master/aws/logs_monitoring). Defaults to `false`. If set to `false`, you also need to set `DD_API_KEY` and `DD_SITE`.
### DD_API_KEY
If `DD_FLUSH_TO_LOG` is set to `false` (not recommended), the Datadog API Key must be defined by setting one of the following environment variables:
- DD_API_KEY - the Datadog API Key in plain-text, NOT recommended
- DD_KMS_API_KEY - the KMS-encrypted API Key, requires the `kms:Decrypt` permission
### DD_SITE
If `DD_FLUSH_TO_LOG` is set to `false` (not recommended), you must set `DD_SITE`. Possible values are `datadoghq.com`, `datadoghq.eu`, `us3.datadoghq.com`, `us5.datadoghq.com`, and `ddog-gov.com`. The default is `datadoghq.com`.
### DD_LOG_LEVEL
Set to `debug` enable debug logs from the Datadog Lambda Library. Defaults to `info`.
### DD_ENHANCED_METRICS
Generate enhanced Datadog Lambda integration metrics, such as, `aws.lambda.enhanced.invocations` and `aws.lambda.enhanced.errors`. Defaults to `true`.
### DD_LAMBDA_HANDLER
Location of your original Lambda handler.
### DD_TRACE_ENABLED
Initialize the Datadog tracer when set to `true`. Defaults to `false`.
### DD_LOGS_INJECTION
Inject Datadog trace id into logs for correlation. Defaults to `true`.
### DD_MERGE_XRAY_TRACES
Set to `true` to merge the X-Ray trace and the Datadog trace, when using both the X-Ray and Datadog tracing. Defaults to `false`.
### DD_TRACE_MANAGED_SERVICES
Create inferred spans for managed services. Defaults to `true`.
## Major Version Notes
### 5.0
The 5.0 release introduces version 2 of the Datadog tracer, [dd-trace-js](https://github.com/DataDog/dd-trace-js/). This includes a few breaking changes, and the migration guide found [here](https://github.com/DataDog/dd-trace-js/blob/master/MIGRATING.md#nested-objects-as-tags).
5.0 was released with Lambda Layer version `69`.
## Opening Issues

@@ -157,0 +39,0 @@

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

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc