wolph / python-statsd

Python Client for the Etsy NodeJS Statsd Server
http://readthedocs.org/docs/python-statsd/en/latest/
BSD 3-Clause "New" or "Revised" License
110 stars 39 forks source link

Sending gauges with negative values #40

Closed htch closed 8 years ago

htch commented 9 years ago

Hi and thanks for this project

There is a bit of a pitfail with gauges in statsd: if you send a number with a sign (any sign), statsd will add/subtract the value instead of setting it. Say, if you send a metric with "-1" over time, graphite (or whatever is that that your statsd is configured to work with) will draw a downward trend, which isn't expected/intuitive behaviour at all. The user is going to have to go and find this special case in the statsd docs. I propose that a new method will be added to statsd.Gauge to set the metric value no matter the sign. What do you think?

landscape-bot commented 9 years ago

Code Health Code quality remained the same when pulling b5b9e18 on htch:master into c629b3e on WoLpH:master.

wolph commented 8 years ago

My apologies, it seems I missed this pull request completely.

Great fix, thank you very much @htch!