tracer.trace. This guide covers all breaking changes and the steps to upgrade.
Breaking changes
Node.js version requirement
dd-trace v5 requires Node.js >= 18. If your application runs on Node.js 16, you must upgrade Node.js before upgrading dd-trace. Check your current Node.js version:trace<T> TypeScript signature change
The TypeScript declaration for tracer.trace<T> has been updated to enforce that the callback always receives the span object. Previously the span parameter was technically optional, which was incorrect because the span must always be handled.
Before (v4):
tracer.trace with a zero-argument callback, you must update those call sites to accept the span:
Upgrade steps
Upgrade Node.js to 18 or later
dd-trace v5 requires Node.js 18 or later. Update your runtime before upgrading the package.Verify your version after upgrading:Also update any
.nvmrc, .node-version, Dockerfile, or CI configuration files that pin your Node.js version.Install dd-trace v5
Install the latest version of dd-trace:Or with yarn:Confirm the installed version:
Update tracer.trace TypeScript call sites
If you use TypeScript, search your codebase for calls to
tracer.trace where the callback does not accept a span argument and update them:Version compatibility table
| dd-trace version | Node.js requirement | Status |
|---|---|---|
| v5 (current) | >= 18 | Current |
| v4 | >= 16 | EOL |
| v3 | >= 14 | EOL |
For any issues related to migrating, open an issue on the dd-trace-js GitHub repository or contact Datadog support.
