This document summarizes a StatsD workshop presented by Daniel Schauenberg at Monitorama 2013. The workshop covered what StatsD is, the different types of metrics it can handle, and how to set up and configure StatsD and its backends like Graphite. It also provided examples of sending metrics to StatsD and ideas for extending and customizing StatsD functionality.
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
StatsD Workshop Monitorama 2013
1. StatsD workshop @
Monitorama 2013
Daniel Schauenberg
Software Engineer, Etsy Infrastructure
@mrtazz
Friday, March 29, 13
2. • What is this StatsD?
• Metrics types
• Backends
• Graphite and operating StatsD
• Send all the metrics
• Write all the backends
Friday, March 29, 13
12. Pluggable backends
function MyBackend(startupTime, config, emitter){
var self = this;
this.lastFlush = startupTime;
this.lastException = startupTime;
this.config = config.mybackendconfig || {};
// what to do with metrics
emitter.on('flush', function(timestamp, metrics) {});
// update your status
emitter.on('status', function(callback) {});
// handle raw packet
emitter.on('packet', function(packet, rinfo) {});
};
Friday, March 29, 13
13. Management Interface
> telnet 127.0.0.1 8126
> stats
> counters
> delcounters
> help
Friday, March 29, 13
14. Graphite + StatsD
• default backend
• whisper archives should match flush
interval
• sum aggregation for raw counters
• docs/graphite.md
Friday, March 29, 13
26. Some actual stats
Disk space:
df -m | grep "/var" | awk '{print "diskspace.var:"$4"|g"}'
Apache HTTPD processes:
echo -n "httpd.procs:$(ps aux | grep [h]ttpd | wc -l)|g"
Logfile size:
du -s /var/log/chef.log | awk '{print "cheflog:"$1"|g"}'
Friday, March 29, 13
27. Is this real life?
• Set up a web page
• Have it send stats to StatsD
• page load time
• counters when page was accessed
• look in the examples/ directory for code
Friday, March 29, 13
28. Histograms
• You should have timers now
• Configure histograms for them
• { graphite: { histograms: [] }
Friday, March 29, 13
30. Write a new backend
• Have it HTTP POST to a web server
• write metrics to a file
• send a txt message
• repeat all UDP packets to TCP
Friday, March 29, 13