statsd-csharp-client icon indicating copy to clipboard operation
statsd-csharp-client copied to clipboard

Support for gauge offset and potential bug with raw metric

Open majkinetor opened this issue 11 years ago • 9 comments

Currently, it looks like there is no option to send offset to gauge, only absolute value. This is supported by statsd with +x, -x notation when number is specified.

BTW, statsd reports the following error when sending raw format:

DEBUG: Bad line: 982,r,1380635905 in msg "test.already.aggregated:982|r|1380635905"

The code used is:

TimeSpan t = DateTime.UtcNow - new DateTime(1970, 1, 1);
int secondsSinceEpoch = (int)t.TotalSeconds;
statsd.LogRaw("test.already.aggregated", 982, secondsSinceEpoch);

It works when I use null instead secondsSinceEpoch

majkinetor avatar Oct 01 '13 14:10 majkinetor

Thanks for the report! I'll take a look in the next few days and feed back.

Sent from my iPhone

On 01 Oct 2013, at 4:02 PM, Miodrag Milic [email protected] wrote:

Currently, it looks like there is no option to send offset to gauge, only absolute value. This is supported by statsd with +x, -x notation when number is specified.

BTW, statsd reports the following error when sending raw format:

DEBUG: Bad line: 982,r,1380635905 in msg "test.already.aggregated:982|r|1380635905" The code used is:

TimeSpan t = DateTime.UtcNow - new DateTime(1970, 1, 1); int secondsSinceEpoch = (int)t.TotalSeconds; statsd.LogRaw("test.already.aggregated", 982, secondsSinceEpoch); It works when I use null instead secondsSinceEpoch

— Reply to this email directly or view it on GitHub.

lukevenediger avatar Oct 01 '13 21:10 lukevenediger

Reworking the sending of gauge values to allow +x and -x will take me some time.

If you use LogRaw without passing in the epoch then it should work. Adding the epoch is allowed when sending metrics to statsd.net, but not statsd.

lukevenediger avatar Oct 30 '13 20:10 lukevenediger

Hi Luke,

Any progress on incrementing / decrementing gauges?

I needed this functionality so implemented it in my fork by adding two new methods to IStatsd:

  • IncrementGague(name, value)

  • DecrementGauge(name, value)

    If you are interested I can send you pull request to integrate it with main repository.

Thanks, Mariusz

mariuszwojcik avatar Oct 02 '14 13:10 mariuszwojcik

@mariuszwojcik If you want to get latest and send a pull request with tests I'll accept it.

niemyjski avatar Apr 14 '15 14:04 niemyjski

Also, why do we need those methods? We could just inspect the value and provide the right call.

niemyjski avatar Apr 14 '15 14:04 niemyjski

@mariuszwojcik, When you get some time, please send a pull request and we'll get this into the library.

niemyjski avatar May 02 '15 12:05 niemyjski

Hey guys — what's the status of this issue? I'm in need of a Gauge with Delta values but didn't want to submit a PR if someone's already working on it . . . thanks!

josheinhorn avatar Sep 29 '15 16:09 josheinhorn

@josheinhorn can you submit a pr for this.

niemyjski avatar Nov 21 '16 11:11 niemyjski

Can you submit a pr for this?

niemyjski avatar Jun 01 '18 13:06 niemyjski