github / brubeck

A Statsd-compatible metrics aggregator
MIT License
1.19k stars 94 forks source link

Gauges behavior #64

Closed ipeacocks closed 6 years ago

ipeacocks commented 6 years ago

According to original Statsd:

If the gauge is not updated at the next flush, it will send the previous value. You can opt to send no metric at all for this gauge, by setting config.deleteGauges

https://github.com/etsy/statsd/blob/master/docs/metric_types.md#gauges

As I can see Brubeck by default doesn't send previous value if no data. Is it bug or feature? Do you have an option for changing that?

ipeacocks commented 6 years ago

It was my bad. Gauges are fine there.

forward32 commented 5 years ago

@ipeacocks how did you solve it? I am in the same situation, brubeck sends my value just once.

ipeacocks commented 5 years ago

Sorry, but I dont remember.

degtyaryov commented 5 years ago

I also ran into this problem.

In the config exists expire parameter. The documentation about it does not say anything.

This parameter indicates time expire gauge in seconds.

HTTP Endpoint GET /metric/{{metric_name}} displays status expire.

My /etc/brubeck.conf

{
  "sharding" : false,
  "server_name" : "brubeck",
  "dumpfile" : "./brubeck.dump",
  "capacity" : 15,
  "expire" : 1800,
  "http" : ":8080",

  "backends" : [
    {
      "type" : "carbon",
      "address" : "localhost",
      "port" : 2003,
      "frequency" : 10
    }
  ],

  "samplers" : [
    {
      "type" : "statsd",
      "address" : "0.0.0.0",
      "port" : 8125,
      "workers" : 3,
      "multisock" : true,
      "multimsg" : 1
    }
  ]
}

This working for me. Gauges send 30 minute.