smira / go-statsd

Go statsd client library with zero allocation overhead, great performance and reconnects
MIT License
109 stars 18 forks source link

Add ability to modify the global tags #38

Open kernel-panic96 opened 5 months ago

kernel-panic96 commented 5 months ago

I would like to be able to make new clients from an existing one, which extended global tags.

client := statsd.NewClient(statsd.DefaultTags(statsd.StringTag("foo", "bar")))

extra := []statsd.Tags{statsd.StringTag("url", "/foo")}
child := client.WithTags(extra...)

child.Incr("counter", 10) // Tags: foo=bar,url=/foo

let me know what you are your thoughts.