Logging is here!

Tracing JavaScript Applications

JavaScript APM is currently in beta.

Getting Started

For descriptions of terminology used in APM, take a look at the official documentation.

For details about configuration and using the API, check out our API documentation.

For details about contributing, check out the development guide.


Node 4.7 is the minimum version supported by this library. However, it benefits significantly from the performance improvements introduced in Node 8.3+.


To begin tracing Node.js applications, first install and configure the Datadog Agent (see additional documentation for tracing Docker applications).

Next, install the Datadog Tracing library using npm:

npm install --save dd-trace

Finally, import and initialize the tracer:

// This line must come before importing any instrumented module.
const tracer = require('dd-trace').init()

See the tracer settings for the list of initialization options.

Note: The tracer must be initialized before importing any instrumented module.

Manual Instrumentation

If you aren’t using supported library instrumentation (see Compatibility), you may want to manually instrument your code.

The following example initializes a Datadog Tracer and creates a Span called web.request:

const tracer = require('dd-trace').init()

  .trace('web.request', {
    service: 'my_service'
  .then(span => {
    span.setTag('my_tag', 'my_value')

For more information on manual instrumentation, check out the API documentation.

Tracer Settings

Debug Mode

Debug mode is disabled by default, to enable it:

const tracer = require('dd-trace').init({
  debug: true

For more tracer settings, check out the API documentation.

Distributed Tracing

Distributed tracing allows you to propagate a single trace across multiple services, so you can see performance end-to-end.

Distributed tracing is enabled by default for all supported integrations.


APM provides out-of-the-box instrumentation for many popular frameworks and libraries by using a plugin system.

For details about how to how to toggle and configure plugins, check out the API documentation.


The dd-trace library includes support for a number of modules. If you would like support for a module that is not listed, contact support to share a request.

Web Frameworks

Module Versions Support Type
express 4.x Beta
graphql 0.13.x Beta
hapi Coming Soon
koa Coming Soon
restify Coming Soon

Native Modules

Module Support Type
http Beta
https Beta

Data Stores

Module Versions Support Type
elasticsearch 15.x Beta
ioredis Coming Soon
mongodb-core 3.x Beta
mysql 2.x Beta
mysql2 ^1.5 Beta
pg 6.x Beta
redis ^2.6 Beta


Module Versions Support Type Notes
amqplib 0.5.x Experimental Known Limitations

Further Reading