The Service Map for APM is here!

Tracing Node.js Applications

Installation And Getting Started

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

For details about configuration and using the API, see Datadog’s API documentation.

For details about contributing, check out the development guide.

Quickstart

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.

You must import and initialize the tracer library in an external file and then import that file as a whole when building your application with a transpiler. This prevents hoisting and ensures that the tracer library gets imported and initialized before importing any other instrumented module.

Compatibility

Node ^4.7, ^6.9 and >=8 are supported by this library. However, it benefits significantly from the performance improvements introduced in Node >=8.3.

Integrations

APM provides out-of-the-box instrumentation for many popular frameworks and libraries by using a plugin system. If you would like support for a module that is not listed, contact support to share a request.

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

Web Framework Compatibility

Module Versions Support Type Notes
express 4 Fully Supported Supports Sails, Loopback, and more
graphql 0.13 Fully Supported
hapi ^17.1 Fully Supported
koa 2 Fully Supported
restify 7 Fully Supported

Native Module Compatibility

Module Support Type
http Fully Supported
https Fully Supported

Data Store Compatibility

Module Versions Support Type Notes
cassandra-driver Coming Soon
elasticsearch 15 Fully Supported
ioredis 4 Fully Supported
memcached ^2.2 Fully Supported
mongodb-core 3 Fully Supported Supports Mongoose
mysql 2 Fully Supported
mysql2 ^1.5 Fully Supported
pg 6 - 7 Fully Supported
redis ^2.6 Fully Supported

Worker Compatibility

Module Versions Support Type Notes
amqp10 3 Fully Supported Supports AMQP 1.0 brokers (i.e. ActiveMQ, Apache Qpid)
amqplib 0.5 Fully Supported Supports AMQP 0.9 brokers (i.e. RabbitMQ, Apache Qpid)
kafka-node Coming Soon
rhea Coming Soon

Further Reading