Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement tags in Statsd backend creating additional metrics #21

Open
jruere opened this issue May 14, 2017 · 3 comments
Open

Implement tags in Statsd backend creating additional metrics #21

jruere opened this issue May 14, 2017 · 3 comments

Comments

@jruere
Copy link
Contributor

jruere commented May 14, 2017

Would it make sense that for a given metric A, using tags, to create additional metrics for each tag?

For example, for calls:

incr('A')
incr('A', tags=dict(tag1=value1, tag2=value2))
incr('A', tags=dict(tag2=value2))

It would generate metrics:

  • A.count = 3
  • A.tagged.tag1.value1.count = 1
  • A.tagged.tag2.value2.count = 2
@willkg
Copy link
Contributor

willkg commented May 15, 2017

This sounds interesting.

Maybe we should make it an optional behavior? If we did that, then maybe the statsd backend has an option "convert_tags_to_keys" which when False would ignore tags and when True would do what you're doing above.

Maybe we need to either constrain or convert values so that they conform to appropriate keys?

Maybe it makes sense to send all the combinations? So:

incr('A', tags=dict(tag1=value1, tag2=value2)

would actually send:

  • A.tagged.tag1.value1.count = 1
  • A.tagged.tag2.value2.count = 1
  • A.tagged.tag1.value1.tag2.value2.count = 1

That gets kind of crazy with more than 2 tags, but it would let you graph tags independent of one another.

Maybe it helps to step back and figure out the use cases here? If someone is using the statsd backend, what would they be using tags for and what does the generated data need to look like in order for it to be useful?

@jruere
Copy link
Contributor Author

jruere commented May 15, 2017 via email

@willkg
Copy link
Contributor

willkg commented Aug 22, 2018

@jsocol (maintainer of statsd) pointed to this:

https://statsd.readthedocs.io/en/latest/tags.html

We should take that into account when figuring out what to do here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants