Skip to content

Commit a9b8e12

Browse files
mx-psiXinRanZhAWS
authored andcommitted
[chore][exporter/datadog] Improve documentation for hostname and host_metadata::hostname_source settings (open-telemetry#31702)
**Description:** Improves documentation on the `hostname` and `host_metadata::hostname_source` settings based on feedback from open-telemetry#29866 **Link to tracking Issue:** Fixes open-telemetry#29866
1 parent cdf99ce commit a9b8e12

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

exporter/datadogexporter/config.go

+11-3
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,12 @@ type LogsConfig struct {
319319
// TagsConfig defines the tag-related configuration
320320
// It is embedded in the configuration
321321
type TagsConfig struct {
322-
// Hostname is the host name for unified service tagging.
323-
// If unset, it is determined automatically.
322+
// Hostname is the fallback hostname used for payloads without hostname-identifying attributes.
323+
// This option will NOT change the hostname applied to your metrics, traces and logs if they already have hostname-identifying attributes.
324+
// If unset, the hostname will be determined automatically. See https://docs.datadoghq.com/opentelemetry/schema_semantics/hostname/?tab=datadogexporter#fallback-hostname-logic for details.
325+
//
326+
// Prefer using the `datadog.host.name` resource attribute over using this setting.
327+
// See https://docs.datadoghq.com/opentelemetry/schema_semantics/hostname/?tab=datadogexporter#general-hostname-semantic-conventions for details.
324328
Hostname string `mapstructure:"hostname"`
325329
}
326330

@@ -365,11 +369,15 @@ type HostMetadataConfig struct {
365369
Enabled bool `mapstructure:"enabled"`
366370

367371
// HostnameSource is the source for the hostname of host metadata.
372+
// This hostname is used for identifying the infrastructure list, host map and host tag information related to the host where the Datadog exporter is running.
373+
// Changing this setting will not change the host used to tag your metrics, traces and logs in any way.
374+
// For remote hosts, see https://docs.datadoghq.com/opentelemetry/schema_semantics/host_metadata/.
375+
//
368376
// Valid values are 'first_resource' and 'config_or_system':
369377
// - 'first_resource' picks the host metadata hostname from the resource
370378
// attributes on the first OTLP payload that gets to the exporter.
371379
// If the first payload lacks hostname-like attributes, it will fallback to 'config_or_system'.
372-
// Do not use this hostname source if receiving data from multiple hosts.
380+
// **Do not use this hostname source if receiving data from multiple hosts**.
373381
// - 'config_or_system' picks the host metadata hostname from the 'hostname' setting,
374382
// If this is empty it will use available system APIs and cloud provider endpoints.
375383
//

exporter/datadogexporter/examples/collector.yaml

+13-4
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,12 @@ exporters:
171171
# The Datadog exporter is necessary for exporting telemetry signals to Datadog.
172172
datadog:
173173
## @param hostname - string - optional
174-
## A custom hostname.
175-
## If unset, this will be determined automatically if possible.
174+
## The fallback hostname used for payloads without hostname-identifying attributes.
175+
## This option will NOT change the hostname applied to your metrics, traces and logs if they already have hostname-identifying attributes.
176+
## If unset, the hostname will be determined automatically. See https://docs.datadoghq.com/opentelemetry/schema_semantics/hostname/?tab=datadogexporter#fallback-hostname-logic for details.
177+
##
178+
## Prefer using the `datadog.host.name` resource attribute over using this setting.
179+
## See https://docs.datadoghq.com/opentelemetry/schema_semantics/hostname/?tab=datadogexporter#general-hostname-semantic-conventions for details.
176180
#
177181
# hostname: customhostname
178182

@@ -373,8 +377,9 @@ exporters:
373377
## Host metadata specific configuration.
374378
## Host metadata is the information used for populating the infrastructure list, the host map and providing host tags functionality within the Datadog app.
375379
##
376-
## The exporter will only send host metadata for a single host, whose name is chosen
380+
## By default, the exporter will only send host metadata for a single host, whose name is chosen
377381
## according to `host_metadata::hostname_source`.
382+
## See https://docs.datadoghq.com/opentelemetry/schema_semantics/host_metadata/ to send host metadata about more hosts.
378383
#
379384
# host_metadata:
380385
## @param enabled - boolean - optional - default: true
@@ -384,10 +389,14 @@ exporters:
384389

385390
## @param hostname_source - enum - optional - default: config_or_system
386391
## Source for the hostname of host metadata.
392+
## This hostname is used for identifying the infrastructure list, host map and host tag information related to the host where the Datadog exporter is running.
393+
## Changing this setting will not change the host used to tag your metrics, traces and logs in any way.
394+
## For remote hosts, see https://docs.datadoghq.com/opentelemetry/schema_semantics/host_metadata/.
395+
##
387396
## Valid values are 'first_resource' and 'config_or_system':
388397
## - 'first_resource' picks the host metadata hostname from the resource attributes on the first OTLP payload that gets to the exporter.
389398
## If the first payload lacks hostname-like attributes, it will fallback to 'config_or_system' behavior.
390-
## Do not use this hostname source if receiving data from multiple hosts.
399+
## **Do not use this hostname source if receiving data from multiple hosts**.
391400
##
392401
## - 'config_or_system' picks the host metadata hostname from the 'hostname' setting, falling back to system and cloud provider APIs.
393402
##

0 commit comments

Comments
 (0)