DataDog / datadog-go

go dogstatsd client library for datadog
MIT License
353 stars 132 forks source link

client.addrOption remains unset when using default DD_AGENT_HOST #313

Closed JC-Jiang closed 3 months ago

JC-Jiang commented 4 months ago

Reproduce steps

// export DD_AGENT_HOST=whatever
client, err := statsd.New("", opts)
cloned, err := statsd.CloneWithExtraOptions(client, ...)

observe an error can't clone client with no addrOption

In the New function, createWriter resolves the address in the function but it does not get set to the addOption in the client. It made the client not cloneable