Categories
Code Python

Statsd Admin Interface for Python

Here’s a little python class for interacting with the statsd admin interface. I wrote it for EnergyHub, where we used it alongside the nifty pystatsd module to clean up obsolete stats as we rotated our servers. We can delete the obsolete stats, in order to prevent gauges, for example, from reporting their last value until statsd restarts.

It implements the admin commands to list stats: stats, counters, timers, gauges; and the management commands: delcounters, deltimers, delgauges.