{"id":19054282,"url":"https://github.com/datadog/datadog-lambda-js","last_synced_at":"2026-02-18T19:04:08.077Z","repository":{"id":37584705,"uuid":"189468814","full_name":"DataDog/datadog-lambda-js","owner":"DataDog","description":"The Datadog AWS Lambda Library for Node","archived":false,"fork":false,"pushed_at":"2025-05-12T17:42:14.000Z","size":2893,"stargazers_count":117,"open_issues_count":11,"forks_count":36,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-05-12T18:24:30.271Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DataDog.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-05-30T19:12:21.000Z","updated_at":"2025-05-12T17:42:16.000Z","dependencies_parsed_at":"2023-09-23T05:25:17.610Z","dependency_job_id":"226a5b19-531b-4fe2-9293-cc323006717b","html_url":"https://github.com/DataDog/datadog-lambda-js","commit_stats":{"total_commits":565,"total_committers":32,"mean_commits":17.65625,"dds":0.5964601769911504,"last_synced_commit":"76021dcba883e7cb9e6c960659ba5742e20ebac7"},"previous_names":[],"tags_count":132,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Fdatadog-lambda-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Fdatadog-lambda-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Fdatadog-lambda-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Fdatadog-lambda-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DataDog","download_url":"https://codeload.github.com/DataDog/datadog-lambda-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254292042,"owners_count":22046426,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T23:37:41.285Z","updated_at":"2025-05-15T07:05:56.964Z","avatar_url":"https://github.com/DataDog.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# datadog-lambda-js\n\n![build](https://github.com/DataDog/datadog-lambda-js/workflows/build/badge.svg)\n[![Code Coverage](https://img.shields.io/codecov/c/github/DataDog/datadog-lambda-js)](https://codecov.io/gh/DataDog/datadog-lambda-js)\n[![NPM](https://img.shields.io/npm/v/datadog-lambda-js)](https://www.npmjs.com/package/datadog-lambda-js)\n[![Slack](https://chat.datadoghq.com/badge.svg?bg=632CA6)](https://chat.datadoghq.com/)\n[![License](https://img.shields.io/badge/license-Apache--2.0-blue)](https://github.com/DataDog/datadog-lambda-js/blob/main/LICENSE)\n\nDatadog Lambda Library for Node.js (18.x, 20.x, and 22.x) enables enhanced Lambda metrics, distributed tracing, and custom metric submission from AWS Lambda functions.\n\n## Installation\n\nFollow the [installation instructions](https://docs.datadoghq.com/serverless/installation/nodejs/), and view your function's enhanced metrics, traces and logs in Datadog.\n\n## Configuration\n\nFollow 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.\n\nFor additional tracing configuration options, check out the [official documentation for Datadog trace client](https://datadoghq.dev/dd-trace-js/).\n\nBesides the environment variables supported by dd-trace-js, the datadog-lambda-js library added following environment variables.\n\n\n| Environment Variables | Description | Default Value |\n| -------------------- | ------------ | ------------- |\n| DD_ENCODE_AUTHORIZER_CONTEXT      | When set to `true` for Lambda authorizers, the tracing context will be encoded into the response for propagation. Supported for NodeJS and Python. | `true` |\n| DD_DECODE_AUTHORIZER_CONTEXT      | When set to `true` for Lambdas that are authorized via Lambda authorizers, it will parse and use the encoded tracing context (if found). Supported for NodeJS and Python. | `true` |\n| DD_COLD_START_TRACING | When true (default), tracing occurs during cold start which creates many child spans. When false, only one cold start span is created. Used in NodeJS and Python. | `true` |\n| DD_MIN_COLD_START_DURATION |  Sets the minimum duration (in milliseconds) for a module load event to be traced via Cold Start Tracing. Number. | `3` |\n| DD_COLD_START_TRACE_SKIP_LIB | optionally skip creating Cold Start Spans for a comma-separated list of libraries. Useful to limit depth or skip known libraries. | `./opentracing/tracer` |\n| DD_CAPTURE_LAMBDA_PAYLOAD | [Captures incoming and outgoing AWS Lambda payloads][1] in the Datadog APM spans for Lambda invocations. | `false` |\n| DD_CAPTURE_LAMBDA_PAYLOAD_MAX_DEPTH | Determines the level of detail captured from AWS Lambda payloads, which are then assigned as tags for the `aws.lambda` span. It specifies the nesting depth of the JSON payload structure to process. Once the specified maximum depth is reached, the tag's value is set to the stringified value of any nested elements beyond this level.  \u003cbr\u003e For example, given the input payload: \u003cpre\u003e{\u003cbr\u003e  \"lv1\" : {\u003cbr\u003e    \"lv2\": {\u003cbr\u003e      \"lv3\": \"val\"\u003cbr\u003e    }\u003cbr\u003e  }\u003cbr\u003e}\u003c/pre\u003e If the depth is set to `2`, the resulting tag's key is set to `function.request.lv1.lv2` and the value is `{\\\"lv3\\\": \\\"val\\\"}`. \u003cbr\u003e If the depth is set to `0`, the resulting tag's key is set to `function.request` and value is `{\\\"lv1\\\":{\\\"lv2\\\":{\\\"lv3\\\": \\\"val\\\"}}}` | `10` |\n\n\n## Lambda Profiling Beta\n\nDatadog's [Continuous Profiler](https://www.datadoghq.com/product/code-profiling/) 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.\n\n## Major Version Notes\n\n### 5.x.x\n\nThe 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).\n\nThe first 5.x.x version was released with Lambda Layer version `69`.\n\n### 6.x.x\n\nThe 6.x.x release introduces support for the node 16 runtime and esm modules.\n\n### 7.x.x\n\nThe 7.x.x release drops support for Node12, and upgrades dd-trace-js to version 3.x\n\n### 8.x.x\n\nThe 8.x.x release drops support for Node14, and upgrades dd-trace-js to version 4.x\n\n### 9.x.x\nThe 9.x.x release changed how Lambda's traceID is hashed if the incoming payload contains Step Functions context object. This change only affects those who uses inject Step Functions context object into Lambda payload.\n\nThere is a full migration guide available [here](https://github.com/DataDog/dd-trace-js/blob/master/MIGRATING.md).\nSome changes are more likely to impact Serverless users:\n- `HTTP Operation Name Changed`. HTTP requests will no longer appear as a separate client under `*-http-client`, which polluted the APM service catalog.\n- `tracer.currentSpan()` has been deprecated for a long time, and is now removed.\n- `tracer.bindEmitter()` is similarly removed after being deprecated.\n- It is no longer possible to [bind promises or event emitters with tracer.scope().bind(...)](https://github.com/DataDog/dd-trace-js/blob/master/MIGRATING.md#scope-binding-for-promises-and-event-emitters)\n\n## Opening Issues\n\nIf 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.\n\nWhen 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.\n\nYou can also open an issue for a feature request.\n\n## Contributing\n\nIf you find an issue with this package and have a fix, please feel free to open a pull request following the [procedures](https://github.com/DataDog/dd-lambda-js/blob/main/CONTRIBUTING.md).\n\n## Community\n\nFor product feedback and questions, join the `#serverless` channel in the [Datadog community on Slack](https://chat.datadoghq.com/).\n\n## License\n\nUnless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.\n\nThis product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2019 Datadog, Inc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatadog%2Fdatadog-lambda-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatadog%2Fdatadog-lambda-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatadog%2Fdatadog-lambda-js/lists"}