dogstatsd-rs
dogstatsd-rs copied to clipboard
Cache name resolution
We currently perform name resolution on every metric that is sent.
This pull request moves name resolution into the Options
constructor. One consequence of this change is Options::new
is now fallible, so this PR will introduce a breaking API change.
I love the idea, but currently this introduces a new failure mode for long-lived clients if a DNS record they're sending metrics to rotates IPs, as is common in cloud providers like AWS. I think we probably need to either re-resolve the record on a NotConnected error, or provide a way for the client to be refreshed so users can do that on their own