DataDog / datadogpy

The Datadog Python library
https://datadoghq.com/
Other
612 stars 302 forks source link

Add ipv6 support for dogstatsd #791

Closed vickenty closed 1 year ago

vickenty commented 1 year ago

What does this PR do?

Add IPv6 support for hostnames and literal addresses.

Description of the Change

Call getaddrinfo to parse and resolve an internet address before creating the socket. Try in a loop until one address succeeds.

For backwards compatibility, prefer ipv4 addresses: ipv4-only agent should still work even if hostname (e.g. localhost) resolves to both ipv4 and ipv6 address and ipv6 is preferred by the OS. This also matches behavior of Golang.

Alternate Designs

Possible Drawbacks

Address order specified in gai.conf is ignored, which may lead to inconsistencies with other applications.

Verification Process

Additional Notes

Release Notes

Review checklist (to be filled by reviewers)