Understand the Difference Between the Agent Host and the Tracer Host
Overview
In Datadog APM, the host
tag correlates spans and traces to infrastructure monitoring data, so host metrics are associated with hosts from spans and traces.
Datadog Agent vs. Tracer hostname
The Agent host is the host on which the Datadog Agent is running. The Tracer host is the host on which the application instrumented with the tracing library is running.
The Agent host and the Tracer host may differ based on how you deploy the Datadog Agent on your infrastructure:
When the Agent is deployed on the same host as the application (for example, using a DaemonSet), the Agent host and the Tracer host are the same.
When the Agent is deployed on a remote host, the Agent host is different from the Tracer host.
When are the Tracer and Agent hosts set on spans?
- The Datadog Agent hostname is always set on spans.
- The Tracer hostname is set on spans if
DD_TRACE_REPORT_HOSTNAME
is true
(default is false
).
Language | Config | Environment Variable |
---|
Ruby | tracing.report_hostname | DD_TRACE_REPORT_HOSTNAME |
C++ | dd.trace.report-hostname | DD_TRACE_REPORT_HOSTNAME |
Node.js | reportHostname | DD_TRACE_REPORT_HOSTNAME |
Go | - | DD_TRACE_REPORT_HOSTNAME |
Python | - | DD_TRACE_REPORT_HOSTNAME |
PHP | datadog.trace.report_hostname | DD_TRACE_REPORT_HOSTNAME |
Java | dd.trace.report-hostname | DD_TRACE_REPORT_HOSTNAME |
APM uses host information when you create retention filters, generate metrics from spans, or create sensitive data scanner rules using host tag filters in queries. For example, host tag filters like availability-zone
and cluster-name
are enriched from the Datadog Agent host information.