Skip to content

[BUG] Non-string slice settings (e.g. network_config.dns_monitoring_ports) cannot be set via environment variables #50662

@sdwa0

Description

@sdwa0

Agent version

7.78.x and earlier

Bug Report

Settings whose default is a non-string slice ([]int, []uint16, …) cannot be populated through env vars. The variable is read, but decoding doesn't happen as expected.

As a side note, there is some misleading documentation, such as this, which incorrectly suggests otherwise.

Reproduction Steps

Let's take this system probe config: network_config.dns_monitoring_ports (defaults to []int{53}).

Try to override the default with this environment variable: DD_NETWORK_CONFIG_DNS_MONITORING_PORTS="53 5353".

The expected configuration outcome is []int{53, 5353}, but the actual outcome is the string "53 5353" as is. Neither a comma nor a space as a separator works. A single value does work.

Agent configuration

No response

Operating System

No response

Other environment details

No response

Metadata

Metadata

Assignees

Labels

oss/0External contributions priority 0pendingLabel for issues waiting a Datadog member's response.team/agent-configuration

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions