go-metrics-graphite icon indicating copy to clipboard operation
go-metrics-graphite copied to clipboard

Resolving Graphite address on each flush operation

Open kamilchm opened this issue 6 years ago • 1 comments

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?

kamilchm avatar Aug 03 '17 11:08 kamilchm

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.

joemiller avatar Sep 02 '17 01:09 joemiller