The Node.js integration allows you to collect and monitor your Node.js application logs, traces, and custom metrics.
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.
Install hot-shots with npm:
npm install hot-shots
Start instrumenting your code:
var StatsD = require('hot-shots'); var dogstatsd = new StatsD(); // Increment a counter. dogstatsd.increment('page.views')
See the dedicated documentation for instrumenting your Node.js application for sending traces to Datadog.
Available for Agent v6.0+
See the dedicated documentation to set up Node.js log collection for forwarding your logs to Datadog.
Need help? Contact Datadog support.
Additional helpful documentation, links, and articles:
On this Page