Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore][exporter/datadog] Improve documentation for hostname and host_metadata::hostname_source settings #31702

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading