atlassian / gostatsd

An implementation of Etsy's statsd in Go with tags support
MIT License
381 stars 99 forks source link

Support float values for Counters #722

Open pawilon opened 1 month ago

pawilon commented 1 month ago

I'm struggling to find an official statsd spec, but my experience suggests some statsd libraries accept floats as Counter values. This is the case for statsite. It works without issues with Graphite backend.

I discovered that gostatsd will instead round float counters to integers, breaking aggregation for apps that assume this will just work.

Using float counters is useful for counting something like a dollar cost of a specific API call. We could potentially use a Timer instead, but:

What do maintainers think about adding float Counters? Does it break anything, or is it mostly transparent to the users? Are there any other options?