-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
StatsD set doesn't accept a string #2068
Comments
can you provide and example of a common statsd server that accepts strings for sets? |
the "statsd spec" specifies values as only being integer or float: https://github.com/b/statsd_spec#metric-types--formats |
We just ran up against this as well. Etsy's implementation accepts strings: |
@sparrc I haven't use any other StatsD except the one from I haven't used any other StatsD server except etsy statsd and telegraf. I found the need of counting string in a set is pretty reasonable. People use ElasticSearch or MongoDB as main storage usually will not have an integer id, but an UUID(which is a string) instead. We can try some tip to hash/encode the UUID into an integer but that's a hack and add confusing to the code. I imagine it isn't that hard to support string. I can take a look and submit a PR if this is something can be consider a feature to be merged. |
I think the best way to do this would be to simply treat all "set" keys as strings, since the actual value doesn't matter, all that matters is it's uniqueness (ie, "1" == 1) |
I think treating all set keys as strings is reasonable. The Etsy implementation is JavaScript where |
Bug report
Relevant telegraf.conf:
System info:
StatsD config:
Steps to reproduce:
test:a123b|s
Error: parsing value to int64: test:a123b|s
. No data is inserted into InfluxDBExpected behavior:
Data is flushed into InfluxDB.
test
should be create and increase value by 1Actual behavior:
No data is created. Log shows error.
Additional info:
[Include gist of relevant config, logs, etc.]
Proposal:
Current behavior:
Desired behavior:
Use case: [Why is this important (helps with prioritizing requests)]
I want to count unique user id of a MongoDB instance. The ObjectID is string. Rightnow I have to convert MongoDB ObjectID into a number.
The text was updated successfully, but these errors were encountered: