The Service Map for APM is here!

NodeJS

Crawler Crawler
Node JS graph

Overview

Connect your Node.js applications to Datadog to:

  • Visualize their performance
  • Correlate their performance with the rest of your applications
  • Monitor any relevant metric

Setup

Configuration

Metric collection

The Node.js integration enables you to monitor any custom metric by instrumenting a few lines of code. For instance, you can have a metric that returns the number of page views or the time of any function call. Instrumentation can be implemented using hot-shots, an open source DogStatsD client for node.js. For additional information about the Node.js integration, please refer to this guide on submitting metrics

  1. Install hot-shots with npm:
npm install hot-shots
  1. Start instrumenting your code:
var StatsD = require('hot-shots');
var dogstatsd = new StatsD();

// Increment a counter.
dogstatsd.increment('page.views')

Log Collection

Available for Agent v>6.0

To log from your NodeJS application, we recommends to use Winston. We also strongly encourage you to setup your logging libraries to produce your logs in JSON format to avoid sustaning custom parsing rules.

Follow our NodeJS logging guide to start forwarding your logs to Datadog.

Validation

Go to the Metrics explorer page and see that it just works!

Data Collected

Metrics

The node integration does not include any metric at this time.

Events

The node integration does not include any event at this time.

Service Checks

The node integration does not include any service check at this time.

Troubleshooting

Need help? Contact Datadog Support.