dogstatsd-rs icon indicating copy to clipboard operation
dogstatsd-rs copied to clipboard

Cache name resolution

Open haileys opened this issue 4 years ago • 1 comments

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.

haileys avatar Jan 27 '21 07:01 haileys

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

mcasper avatar Jan 27 '21 16:01 mcasper