Skip to content

Release/v12.139.0#781

Open
joeyzhao2018 wants to merge 3 commits into
mainfrom
release/v12.139.0
Open

Release/v12.139.0#781
joeyzhao2018 wants to merge 3 commits into
mainfrom
release/v12.139.0

Conversation

@joeyzhao2018
Copy link
Copy Markdown
Contributor

@joeyzhao2018 joeyzhao2018 commented Jun 1, 2026

The datadog-lambda-js/package.json is not included in our layers, because the layer build only copies dist there in Dockerfile (line 15).

What changed in dd-trace@5.105.0 is the hook wrapper behavior:

moduleVersion ||= getVersion(moduleBaseDir)

getVersion() calls requirePackageJson(moduleBaseDir, module). For this layer, moduleBaseDir is effectively:
/opt/nodejs/node_modules/datadog-lambda-js

  1. MetricsListener.createProcessor() calls require("./api") in src/metrics/listener.ts (line 146).
  2. dd-trace’s require hook sees this as an internal file under the instrumented package datadog-lambda-js. Before letting the lambda hook decide whether to patch it, dd-trace@5.105.0 tries to read datadog-lambda-js/package.json, which fails.
  3. The hook returns undefined. Therefore require("./api") becomes undefined, and destructuring { APIClient } throws.

dd-trace@5.93.0 did not care in this path. Its hook wrapper did not try to read the target package’s package.json before returning module exports. So for datadog-lambda-js/metrics/api.js it just passed the real module exports through

@joeyzhao2018 joeyzhao2018 requested review from a team as code owners June 1, 2026 17:05
@datadog-datadog-prod-us1-2
Copy link
Copy Markdown

datadog-datadog-prod-us1-2 Bot commented Jun 1, 2026

Pipelines

Fix all issues with BitsAI

⚠️ Warnings

🚦 4 Pipeline jobs failed

DataDog/datadog-lambda-js | integration test (node18)   View in Datadog   GitLab

🔧 Fix in code (Fix with Cursor). Mismatch found between logs and expected snapshot for various fields including '_dd.svc_src' and 'links'.

DataDog/datadog-lambda-js | integration test (node20)   View in Datadog   GitLab

🔧 Fix in code (Fix with Cursor). Mismatch between new esm_node logs and snapshot. The output has changed in multiple fields, including '_dd.svc_src', 'links', and 'type'.

DataDog/datadog-lambda-js | integration test (node22)   View in Datadog   GitLab

🔧 Fix in code (Fix with Cursor). Integration tests failed due to mismatch found between new esm_node logs and snapshots.

View all 4 failed jobs.

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 40275a7 | Docs | Datadog PR Page | Give us feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants