Join us at the Dash conference! July 16-17, NYC

NodeJS

Library Library

Overview

Connect your Node.js applications to Datadog to:

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

Setup

Configuration

Metric collection

The Node.js integration enables you to monitor a 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, 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 6+

To log from your Node.js application, it is recommended that you use Winston. You are strongly encouraged to set up your logging libraries to produce your logs in JSON format to avoid having to maintain custom parsing rules.

Follow Datadog’s Node.js logging guide to start forwarding your logs.

Validation

Metrics appear in the metrics explorer page.

Data Collected

Metrics

The Node.js integration does not include any metrics.

Events

The Node.js integration does not include any events.

Service Checks

The Node.js integration does not include any service checks.

Troubleshooting

Need help? Contact Datadog support.