- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
After you set up the tracing library with your code and configure the Agent to collect APM data, optionally configure the tracing library as desired, including setting up Unified Service Tagging.
Tracer settings can be configured with the following environment variables:
DD_ENV
env
prod
, pre-prod
, and stage
).DD_SERVICE
service
name
field in package.json
DD_VERSION
version
version
field in package.json
It is recommended that you use DD_ENV
, DD_SERVICE
, and DD_VERSION
to set env
, service
, and version
for your services. Review the Unified Service Tagging documentation for recommendations on configuring these environment variables.
DD_TRACE_ENABLED
true
false
disables all features of the library.DD_TRACE_DEBUG
false
DD_TRACING_ENABLED
true
DD_TRACE_RATE_LIMIT
rateLimit
100
when DD_TRACE_SAMPLE_RATE
is set. Otherwise, delegates rate limiting to the Datadog Agent.
The maximum number of traces per second per service instance.DD_TRACE_HEADER_TAGS
headerTags
http.request.headers.<header-name>
for requests and http.response.headers.<header-name>
for responses. Note: This option is only supported for HTTP/1.User-ID:userId,Request-ID
User-ID
, its value is applied as tag userId
to the spans produced by the service.Request-ID
, its value is applied as tag http.request.headers.Request-ID
for requests and http.response.headers.Request-ID
for responses.DD_TRACE_SAMPLE_RATE
sampleRate
DD_TRACE_SAMPLE_RATE
is deprecated in favor of DD_TRACE_SAMPLING_RULES
.DD_TRACE_SAMPLING_RULES
samplingRules
[]
sample_rate
value between 0.0 and 1.0 (inclusive). Each rule has optional name
and service
fields, which are regex strings to match against a trace’s service
and name
. Rules are applied in configured order to determine the trace’s sample rate. If omitted, the tracer defers to the Agent to dynamically adjust sample rate across all traces.DD_SERVICE_MAPPING
serviceMapping
mysql:my-mysql-service-name-db,pg:my-pg-service-name-db
plugin:service-name
pairs, with or without spaces.flushInterval
2000
DD_TRACE_PARTIAL_FLUSH_MIN_SPANS
flushMinSpans
1000
DD_TRACE_OBFUSCATION_QUERY_STRING_REGEXP
http.url
tag (matches are replaced with <redacted>
). Can be an empty string to disable redaction or .*
to redact all query string. WARNING: This regex executes for every incoming request on an unsafe input (url) so make sure you use a safe regex.DD_TRACE_CLIENT_IP_HEADER
http.client_ip
tag from.lookup
require('dns').lookup
DD_TRACE_AGENT_PROTOCOL_VERSION
protocolVersion
0.4
DD_TRACE_REPORT_HOSTNAME
reportHostname
false
DD_TRACE_STARTUP_LOGS
startupLogs
false
DD_SPAN_SAMPLING_RULES
spanSamplingRules
[]
sample_rate
value must be between 0.0 and 1.0 (inclusive).
For more information, see Ingestion Mechanisms.my-service
and operation name http.request
, up to 50 traces per second: '[{"service": "my-service", "name": "http.request", "sample_rate":0.5, "max_per_second": 50}]'
DD_SPAN_SAMPLING_RULES_FILE
DD_SPAN_SAMPLING_RULES
takes precedence over this variable. See DD_SPAN_SAMPLING_RULES
for the rule format.DD_TRACE_DISABLED_PLUGINS
DD_TRACE_DISABLED_PLUGINS=express,dns
experimental
{}
true
. Contact Support to learn more about the available experimental features.plugins
true
DD_TAGS
tags
{}
key:value,key:value
. When setting this programmatically, the format is tracer.init({ tags: { foo: 'bar' } })
.DD_TRACE_AGENT_URL
url
http://localhost:8126
receiver_port
or DD_APM_RECEIVER_PORT
to something other than the default 8126
, then DD_TRACE_AGENT_PORT
or DD_TRACE_AGENT_URL
must match it. Supports Unix Domain Sockets in combination with the apm_config.receiver_socket
in your datadog.yaml
file, or the DD_APM_RECEIVER_SOCKET
environment variable.DD_TRACE_AGENT_HOSTNAME
hostname
localhost
DD_TRACE_AGENT_PORT
port
8126
receiver_port
or DD_APM_RECEIVER_PORT
to something other than the default 8126
, then DD_TRACE_AGENT_PORT
or DD_TRACE_AGENT_URL
must match it.DD_DOGSTATSD_PORT
dogstatsd.port
8125
dogstatsd_port
or DD_DOGSTATSD_PORT
to something other than the default 8125
, then this tracing library DD_DOGSTATSD_PORT
must match it.DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS
remoteConfig.pollInterval
DD_APPSEC_ENABLED
appsec.enabled
false
DD_APPSEC_RULES
appsec.rules
DD_APPSEC_WAF_TIMEOUT
appsec.wafTimeout
5000
DD_APPSEC_OBFUSCATION_PARAMETER_KEY_REGEXP
appsec.obfuscatorKeyRegex
DD_APPSEC_OBFUSCATION_PARAMETER_VALUE_REGEXP
appsec.obfuscatorValueRegex
DD_DBM_PROPAGATION_MODE
dbmPropagationMode
'disabled'
'service'
or 'full'
. The 'service'
option enables the connection between DBM and APM services. The 'full'
option enables connection between database spans with database query events. Available for Postgres.DD_LOGS_INJECTION
logInjection
false
DD_TRACE_LOG_LEVEL
logLevel
debug
error
, debug
.DD_TRACE_OTEL_ENABLED
undefined
true
, OpenTelemetry-based tracing for custom instrumentation is enabled.DD_PROFILING_ENABLED
profiling
false
DD_RUNTIME_METRICS_ENABLED
runtimeMetrics
false
8125
(or configured with DD_DOGSTATSD_PORT
) must be opened on the Agent for UDP.For information about valid values and using the following configuration options, see Propagating Node.js Trace Context.
DD_TRACE_PROPAGATION_STYLE_INJECT
tracePropagationStyle.inject
Datadog,tracecontext
DD_TRACE_PROPAGATION_STYLE_EXTRACT
tracePropagationStyle.extract
Datadog,tracecontext
DD_TRACE_PROPAGATION_STYLE
tracePropagationStyle
Datadog,tracecontext
DD_TRACE_PROPAGATION_STYLE_INJECT
and DD_TRACE_PROPAGATION_STYLE_EXTRACT
configurations take priority when present.For more examples of how to work with the library see API documentation.