Skip to content

Commit

Permalink
[chore][exporter/datadog] Improve documentation for hostname and host…
Browse files Browse the repository at this point in the history
…_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
  • Loading branch information
mx-psi authored and DougManton committed Mar 13, 2024
1 parent f846c5a commit 26c3b6f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
14 changes: 11 additions & 3 deletions exporter/datadogexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,12 @@ type LogsConfig struct {
// TagsConfig defines the tag-related configuration
// It is embedded in the configuration
type TagsConfig struct {
// Hostname is the host name for unified service tagging.
// If unset, it is determined automatically.
// Hostname is the fallback hostname used for payloads without hostname-identifying attributes.
// This option will NOT change the hostname applied to your metrics, traces and logs if they already have hostname-identifying attributes.
// If unset, the hostname will be determined automatically. See https://docs.datadoghq.com/opentelemetry/schema_semantics/hostname/?tab=datadogexporter#fallback-hostname-logic for details.
//
// Prefer using the `datadog.host.name` resource attribute over using this setting.
// See https://docs.datadoghq.com/opentelemetry/schema_semantics/hostname/?tab=datadogexporter#general-hostname-semantic-conventions for details.
Hostname string `mapstructure:"hostname"`
}

Expand Down Expand Up @@ -365,11 +369,15 @@ type HostMetadataConfig struct {
Enabled bool `mapstructure:"enabled"`

// HostnameSource is the source for the hostname of host metadata.
// 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.
// Changing this setting will not change the host used to tag your metrics, traces and logs in any way.
// For remote hosts, see https://docs.datadoghq.com/opentelemetry/schema_semantics/host_metadata/.
//
// Valid values are 'first_resource' and 'config_or_system':
// - 'first_resource' picks the host metadata hostname from the resource
// attributes on the first OTLP payload that gets to the exporter.
// If the first payload lacks hostname-like attributes, it will fallback to 'config_or_system'.
// Do not use this hostname source if receiving data from multiple hosts.
// **Do not use this hostname source if receiving data from multiple hosts**.
// - 'config_or_system' picks the host metadata hostname from the 'hostname' setting,
// If this is empty it will use available system APIs and cloud provider endpoints.
//
Expand Down
17 changes: 13 additions & 4 deletions exporter/datadogexporter/examples/collector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,12 @@ exporters:
# The Datadog exporter is necessary for exporting telemetry signals to Datadog.
datadog:
## @param hostname - string - optional
## A custom hostname.
## If unset, this will be determined automatically if possible.
## The fallback hostname used for payloads without hostname-identifying attributes.
## This option will NOT change the hostname applied to your metrics, traces and logs if they already have hostname-identifying attributes.
## If unset, the hostname will be determined automatically. See https://docs.datadoghq.com/opentelemetry/schema_semantics/hostname/?tab=datadogexporter#fallback-hostname-logic for details.
##
## Prefer using the `datadog.host.name` resource attribute over using this setting.
## See https://docs.datadoghq.com/opentelemetry/schema_semantics/hostname/?tab=datadogexporter#general-hostname-semantic-conventions for details.
#
# hostname: customhostname

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

## @param hostname_source - enum - optional - default: config_or_system
## Source for the hostname of host metadata.
## 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.
## Changing this setting will not change the host used to tag your metrics, traces and logs in any way.
## For remote hosts, see https://docs.datadoghq.com/opentelemetry/schema_semantics/host_metadata/.
##
## Valid values are 'first_resource' and 'config_or_system':
## - 'first_resource' picks the host metadata hostname from the resource attributes on the first OTLP payload that gets to the exporter.
## If the first payload lacks hostname-like attributes, it will fallback to 'config_or_system' behavior.
## Do not use this hostname source if receiving data from multiple hosts.
## **Do not use this hostname source if receiving data from multiple hosts**.
##
## - 'config_or_system' picks the host metadata hostname from the 'hostname' setting, falling back to system and cloud provider APIs.
##
Expand Down

0 comments on commit 26c3b6f

Please sign in to comment.