quipo / statsd

Golang StatsD client
MIT License
164 stars 51 forks source link

RetainKeys, Recycling Connections, Buffered Sends, More BufferedTimer stats #8

Open wyndhblb opened 9 years ago

wyndhblb commented 9 years ago

1) more stats to timers 2) RetainKeys options for Buffer client to keep send stats even if they are 0 3) send stats in many lines (not one connection per line) 4) Add "Reset" to events (to deal with retain keys) 5) Add a NoOp client for easy switching when there is no statsd in your land 6) ReCycleConnection for buffered client to close connections after sending (in order to pick up and new IPs)

quipo commented 8 years ago

hi Wyndham, I've cherry-picked a few changes (e.g. the NoOp client), can you update the PR with the current version? Also, can you add a few more comments about the proposed functionality? Thanks.

wyndhblb commented 8 years ago

Hi .. been a while. Sorry about that.

The "RetainKeys" option lets the emitter send "0"s for keys that have not gotten any metrics in the flush window (for a buffered client anyways). This is not something that one typically wants by default. But sometimes "0" is better then "null" in which ever metric|alerting system one is using. It means things things are still running, but nothing is happening rather then the service is dead. Thus the "Reset" is added to 0 out keys rather then simply remove them. This is sort of like the deleteIdleStats setting in statsd itself. That particular setting is not a good thing for consistent hashed setups, but if the origin can keep sending the keys it is ok.

The RecycleConnections is for systems that constantly have moving targets based on DNS names. Otherwise things will hold on to the old original IP addr until the app is restarted. Which helps when migrating the backend systems to new systems non-destructively.