alexcesaro/statsd

Metric-specific tags

Taik opened this issue · 1 comments

Taik commented

Hey there; I wanted to know if there's any plans for metric-specific tags.

Since conn{} functions already accept tags as string, we can just expose this via a tags... string option to each metric type.

For example:

func (c *Client) Histogram(bucket string, value interface{}, tags... string) {
    if c.skip() {
        return
    }
        tags := // Join c.tags with tags
    c.conn.metric(c.prefix, bucket, value, "h", c.rate, tags)
}

Let me know what you think.

You should use the Clone method and customize the cloned client with the options you want.

The cloned client share the same connection so you can create as many clone as you want.