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

Implement cardinality check.

Open Raynos opened this issue 9 years ago • 3 comments

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

Raynos avatar May 28 '15 01:05 Raynos

lgtm

iproctor avatar May 28 '15 18:05 iproctor

@markyen I addressed feedback.

Raynos avatar May 28 '15 18:05 Raynos

lgtm :shipit:

markyen avatar May 28 '15 19:05 markyen