uber-archive / node-statsd-client

Node.js client for statsd
ISC License
28 stars 9 forks source link

Implement cardinality check. #27

Open Raynos opened 9 years ago

Raynos commented 9 years ago

This adds an opt-in cardinality checker to the statsd client.

It will report a gauge of all the unique stats key that it has seen locally within the process.

When deployed in production you would expect this to increase over time and then plateau.

This stats allows you to detect the cardinality of the stats you are publishing to statsd. If this increases sharply or exponentially then you know that you might be publishing unique keys (or uuids) to statsd.

Generaly you want to keep the cardinality to some sensible finite number.

This can be used in production to alert on leaks in your statsd key space.

As an added bonus it counts keys in memory; this means you can REPL into your process and inspect the current list of keys on the statsdClient instance.

r: @Matt-Esch @markyen @robskillington

iproctor commented 9 years ago

lgtm

Raynos commented 9 years ago

@markyen I addressed feedback.

markyen commented 9 years ago

lgtm :shipit: