Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
StatsD Workshop Monitorama 2013
Search
Daniel Schauenberg
March 29, 2013
Technology
2k
11
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
StatsD Workshop Monitorama 2013
Daniel Schauenberg
March 29, 2013
More Decks by Daniel Schauenberg
See All by Daniel Schauenberg
The Road to Success is paved with Small Improvements
mrtazz
4
1.7k
Human Factors and PostMortems
mrtazz
3
860
Deploy, Collaborate and Listen
mrtazz
2
850
Data Driven Monitoring
mrtazz
2
830
Mobile CI at Etsy
mrtazz
2
570
Development, Deployment & Collaboration at Etsy
mrtazz
5
15k
A Whirlwind Tour of Etsy's Monitoring Stack
mrtazz
6
2.8k
Co-Workers As Customers: Lessons from Airbnb & Etsy
mrtazz
7
840
Development, Deployment and Collaboration at Etsy
mrtazz
9
5.8k
Other Decks in Technology
See All in Technology
kintone の AI コワーカーを、 Anthropic にエージェントを"ホストさせて"作った話 #devkinmeetup
sugimomoto
0
110
Genie Ontologyは銀の弾丸かを考える / Is Genie Ontology a Silver Bullet?
nttcom
0
390
AIコード生成×サプライチェーン攻撃 — PHPが直面する“二重の信頼問題
shinyasaita
0
190
知らん間に、回ってる
ming_ayami
0
710
壊して学ぶAWS CDK: そのcdk deployで消えるもの、残るもの
k_adachi_01
1
370
Terraform共通モジュールをチーム横断で“変えられる”運用へ ― リリースと適用の分離
kekke_n
1
3.3k
Type-safe IaC for Dart
coborinai
0
160
Oracle Exadata Database Service on Cloud@Customer X11M (ExaDB-C@C) サービス概要
oracle4engineer
PRO
2
8.4k
Control Planeで育てるBtoB SaaSの認証基盤 - SRE NEXT 2026
pokohide
1
2.6k
見守りエージェントを作ってみた(ローカルLLM + Hermes Agent)
happysamurai294
0
110
ガバナンスの「ちょうどいい落とし所」を探れ!開発スピードを妨げない運用判断の勘所 / SRE NEXT 2026
genda
1
240
凡エンジニアがこの先生きのこるためには。〜TypeScript完全に理解したい〜
alchemy1115
2
310
Featured
See All Featured
Technical Leadership for Architectural Decision Making
baasie
3
440
Bash Introduction
62gerente
615
220k
Practical Orchestrator
shlominoach
191
11k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
The Curious Case for Waylosing
cassininazir
1
430
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
200
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
120k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
390
Thoughts on Productivity
jonyablonski
76
5.2k
Transcript
StatsD workshop @ Monitorama 2013 Daniel Schauenberg Software Engineer, Etsy
Infrastructure @mrtazz Friday, March 29, 13
• What is this StatsD? • Metrics types • Backends
• Graphite and operating StatsD • Send all the metrics • Write all the backends Friday, March 29, 13
Friday, March 29, 13
Receiver loop Metrics processing module Backends Friday, March 29, 13
legacyNamespace: false Friday, March 29, 13
Counters foo.bar:1|c stats.counters.foo.bar.rate stats.counters.foo.bar.count Friday, March 29, 13
Gauges foo.gar:30|g foo.gar:-5|g foo.gar:+5|g stats.gauges.foo.gar Friday, March 29, 13
Sets foo.sar:30|s foo.sar:50|s stats.sets.foo.sar Friday, March 29, 13
Timers foo.tar:30|ms stats.timers.foo.tar.mean_90 stats.timers.foo.tar.std stats.timers.foo.tar.sum_90 Friday, 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_20 Friday, 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 > help Friday, March 29, 13
Graphite + StatsD • default backend • whisper archives should
match flush interval • sum aggregation for raw counters • docs/graphite.md Friday, March 29, 13
The single-thread dilemma Friday, 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 9297024 Friday, March 29, 13
Sampling • default sampling of 0.1 on all metrics •
most sent keys (log file) are sampled 0.01 Friday, 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 this Friday, 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.js Friday, 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 8125 Friday, 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 code Friday, 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 TCP Friday, March 29, 13
Hackathon ideas • Metrics path validation in backend • Pluggable
receiver frontends • Forked backends • Configurable timer metrics Friday, March 29, 13
• #statsd on Freenode IRC •
[email protected]
• Ask me
Friday, 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.js Friday, March 29, 13
StatsD workshop @ Monitorama 2013 Daniel Schauenberg Software Engineer, Etsy
Infrastructure @mrtazz Friday, March 29, 13