brubeck icon indicating copy to clipboard operation
brubeck copied to clipboard

Negative gauge values

Open Evertras opened this issue 8 years ago • 1 comments

Right now sending the following values...

val:-1|g val:-1|g val:-1|g

...in a flush cycle will output a final value of -3. But since this is a gauge, it's expected to be -1. This appears to be due to the following code:

https://github.com/github/brubeck/blob/master/src/samplers/statsd.c#L105

https://github.com/github/brubeck/blob/master/src/metric.c#L48

There seem to be some statsd aggregators that support negative gauges and some that do not. What is brubeck's stance, and what would be the best recommended way to get this functionality from brubeck? Maybe a runtime configuration switch to remove relative values from gauges altogether?

Evertras avatar Jul 22 '16 23:07 Evertras

Unfortunately this is actually the correct behavior according to statsd: https://github.com/etsy/statsd/blob/master/docs/metric_types.md#gauges

This implies you can't explicitly set a gauge to a negative number without first setting it to zero.

alindeman avatar Oct 29 '16 19:10 alindeman