NodeJS
Datadog's Research Report: The State of Serverless Report: The State of Serverless

NodeJS

Library Library

Overview

The Node.js integration allows you to collect and monitor your Node.js application logs, traces, and custom metrics.

Setup

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
  2. Start instrumenting your code:

    var StatsD = require('hot-shots');
    var dogstatsd = new StatsD();
    
    // Increment a counter.
    dogstatsd.increment('page.views')
    

Trace collection

See the dedicated documentation for instrumenting your Node.js application for sending traces to Datadog.

Log collection

Available for Agent v6.0+

See the dedicated documentation to set up Node.js log collection for forwarding your logs to Datadog.

Troubleshooting

Need help? Contact Datadog support.

Further Reading