segmentio/stats

add WithName / WithPrefix?

yields opened this issue · 3 comments

Just like we can do:

a = stats.WithTags(stats.Tag{"type", "a"})
a.Incr()
a.Add()
...

It will be nice to have:

eng = stats.NewEngine("worker")
storageeng = eng.WithPrefix("storage") // => all metrics are prefixed with `worker.storage`
processoreng = eng.WithPrefix("processor") // => all metrics are prefixed with `worker.processor`

what do you think?

I'm down man, it makes sense to me.

+1, I found this issue by searching this repo for WithName

PR are welcome 🥇