markstory/rust-statsd

Metric tags

levkk opened this issue · 3 comments

levkk commented

Hey there,

Thank you for writing this, awesome project!

Curious, should there be support for tagging metrics? I could imagine something like this:

client.incr("some.metric", vec!["service:api"])

or maybe even better:

let client = Client::new("127.0.0.1:8125", "project", vec!["service:api"]).unwrap()

and this would add the tag service with value api to all metrics.

Thanks!

Edit: I think I was confused; tags seem to be a Datadog extension of StatsD, and it's not part of the StatsD spec.

I think I was confused; tags seem to be a Datadog extension of StatsD, and it's not part of the StatsD spec.

Yes, tags are a datadog extension. I think other statsd like servers support tags in a similar way though. I don't have much time to do the research, but if tags are implemented consistently by a few other statsd collectors/servers then I don't see a reason to not implement them here.

@levkk
This forked lib has constant tagging feature.
https://github.com/minato128/rust-dogstatsd

levkk commented

That's amazing, thank you for showing me that @minato128 .

@markstory Thank you! I think at this point it's clearly a Datadog extension of the protocol. That being said, Datadog is pretty popular so might be worth an optional setting or something similar.

All the best!