DataDog / datadogpy

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

Close socket during initialization #808

Closed vickenty closed 8 months ago

vickenty commented 9 months ago

What does this PR do?

Make sure statsd uses socket settings configured in initialize.

Description of the Change

If the global statsd instance is used before initialize() is called (for example, statsd used to send metrics from a top-level of a loaded module), statsd instance will already have a socket open when we set connection parameters. To make sure they take effect, call close_socket().

Alternate Designs

Possible Drawbacks

Verification Process

Additional Notes

Release Notes

Review checklist (to be filled by reviewers)