cyberdelia / go-metrics-graphite

Graphite client for the go-metrics
BSD 2-Clause "Simplified" License
38 stars 34 forks source link

Resolving Graphite address on each flush operation #9

Open kamilchm opened 7 years ago

kamilchm commented 7 years ago

Hi, I wanted to use this library to collect metrics to a infrastructure where Graphite hosts are stored in a DNS. Passing Graphite address as a net.net.TCPAddr means that you can loose future metrics when one of Graphite hosts in cluster will be replaced.

So I've changed Graphite() interface to accept address as a string and use it on each flush operation. https://github.com/cyberdelia/go-metrics-graphite/compare/master...kamilchm:master?expand=1

What do you think about such change?

joemiller commented 7 years ago

We did something similar a while ago - https://github.com/pantheon-systems/go-metrics-graphite/commit/d377c3b32efb31903b3c694fb430eb4c066ecfb4

It would be great to figure out a solution to this. This particular approach might be problematic because it would break existing users that are passing a net.Addr. Not sure how to move forward in a backward-compat way.