support ddtrace v6 for node > 22 - #818
Conversation
|
🔗 Commit SHA: 5d68e76 | Docs | View more details | Give us feedback! |
|
Thanks for working on the per-runtime tracer split. The layer mapping (v5 for Node 18/20 and v6 for Node 22+) makes sense. I think the npm contract needs to be explicit before we rely on this for the migration. Here are concrete changes I suggest: 1. Declare the npm compatibility contract
{
"engines": {
"node": ">=18"
},
"peerDependencies": {
"dd-trace": "^5.123.0 || ^6.12.0"
},
"peerDependenciesMeta": {
"dd-trace": {
"optional": true
}
}
}The root devDependency can remain 2.
|
| | No post-Node-18 syntax on the plugin path | dd:`packages/datadog-plugin-lambda/**` | L1 (dd-trace-js lint) | lint rule pinned to Node 18 target — new | pending | dd-trace | | ||
| | Config wiring applied per-line (`config/index.js` is not cherry-pick-clean) | dd:`packages/dd-trace/src/config/index.js` × 2 lines | L1 (dd-trace-js) | config spec on both lines | pending | dd-trace | | ||
| | npm range resolves to v5 on Node 18 | shim:`package.json` | L1 (datadog-lambda-js) | install test on Node 18 — new | pending | both | | ||
| | dd-trace resolves to v5 on Node 18 (`package.json` carries the v6 line) | shim:`scripts/install_deps.sh` + `scripts/dd_trace_versions.sh` | L1 (datadog-lambda-js) | install test on Node 18 — new | ported | both | |
There was a problem hiding this comment.
| | dd-trace resolves to v5 on Node 18 (`package.json` carries the v6 line) | shim:`scripts/install_deps.sh` + `scripts/dd_trace_versions.sh` | L1 (datadog-lambda-js) | install test on Node 18 — new | ported | both | | |
| | npm package works on Node 18/20 with customer-installed dd-trace v5 | shim:`package.json` + packed npm artifact | L1 (datadog-lambda-js) | packed-tarball install test on Node 18 and 20 — new | pending | both | |
To be more precise, keeping it pending here because install_deps.sh only implements build/layer selection, it does not establish or test npm customer resolution yet...
…ting v20+ local development
Three conflicts, all resolved as unions of both sides: - src/handler.mjs: main (#819) moved the ESM loader-hook registration out of handler.mjs into initTracer() in src/runtime/module_importer.js, so this branch's copy of esmLoaderAlreadyRegistered() and the Module.register() block are dropped in favor of main's. Kept this branch's new DD_TRACE_STARTUP_LOGS default. dd-trace 6.12.0 ships both register.js and loader-hook.mjs, so main's registration path works on the v6 line. - integration_tests/container/cjs/Dockerfile: kept this branch's DD_TRACE_VERSION build-arg + `npm pkg set` override alongside main's `COPY package.json *.js` for the new manual-wrap fixture handlers. - integration_tests/container/cjs/package.json: main's axios pin plus this branch's dd-trace 6.12.0. main's integration_tests_local/run.sh already probes for scripts/install_deps.sh and scripts/dd_trace_versions.sh and passes --build-arg DD_TRACE_VERSION, so the new local harness picks up the per-runtime tracer split without changes. Verified: yarn build, yarn test (638 tests, 52 suites — including main's new src/handler.spec.ts and src/runtime/module-importer.spec.ts), yarn lint and yarn check-formatting all pass against dd-trace 6.12.0. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
What does this PR do?
Motivation
Testing Guidelines
Additional Notes
Types of Changes
Check all that apply