SlideShare uma empresa Scribd logo
1 de 34
Baixar para ler offline
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
Metrics
                                  processing
                                   module

                       Receiver
                         loop


                                    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
                       • statsd@librelist.com
                       • 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

Mais conteúdo relacionado

Semelhante a StatsD Workshop Monitorama 2013

Erlang Application Metrics with Folsom
Erlang Application Metrics with FolsomErlang Application Metrics with Folsom
Erlang Application Metrics with Folsomlogicalstack
 
Chef - Configuration Management for the Cloud
Chef - Configuration Management for the CloudChef - Configuration Management for the Cloud
Chef - Configuration Management for the CloudJames Casey
 
Hotspot Garbage Collection - Tuning Guide
Hotspot Garbage Collection - Tuning GuideHotspot Garbage Collection - Tuning Guide
Hotspot Garbage Collection - Tuning GuidejClarity
 
metrics - performance monitoring or business value optimization?
metrics - performance monitoring or business value optimization?metrics - performance monitoring or business value optimization?
metrics - performance monitoring or business value optimization?João Nelas
 
Graph-Tool in Practice
Graph-Tool in PracticeGraph-Tool in Practice
Graph-Tool in PracticeMosky Liu
 
Smarter Scheduling
Smarter SchedulingSmarter Scheduling
Smarter SchedulingDavid Evans
 
What’s new in 9.6, by PostgreSQL contributor
What’s new in 9.6, by PostgreSQL contributorWhat’s new in 9.6, by PostgreSQL contributor
What’s new in 9.6, by PostgreSQL contributorMasahiko Sawada
 
Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...NETWAYS
 
openTSDB - Metrics for a distributed world
openTSDB - Metrics for a distributed worldopenTSDB - Metrics for a distributed world
openTSDB - Metrics for a distributed worldOliver Hankeln
 
Cook Up a Runtime with The New OSGi Resolver - Neil Bartlett
Cook Up a Runtime with The New OSGi Resolver - Neil BartlettCook Up a Runtime with The New OSGi Resolver - Neil Bartlett
Cook Up a Runtime with The New OSGi Resolver - Neil Bartlettmfrancis
 
Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...Puppet
 
Fluentdでログ収集「だけ」やる話 #study2study
Fluentdでログ収集「だけ」やる話 #study2studyFluentdでログ収集「だけ」やる話 #study2study
Fluentdでログ収集「だけ」やる話 #study2studySATOSHI TAGOMORI
 
Tachikoma 2013-01
Tachikoma 2013-01Tachikoma 2013-01
Tachikoma 2013-01Ryota Hanyu
 
Data Analytics and Simulation in Parallel with MATLAB*
Data Analytics and Simulation in Parallel with MATLAB*Data Analytics and Simulation in Parallel with MATLAB*
Data Analytics and Simulation in Parallel with MATLAB*Intel® Software
 
Oracle to Postgres Migration - part 2
Oracle to Postgres Migration - part 2Oracle to Postgres Migration - part 2
Oracle to Postgres Migration - part 2PgTraining
 
Around the world with extensions | PostgreSQL Conference Europe 2018 | Craig ...
Around the world with extensions | PostgreSQL Conference Europe 2018 | Craig ...Around the world with extensions | PostgreSQL Conference Europe 2018 | Craig ...
Around the world with extensions | PostgreSQL Conference Europe 2018 | Craig ...Citus Data
 
Real World Storage in Treasure Data
Real World Storage in Treasure DataReal World Storage in Treasure Data
Real World Storage in Treasure DataKai Sasaki
 
Application Logging With The ELK Stack
Application Logging With The ELK StackApplication Logging With The ELK Stack
Application Logging With The ELK Stackbenwaine
 
A Workshop on R
A Workshop on RA Workshop on R
A Workshop on RAjay Ohri
 

Semelhante a StatsD Workshop Monitorama 2013 (20)

Erlang Application Metrics with Folsom
Erlang Application Metrics with FolsomErlang Application Metrics with Folsom
Erlang Application Metrics with Folsom
 
Chef - Configuration Management for the Cloud
Chef - Configuration Management for the CloudChef - Configuration Management for the Cloud
Chef - Configuration Management for the Cloud
 
Hotspot Garbage Collection - Tuning Guide
Hotspot Garbage Collection - Tuning GuideHotspot Garbage Collection - Tuning Guide
Hotspot Garbage Collection - Tuning Guide
 
metrics - performance monitoring or business value optimization?
metrics - performance monitoring or business value optimization?metrics - performance monitoring or business value optimization?
metrics - performance monitoring or business value optimization?
 
Graph-Tool in Practice
Graph-Tool in PracticeGraph-Tool in Practice
Graph-Tool in Practice
 
Smarter Scheduling
Smarter SchedulingSmarter Scheduling
Smarter Scheduling
 
What’s new in 9.6, by PostgreSQL contributor
What’s new in 9.6, by PostgreSQL contributorWhat’s new in 9.6, by PostgreSQL contributor
What’s new in 9.6, by PostgreSQL contributor
 
Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...
 
openTSDB - Metrics for a distributed world
openTSDB - Metrics for a distributed worldopenTSDB - Metrics for a distributed world
openTSDB - Metrics for a distributed world
 
Cook Up a Runtime with The New OSGi Resolver - Neil Bartlett
Cook Up a Runtime with The New OSGi Resolver - Neil BartlettCook Up a Runtime with The New OSGi Resolver - Neil Bartlett
Cook Up a Runtime with The New OSGi Resolver - Neil Bartlett
 
Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...
 
Fluentdでログ収集「だけ」やる話 #study2study
Fluentdでログ収集「だけ」やる話 #study2studyFluentdでログ収集「だけ」やる話 #study2study
Fluentdでログ収集「だけ」やる話 #study2study
 
Tachikoma 2013-01
Tachikoma 2013-01Tachikoma 2013-01
Tachikoma 2013-01
 
Data Analytics and Simulation in Parallel with MATLAB*
Data Analytics and Simulation in Parallel with MATLAB*Data Analytics and Simulation in Parallel with MATLAB*
Data Analytics and Simulation in Parallel with MATLAB*
 
Oracle to Postgres Migration - part 2
Oracle to Postgres Migration - part 2Oracle to Postgres Migration - part 2
Oracle to Postgres Migration - part 2
 
Around the world with extensions | PostgreSQL Conference Europe 2018 | Craig ...
Around the world with extensions | PostgreSQL Conference Europe 2018 | Craig ...Around the world with extensions | PostgreSQL Conference Europe 2018 | Craig ...
Around the world with extensions | PostgreSQL Conference Europe 2018 | Craig ...
 
Js memory
Js memoryJs memory
Js memory
 
Real World Storage in Treasure Data
Real World Storage in Treasure DataReal World Storage in Treasure Data
Real World Storage in Treasure Data
 
Application Logging With The ELK Stack
Application Logging With The ELK StackApplication Logging With The ELK Stack
Application Logging With The ELK Stack
 
A Workshop on R
A Workshop on RA Workshop on R
A Workshop on R
 

Mais de Daniel Schauenberg

Deploy, Collaborate and Listen
Deploy, Collaborate and ListenDeploy, Collaborate and Listen
Deploy, Collaborate and ListenDaniel Schauenberg
 
Development, Deployment & Collaboration at Etsy
Development, Deployment & Collaboration at EtsyDevelopment, Deployment & Collaboration at Etsy
Development, Deployment & Collaboration at EtsyDaniel Schauenberg
 
A Whirlwind Tour of Etsy's Monitoring Stack
A Whirlwind Tour of Etsy's Monitoring StackA Whirlwind Tour of Etsy's Monitoring Stack
A Whirlwind Tour of Etsy's Monitoring StackDaniel Schauenberg
 
Development, Deployment and Collaboration at Etsy
Development, Deployment and Collaboration at EtsyDevelopment, Deployment and Collaboration at Etsy
Development, Deployment and Collaboration at EtsyDaniel Schauenberg
 
Feature Flagging your Infrastructure for Fun and Profit
Feature Flagging your Infrastructure for Fun and ProfitFeature Flagging your Infrastructure for Fun and Profit
Feature Flagging your Infrastructure for Fun and ProfitDaniel Schauenberg
 

Mais de Daniel Schauenberg (12)

Human Factors and PostMortems
Human Factors and PostMortemsHuman Factors and PostMortems
Human Factors and PostMortems
 
Deploy, Collaborate and Listen
Deploy, Collaborate and ListenDeploy, Collaborate and Listen
Deploy, Collaborate and Listen
 
Data Driven Monitoring
Data Driven MonitoringData Driven Monitoring
Data Driven Monitoring
 
Development, Deployment & Collaboration at Etsy
Development, Deployment & Collaboration at EtsyDevelopment, Deployment & Collaboration at Etsy
Development, Deployment & Collaboration at Etsy
 
Mobile CI at Etsy
Mobile CI at EtsyMobile CI at Etsy
Mobile CI at Etsy
 
A Whirlwind Tour of Etsy's Monitoring Stack
A Whirlwind Tour of Etsy's Monitoring StackA Whirlwind Tour of Etsy's Monitoring Stack
A Whirlwind Tour of Etsy's Monitoring Stack
 
Development, Deployment and Collaboration at Etsy
Development, Deployment and Collaboration at EtsyDevelopment, Deployment and Collaboration at Etsy
Development, Deployment and Collaboration at Etsy
 
Scaling Deployment at Etsy
Scaling Deployment at EtsyScaling Deployment at Etsy
Scaling Deployment at Etsy
 
Feature Flagging your Infrastructure for Fun and Profit
Feature Flagging your Infrastructure for Fun and ProfitFeature Flagging your Infrastructure for Fun and Profit
Feature Flagging your Infrastructure for Fun and Profit
 
DevTools at Etsy
DevTools at EtsyDevTools at Etsy
DevTools at Etsy
 
Scaling Deployment at Etsy
Scaling Deployment at EtsyScaling Deployment at Etsy
Scaling Deployment at Etsy
 
Etsy chef-workflow
Etsy chef-workflowEtsy chef-workflow
Etsy chef-workflow
 

Último

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 

Último (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 

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
  • 4. Metrics processing module Receiver loop Backends Friday, March 29, 13
  • 6. Counters foo.bar:1|c stats.counters.foo.bar.rate stats.counters.foo.bar.count Friday, March 29, 13
  • 7. Gauges foo.gar:30|g foo.gar:-5|g foo.gar:+5|g stats.gauges.foo.gar Friday, March 29, 13
  • 8. Sets foo.sar:30|s foo.sar:50|s stats.sets.foo.sar Friday, March 29, 13
  • 9. 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
  • 10. 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
  • 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
  • 15. The single-thread dilemma Friday, March 29, 13
  • 16. 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
  • 17. Sampling • default sampling of 0.1 on all metrics • most sent keys (log file) are sampled 0.01 Friday, March 29, 13
  • 18. Quis monitoret ipsos monitores? Friday, March 29, 13
  • 23. Let’s do this Friday, March 29, 13
  • 24. 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
  • 25. 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
  • 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
  • 31. Hackathon ideas • Metrics path validation in backend • Pluggable receiver frontends • Forked backends • Configurable timer metrics Friday, March 29, 13
  • 32. • #statsd on Freenode IRC • statsd@librelist.com • Ask me Friday, March 29, 13
  • 33. 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
  • 34. StatsD workshop @ Monitorama 2013 Daniel Schauenberg Software Engineer, Etsy Infrastructure @mrtazz Friday, March 29, 13