StatsD Workshop Monitorama 2013

50 %
50 %
Information about StatsD Workshop Monitorama 2013
Technology

Published on April 2, 2013

Author: mrtazz

Source: slideshare.net

Description

StatsD workshop from Monitorama 2013

StatsD workshop @ Monitorama 2013 Daniel Schauenberg Software Engineer, Etsy Infrastructure @mrtazzFriday, March 29, 13

• What is this StatsD? • Metrics types • Backends • Graphite and operating StatsD • Send all the metrics • Write all the backendsFriday, March 29, 13

Friday, March 29, 13

Metrics processing module Receiver loop BackendsFriday, March 29, 13

legacyNamespace: falseFriday, March 29, 13

Counters foo.bar:1|c stats.counters.foo.bar.rate stats.counters.foo.bar.countFriday, March 29, 13

Gauges foo.gar:30|g foo.gar:-5|g foo.gar:+5|g stats.gauges.foo.garFriday, March 29, 13

Sets foo.sar:30|s foo.sar:50|s stats.sets.foo.sarFriday, March 29, 13

Timers foo.tar:30|ms stats.timers.foo.tar.mean_90 stats.timers.foo.tar.std stats.timers.foo.tar.sum_90Friday, March 29, 13

Histograms histogram: [{metric: "foo.tar", bins: [10,20,30,50]}] stats.timers.foo.tar.histogram.bin_10 stats.timers.foo.tar.histogram.bin_20Friday, March 29, 13

Friday, March 29, 13

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

Management Interface > telnet 127.0.0.1 8126 > stats > counters > delcounters > helpFriday, March 29, 13

Graphite + StatsD • default backend • whisper archives should match flush interval • sum aggregation for raw counters • docs/graphite.mdFriday, March 29, 13

The single-thread dilemmaFriday, March 29, 13

Tuning UDP # increase default core memory sizes net.core.rmem_default = 16777216 net.core.wmem_default = 16777216 net.ipv4.udp_wmem_min = 67108864 net.ipv4.udp_rmem_min = 67108864 net.ipv4.udp_mem = 4648512 6198016 9297024Friday, March 29, 13

Sampling • default sampling of 0.1 on all metrics • most sent keys (log file) are sampled 0.01Friday, March 29, 13

Quis monitoret ipsos monitores?Friday, March 29, 13

Friday, March 29, 13

Friday, March 29, 13

Friday, March 29, 13

Friday, March 29, 13

Let’s do thisFriday, March 29, 13

Basic setup • git clone https://github.com/etsy/statsd.git • curl https://gist.github.com/mrtazz/5270376 > test_config.js • nc -k -l 2003 > output.log • node stats.js test_config.jsFriday, March 29, 13

Send some stats > echo -n "foo.bar:1|c" | nc -w0 -u 127.0.0.1 8125 > echo -n "foo.lerl:3|g" | nc -w0 -u 127.0.0.1 8125 > echo -n "foo.lol:33|ms" | nc -w0 -u 127.0.0.1 8125 > echo -n "foo.lol:43|ms" | nc -w0 -u 127.0.0.1 8125 > echo -n "foo.lol:53|ms" | nc -w0 -u 127.0.0.1 8125Friday, March 29, 13

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

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 codeFriday, March 29, 13

Histograms • You should have timers now • Configure histograms for them • { graphite: { histograms: [] }Friday, March 29, 13

Level up!Friday, March 29, 13

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 TCPFriday, March 29, 13

Hackathon ideas • Metrics path validation in backend • Pluggable receiver frontends • Forked backends • Configurable timer metricsFriday, March 29, 13

• #statsd on Freenode IRC • statsd@librelist.com • Ask meFriday, March 29, 13

Basic setup • git clone https://github.com/etsy/statsd.git • curl https://gist.github.com/mrtazz/5270376 > test_config.js • nc -k -l 2003 > output.log • node stats.js test_config.jsFriday, March 29, 13

StatsD workshop @ Monitorama 2013 Daniel Schauenberg Software Engineer, Etsy Infrastructure @mrtazzFriday, March 29, 13

Add a comment

Related presentations

Presentación que realice en el Evento Nacional de Gobierno Abierto, realizado los ...

In this presentation we will describe our experience developing with a highly dyna...

Presentation to the LITA Forum 7th November 2014 Albuquerque, NM

Un recorrido por los cambios que nos generará el wearabletech en el futuro

Um paralelo entre as novidades & mercado em Wearable Computing e Tecnologias Assis...

Microsoft finally joins the smartwatch and fitness tracker game by introducing the...

Related pages

StatsD Workshop Monitorama 2013 // Speaker Deck

Speaker Details. Infrastructure Toolsmith at Etsy. A Cheap Trick and a Cheesy One-Liner. Feminist. View Speaker Details
Read more

Monitorama 2013 - Daniel Schauenberg - StatsD Workshop on ...

Daniel Schauenberg's StatsD workshop from Monitorama 2013 in Boston.
Read more

StatsD Workshop Monitorama 2013 - Technology

StatsD workshop from Monitorama 2013 ... StatsD Workshop Monitorama 2013 May 07, 2015 Technology daniel-schauenberg
Read more

Boston 2013 - StatsD Workshop - Daniel Schauenberg ...

Boston 2013 - StatsD Workshop - Daniel Schauenberg by Monitorama. Published March 29, 2013. Monitorama. 36 Presentations. Star this Talk 1 Star; Stats 283 ...
Read more

StatsD Workshop on unwiredcouch.com

Abstract . At the inaugural Monitorama conference I gave a workshop that introduces StatsD, shows how to use it, how to write different backends for it and ...
Read more

Vimeo / Monitorama 2013 - Boston, MA

Sean Porter's Sensu workshop from Monitorama 2013 in Boston. Cast: Monitorama. Monitorama 2013 - Sean Porter - Sensu Workshop
Read more

Monitorama 2013 Boston

Monitorama An Open Source Monitoring Conference & Hackathon - March 28-29, 2013 Boston, MA - Microsoft New England Research & Development Center
Read more

Monitorama 2017 PDX

Want to Be a Sponsor? Monitorama offers a unique experience for both sponsors and attendees alike. We provide a low-pressure environment for networking ...
Read more