/datadog-lambda-js

The Datadog AWS Lambda Library for Node

Primary LanguageTypeScriptApache License 2.0Apache-2.0

datadog-lambda-js

build Code Coverage NPM Slack License

Datadog Lambda Library for Node.js (12.x, 14.x, 16.x, and 18.x) enables enhanced Lambda metrics, distributed tracing, and custom metric submission from AWS Lambda functions.

Installation

Follow the installation instructions, and view your function's enhanced metrics, traces and logs in Datadog.

Configuration

Follow the configuration instructions to tag your telemetry, capture request/response payloads, filter or scrub sensitive information from logs or traces, and more.

For additional tracing configuration options, check out the official documentation for Datadog trace client.

Lambda Profiling Beta

Datadog's Continuous Profiler is now available in beta for NodeJS in version 6.87.0 and layer version 87 and above. This optional feature is enabled by setting the DD_PROFILING_ENABLED environment variable to true. During the beta period, profiling is available at no additional cost.

Major Version Notes

5.x.x

The 5.x.x release introduces version 2 of the Datadog tracer, dd-trace-js. This includes a few breaking changes, and the migration guide found here.

The first 5.x.x version was released with Lambda Layer version 69.

6.x.x

The 6.x.x release introduces support for the node 16 runtime and esm modules.

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.

Opening Issues

If you encounter a bug with this package, we want to hear about it. Before opening a new issue, search the existing issues to avoid duplicates.

When opening an issue, include the Datadog Lambda Layer version, Node version, and stack trace if available. In addition, include the steps to reproduce when appropriate.

You can also open an issue for a feature request.

Contributing

If you find an issue with this package and have a fix, please feel free to open a pull request following the procedures.

Community

For product feedback and questions, join the #serverless channel in the Datadog community on Slack.

License

Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.

This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2019 Datadog, Inc.