이 페이지는 아직 한국어로 제공되지 않으며 번역 작업 중입니다. 번역에 관한 질문이나 의견이 있으시면 언제든지 저희에게 연락해 주십시오.


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


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.

For additional information about the Node.js integration, see the guide on submitting metrics.

// Require dd-trace
const tracer = require('dd-trace').init();

// Increment a counter

Note that for custom metrics to work you need to enable DogStatsD on the Agent. Collection is enabled by default, but the Agent only listens for metrics from localhost. To allow external metrics, you need to either set an environment variable or update the config file:

DD_USE_DOGSTATSD=true # default
DD_DOGSTATSD_PORT=8125 # default
DD_DOGSTATSD_NON_LOCAL_TRAFFIC=true # if expecting external metrics
use_dogstatsd: true # default
dogstatsd_port: 8125 # default
dogstatsd_non_local_traffic: true # if expecting external metrics

You’ll also need to configure your application to use the agent’s DogStatsD collector:


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.

Profile collection

See the dedicated documentation for enabling the Node.js profiler.


Need help? Contact Datadog support.

Further Reading