Skip to main content

The fastest path to observability

dd-trace is Datadog’s APM client library for Node.js. Install it in your application to capture traces, metrics, logs, and more — then visualize everything in Datadog.

Quickstart

Get up and running in under 5 minutes with automatic instrumentation.

Installation

Install dd-trace and configure it for your Node.js environment.

API Reference

Explore the full Tracer API for manual instrumentation.

Integrations

Browse 100+ supported frameworks, databases, and services.

What dd-trace does

dd-trace captures APM data from your Node.js application and sends it to the Datadog Agent, which aggregates and forwards it to Datadog’s backend for visualization, alerting, and analysis.

Distributed Tracing

Trace requests across services with automatic context propagation.

Auto-Instrumentation

100+ plugins for Express, Fastify, PostgreSQL, Redis, and more — zero code changes.

Application Security

Detect and block attacks in real time with AppSec and IAST.

Continuous Profiling

Profile CPU, memory, and wall time in production without overhead.

LLM Observability

Monitor AI/LLM calls with the LLMObs SDK for OpenAI, Anthropic, and more.

CI Visibility

Track test results, detect flaky tests, and optimize CI pipelines.

Supported Node.js versions

Release LineNode.jsStatus
v5 (current)>= 18Active
v4>= 16EOL
v3>= 14EOL
v2>= 12EOL
We recommend using the latest v5 release line. Node.js 18+ is required.

Quick install

npm install dd-trace
Then initialize the tracer before importing any other modules:
server.js
// Must be the very first import
require('dd-trace').init()

// Now import your application code
const express = require('express')
const app = express()
For ESM applications, use the --import dd-trace/register.js flag instead. See the ESM installation guide.

Explore the docs

Getting Started

Learn about dd-trace architecture and core concepts.

Manual Instrumentation

Create custom spans and traces for your business logic.

Configuration Reference

All initialization options and environment variables.

Migration Guide

Upgrade from v4 to v5 with the migration guide.

Build docs developers (and LLMs) love