- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
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.
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
tracer.dogstatsd.increment('page.views');
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:
DD_DOGSTATSD_HOSTNAME=localhost DD_DOGSTATSD_PORT=8125 node app.js
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.
See the dedicated documentation for enabling the Node.js profiler.
Need help? Contact Datadog support.