SlideShare una empresa de Scribd logo
1 de 27
Descargar para leer sin conexión
Collecting metrics with
Graphite and StatsD
Víctor Martínez
@knoopx
http://github.com/knoopx
http://knoopx.net
What is Graphite?
What is Graphite?
An all-in-one solution for storing and visualizing
realtime time-series data in an efficient manner.
Key features:
Efficient storage and ultra-fast retrieval.
http://graphite.wikidot.com/
Graphite Architecture
Graphite Web
The frontend of
Graphite. It provides a
dashboard for retrieval
and visualization of our
metrics and a powerful
plotting API.
Carbon
The core of Graphite. It
consists of set of three
processes that take
care of receiving
incoming data,
aggregating it and
persisting it to disk.
Whisper
The current (stable)
data persistence
storage; an efficient
time-series based
database.
* There's a new persistence
layer called Ceres in the
works
Feeding in your data
PORT=2003
SERVER=graphite.your.org
echo "stats.app.logins.count 1 `date +%s`" | nc ${SERVER} ${PORT};
PORT=2003
SERVER=graphite.your.org
echo "stats.app.logins.count 1 `date +%s`" | nc ${SERVER} ${PORT};
PORT=2003
SERVER=graphite.your.org
echo "stats.app.logins.count 1 `date +%s`" | nc ${SERVER} ${PORT};
schema.application_name.namespace.metric_name.metric_type
Value
Name
Timestamp
Understanding how Carbon works
storage-schemas.conf
Allows you to define how your data
should be persisted (retention rules)
and in which order (priority).
storage-aggregation.conf
Allows you to define how your
metrics should be aggregated.
Key configuration files
Understanding how Carbon works
storage-schemas.conf
What does retention mean?
In a timespan of X time, in how much granularity I
want to store my data
Understanding how Carbon works
storage-schemas.conf
● For a timespan of 6 hours I want to store my data in
intervals of 10 seconds.
● For a timespan of 7 days I want to store my data in
intervals of 1 minute.
● For a timespan of 1 year I want to store my data in
intervals of 1 hour.
● For a timespan of 5 year I want to store my data in
intervals of 24 hours.
Understanding how Carbon works
storage-schemas.conf
Understanding how Carbon works
storage-aggregation.conf
Some examples:
stats.app.users.logins.count
stats.app.emails.sent.count
stats.app.orders.amount.max
stats.app.orders.amount.min
stats.app.response.time
Understanding how Carbon works
storage-aggregation.conf
Understanding how Carbon works
Carbon limitations
What happens if I send two metrics at
the same timespan (1h)?
1 new user – 6 minutes ago
2 new users – 5 minutes ago
Understanding how Carbon works
Carbon limitations
Carbon discards everything
but the last one
2 users
Understanding how Carbon works
Carbon limitations
● Increase schema retention: 1s:12h,[...]
and never, ever, push metrics older than
12 hours/push more than once per
second
● Pre-aggregate your data before pushing
● Use StatsD
Possible Solutions:
Understanding how Carbon works
Pre-aggregate your data
https://gist.github.com/knoopx/4738209
Understanding how Carbon works
Use StatsD
What is StatdD?
A network daemon that runs on the Node.js platform
and listens for statistics, like counters and timers, sent
over UDP and sends aggregates to one or more
pluggable backend services (e.g., Graphite).
Key features: Aggregates the data for us, fire and
forget communication protocol (UDP)
https://github.com/etsy/statsd/
Understanding how Carbon works
https://github.com/Shopify/statsd-instrument
StatsD.increment('revenue', 23.99)
StatsD.measure('worker.time') do
Worker.perform(value)
end
StatsD Instrument Gem
Important: Carefully read StatsD documentation and
ensure that your Carbon configuration explicitly
matches StatsD naming conventions
Visualizing your metrics
Using the Graphite dashboard
Common functions:
● summarize
● timeShift
● keepLastValue
● integral
● drawAsInfinite
● sumSeries
● alias
● aliasByNode
Full Documentation: http://graphite.readthedocs.
org/en/1.0/functions.html
Visualizing your metrics
Using the Graphite dashboard
Time-shifting and aliasing:
alias(timeShift(camaloon.sidekiq.workers.success.count,"24h"),"Yesterday")
alias(camaloon.sidekiq.workers.success.count,"Today")
Visualizing your metrics
Using the Graphite dashboard
Summarizing data:
summarize(camaloon.sidekiq.workers.success.count,"1h")
1h
Visualizing your metrics
Using the Graphite dashboard
Aliasing and combining series:
aliasByNode(camaloon.sidekiq.workers.*.count, 3)
Visualizing your metrics
Tasseo https://github.com/obfuscurity/tasseo
Cubism.js https://github.com/square/cubism
Visualizing your metrics
Graphene https://github.com/jondot/graphene
Visualizing your metrics
Your own solution
/render/?target=camaloon.users.count&format=json
We internally use Highchart Highstock
Other resources
Deployment
https://github.com/manasg/chef-graphite
https://github.com/gingerlime/graphite-fabric
https://github.com/knoopx/puppet-graphite
http://warwickp.com/2012/03/vagrant-box-with-graphite-statsd-gdash-nginx
https://github.com/obfuscurity/backstop
Learning
http://obfuscurity.com/Tags/Graphite
Questions?

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

A Thorough Comparison of Delta Lake, Iceberg and Hudi
A Thorough Comparison of Delta Lake, Iceberg and HudiA Thorough Comparison of Delta Lake, Iceberg and Hudi
A Thorough Comparison of Delta Lake, Iceberg and Hudi
 
RocksDB compaction
RocksDB compactionRocksDB compaction
RocksDB compaction
 
Prometheus – a next-gen Monitoring System
Prometheus – a next-gen Monitoring SystemPrometheus – a next-gen Monitoring System
Prometheus – a next-gen Monitoring System
 
Real-time Fraud Detection for Southeast Asia’s Leading Mobile Platform
Real-time Fraud Detection for Southeast Asia’s Leading Mobile PlatformReal-time Fraud Detection for Southeast Asia’s Leading Mobile Platform
Real-time Fraud Detection for Southeast Asia’s Leading Mobile Platform
 
Tuning Apache Ambari performance for Big Data at scale with 3000 agents
Tuning Apache Ambari performance for Big Data at scale with 3000 agentsTuning Apache Ambari performance for Big Data at scale with 3000 agents
Tuning Apache Ambari performance for Big Data at scale with 3000 agents
 
Cloud Monitoring tool Grafana
Cloud Monitoring  tool Grafana Cloud Monitoring  tool Grafana
Cloud Monitoring tool Grafana
 
Grafana introduction
Grafana introductionGrafana introduction
Grafana introduction
 
Intro to Time Series
Intro to Time Series Intro to Time Series
Intro to Time Series
 
MySQL Monitoring using Prometheus & Grafana
MySQL Monitoring using Prometheus & GrafanaMySQL Monitoring using Prometheus & Grafana
MySQL Monitoring using Prometheus & Grafana
 
VMware VSAN Technical Deep Dive - March 2014
VMware VSAN Technical Deep Dive - March 2014VMware VSAN Technical Deep Dive - March 2014
VMware VSAN Technical Deep Dive - March 2014
 
Beautiful Monitoring With Grafana and InfluxDB
Beautiful Monitoring With Grafana and InfluxDBBeautiful Monitoring With Grafana and InfluxDB
Beautiful Monitoring With Grafana and InfluxDB
 
Grafana.pptx
Grafana.pptxGrafana.pptx
Grafana.pptx
 
Getting Started Monitoring with Prometheus and Grafana
Getting Started Monitoring with Prometheus and GrafanaGetting Started Monitoring with Prometheus and Grafana
Getting Started Monitoring with Prometheus and Grafana
 
Hive spark-s3acommitter-hbase-nfs
Hive spark-s3acommitter-hbase-nfsHive spark-s3acommitter-hbase-nfs
Hive spark-s3acommitter-hbase-nfs
 
Going Deep on Amazon Aurora Serverless (DAT427-R1) - AWS re:Invent 2018
Going Deep on Amazon Aurora Serverless (DAT427-R1) - AWS re:Invent 2018Going Deep on Amazon Aurora Serverless (DAT427-R1) - AWS re:Invent 2018
Going Deep on Amazon Aurora Serverless (DAT427-R1) - AWS re:Invent 2018
 
Maximizing EC2 and Elastic Block Store Disk Performance
Maximizing EC2 and Elastic Block Store Disk PerformanceMaximizing EC2 and Elastic Block Store Disk Performance
Maximizing EC2 and Elastic Block Store Disk Performance
 
Tech Talk: RocksDB Slides by Dhruba Borthakur & Haobo Xu of Facebook
Tech Talk: RocksDB Slides by Dhruba Borthakur & Haobo Xu of FacebookTech Talk: RocksDB Slides by Dhruba Borthakur & Haobo Xu of Facebook
Tech Talk: RocksDB Slides by Dhruba Borthakur & Haobo Xu of Facebook
 
Grafana optimization for Prometheus
Grafana optimization for PrometheusGrafana optimization for Prometheus
Grafana optimization for Prometheus
 
Zero-downtime Hadoop/HBase Cross-datacenter Migration
Zero-downtime Hadoop/HBase Cross-datacenter MigrationZero-downtime Hadoop/HBase Cross-datacenter Migration
Zero-downtime Hadoop/HBase Cross-datacenter Migration
 
VMware Tanzu Application Service as an Integration Platform
VMware Tanzu Application Service as an Integration PlatformVMware Tanzu Application Service as an Integration Platform
VMware Tanzu Application Service as an Integration Platform
 

Destacado

Scalable Monitoring & Alerting
Scalable Monitoring & AlertingScalable Monitoring & Alerting
Scalable Monitoring & Alerting
Franklin Angulo
 
Load testing with gatling
Load testing with gatlingLoad testing with gatling
Load testing with gatling
Chris Birchall
 

Destacado (12)

Graphite
GraphiteGraphite
Graphite
 
Go with the flow
Go with the flowGo with the flow
Go with the flow
 
StatsD Workshop Monitorama 2013
StatsD Workshop Monitorama 2013StatsD Workshop Monitorama 2013
StatsD Workshop Monitorama 2013
 
Effective monitoring with StatsD
Effective monitoring with StatsDEffective monitoring with StatsD
Effective monitoring with StatsD
 
Statsd introduction
Statsd introductionStatsd introduction
Statsd introduction
 
Statsd backends presentation
Statsd backends presentationStatsd backends presentation
Statsd backends presentation
 
Scalable Monitoring & Alerting
Scalable Monitoring & AlertingScalable Monitoring & Alerting
Scalable Monitoring & Alerting
 
Metrics, Metrics Everywhere (but where the heck do you start?)
Metrics, Metrics Everywhere (but where the heck do you start?)Metrics, Metrics Everywhere (but where the heck do you start?)
Metrics, Metrics Everywhere (but where the heck do you start?)
 
Metrics by coda hale : to know your app’ health
Metrics by coda hale : to know your app’ healthMetrics by coda hale : to know your app’ health
Metrics by coda hale : to know your app’ health
 
Gatling - Stress test tool
Gatling - Stress test toolGatling - Stress test tool
Gatling - Stress test tool
 
Load testing with gatling
Load testing with gatlingLoad testing with gatling
Load testing with gatling
 
Monitoring system with Grafana and StatsD
Monitoring system with Grafana and StatsDMonitoring system with Grafana and StatsD
Monitoring system with Grafana and StatsD
 

Similar a Collecting metrics with Graphite and StatsD

Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...
Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...
Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...
DataStax
 
Large Scale Feature Aggregation Using Apache Spark with Pulkit Bhanot and Ami...
Large Scale Feature Aggregation Using Apache Spark with Pulkit Bhanot and Ami...Large Scale Feature Aggregation Using Apache Spark with Pulkit Bhanot and Ami...
Large Scale Feature Aggregation Using Apache Spark with Pulkit Bhanot and Ami...
Databricks
 
Amplitude wave architecture - Test
Amplitude wave architecture - TestAmplitude wave architecture - Test
Amplitude wave architecture - Test
Kiran Naiga
 
Tek12: Graphing real-time performance with Graphite
Tek12: Graphing real-time performance with GraphiteTek12: Graphing real-time performance with Graphite
Tek12: Graphing real-time performance with Graphite
nanderoo
 
Google Cloud Computing on Google Developer 2008 Day
Google Cloud Computing on Google Developer 2008 DayGoogle Cloud Computing on Google Developer 2008 Day
Google Cloud Computing on Google Developer 2008 Day
programmermag
 

Similar a Collecting metrics with Graphite and StatsD (20)

Monitoring as Software Validation
Monitoring as Software ValidationMonitoring as Software Validation
Monitoring as Software Validation
 
Python and trending_data_ops
Python and trending_data_opsPython and trending_data_ops
Python and trending_data_ops
 
Advanced data science algorithms applied to scalable stream processing by Dav...
Advanced data science algorithms applied to scalable stream processing by Dav...Advanced data science algorithms applied to scalable stream processing by Dav...
Advanced data science algorithms applied to scalable stream processing by Dav...
 
Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...
Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...
Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...
 
StasD & Graphite - Measure anything, Measure Everything
StasD & Graphite - Measure anything, Measure EverythingStasD & Graphite - Measure anything, Measure Everything
StasD & Graphite - Measure anything, Measure Everything
 
Александр Махомет "Beyond the code или как мониторить ваш PHP сайт"
Александр Махомет "Beyond the code или как мониторить ваш PHP сайт"Александр Махомет "Beyond the code или как мониторить ваш PHP сайт"
Александр Махомет "Beyond the code или как мониторить ваш PHP сайт"
 
Large Scale Feature Aggregation Using Apache Spark with Pulkit Bhanot and Ami...
Large Scale Feature Aggregation Using Apache Spark with Pulkit Bhanot and Ami...Large Scale Feature Aggregation Using Apache Spark with Pulkit Bhanot and Ami...
Large Scale Feature Aggregation Using Apache Spark with Pulkit Bhanot and Ami...
 
Amplitude wave architecture - Test
Amplitude wave architecture - TestAmplitude wave architecture - Test
Amplitude wave architecture - Test
 
In-Memory Stream Processing with Hazelcast Jet @JEEConf
In-Memory Stream Processing with Hazelcast Jet @JEEConfIn-Memory Stream Processing with Hazelcast Jet @JEEConf
In-Memory Stream Processing with Hazelcast Jet @JEEConf
 
Enterprise Data Lakes
Enterprise Data LakesEnterprise Data Lakes
Enterprise Data Lakes
 
Streaming data analytics (Kinesis, EMR/Spark) - Pop-up Loft Tel Aviv
Streaming data analytics (Kinesis, EMR/Spark) - Pop-up Loft Tel Aviv Streaming data analytics (Kinesis, EMR/Spark) - Pop-up Loft Tel Aviv
Streaming data analytics (Kinesis, EMR/Spark) - Pop-up Loft Tel Aviv
 
Functional architectural patterns
Functional architectural patternsFunctional architectural patterns
Functional architectural patterns
 
Cassandra Summit 2014: Cyanite — Better Graphite Storage with Apache Cassandra
Cassandra Summit 2014: Cyanite — Better Graphite Storage with Apache CassandraCassandra Summit 2014: Cyanite — Better Graphite Storage with Apache Cassandra
Cassandra Summit 2014: Cyanite — Better Graphite Storage with Apache Cassandra
 
Webinar: Cutting Time, Complexity and Cost from Data Science to Production
Webinar: Cutting Time, Complexity and Cost from Data Science to ProductionWebinar: Cutting Time, Complexity and Cost from Data Science to Production
Webinar: Cutting Time, Complexity and Cost from Data Science to Production
 
Creating a scalable & cost efficient BI infrastructure for a startup in the A...
Creating a scalable & cost efficient BI infrastructure for a startup in the A...Creating a scalable & cost efficient BI infrastructure for a startup in the A...
Creating a scalable & cost efficient BI infrastructure for a startup in the A...
 
Prometheus Everything, Observing Kubernetes in the Cloud
Prometheus Everything, Observing Kubernetes in the CloudPrometheus Everything, Observing Kubernetes in the Cloud
Prometheus Everything, Observing Kubernetes in the Cloud
 
Big Data Driven At Eway
Big Data Driven At Eway Big Data Driven At Eway
Big Data Driven At Eway
 
Tek12: Graphing real-time performance with Graphite
Tek12: Graphing real-time performance with GraphiteTek12: Graphing real-time performance with Graphite
Tek12: Graphing real-time performance with Graphite
 
Google Cloud Computing on Google Developer 2008 Day
Google Cloud Computing on Google Developer 2008 DayGoogle Cloud Computing on Google Developer 2008 Day
Google Cloud Computing on Google Developer 2008 Day
 
Cloud Computing ...changes everything
Cloud Computing ...changes everythingCloud Computing ...changes everything
Cloud Computing ...changes everything
 

Más de itnig

Hands-On Prototyping Without Code
Hands-On Prototyping Without CodeHands-On Prototyping Without Code
Hands-On Prototyping Without Code
itnig
 
Data Tools cosystem_for_non_programmers
Data Tools cosystem_for_non_programmersData Tools cosystem_for_non_programmers
Data Tools cosystem_for_non_programmers
itnig
 
Futurology For Entrepreneurs: 7 Ways To Spot The Opportunities Of Tomorrow
Futurology For Entrepreneurs: 7 Ways To Spot The Opportunities Of TomorrowFuturology For Entrepreneurs: 7 Ways To Spot The Opportunities Of Tomorrow
Futurology For Entrepreneurs: 7 Ways To Spot The Opportunities Of Tomorrow
itnig
 
Visualizing large datasets (BIG DATA itnig friday)
Visualizing large datasets (BIG DATA itnig friday)Visualizing large datasets (BIG DATA itnig friday)
Visualizing large datasets (BIG DATA itnig friday)
itnig
 
Make your own Open Source transition with CocoaPods
Make your own Open Source transition with CocoaPodsMake your own Open Source transition with CocoaPods
Make your own Open Source transition with CocoaPods
itnig
 
Performance marketingonline enterategratis_
Performance marketingonline enterategratis_Performance marketingonline enterategratis_
Performance marketingonline enterategratis_
itnig
 
Hablar en Público by Marion Chevalier
Hablar en Público by Marion ChevalierHablar en Público by Marion Chevalier
Hablar en Público by Marion Chevalier
itnig
 
La burbuja publicitaria
La burbuja publicitariaLa burbuja publicitaria
La burbuja publicitaria
itnig
 
Analisis de las empresas del Ibex35
Analisis de las empresas del Ibex35Analisis de las empresas del Ibex35
Analisis de las empresas del Ibex35
itnig
 

Más de itnig (20)

Presentation of the project "Startups Made in Spain" · On Friday, January 9 a...
Presentation of the project "Startups Made in Spain" · On Friday, January 9 a...Presentation of the project "Startups Made in Spain" · On Friday, January 9 a...
Presentation of the project "Startups Made in Spain" · On Friday, January 9 a...
 
Web Scraping for Non Programmers
Web Scraping for Non ProgrammersWeb Scraping for Non Programmers
Web Scraping for Non Programmers
 
Hands-On Prototyping Without Code
Hands-On Prototyping Without CodeHands-On Prototyping Without Code
Hands-On Prototyping Without Code
 
Essentials Every Non-Technical Person Need To Know To Build The Best Tech-Tea...
Essentials Every Non-Technical Person Need To Know To Build The Best Tech-Tea...Essentials Every Non-Technical Person Need To Know To Build The Best Tech-Tea...
Essentials Every Non-Technical Person Need To Know To Build The Best Tech-Tea...
 
Die Another Day: Scaling from 0 to 4 million daily requests as a lone develop...
Die Another Day: Scaling from 0 to 4 million daily requests as a lone develop...Die Another Day: Scaling from 0 to 4 million daily requests as a lone develop...
Die Another Day: Scaling from 0 to 4 million daily requests as a lone develop...
 
Data Tools cosystem_for_non_programmers
Data Tools cosystem_for_non_programmersData Tools cosystem_for_non_programmers
Data Tools cosystem_for_non_programmers
 
The Black Magic of Ruby Metaprogramming
The Black Magic of Ruby MetaprogrammingThe Black Magic of Ruby Metaprogramming
The Black Magic of Ruby Metaprogramming
 
Futurology For Entrepreneurs: 7 Ways To Spot The Opportunities Of Tomorrow
Futurology For Entrepreneurs: 7 Ways To Spot The Opportunities Of TomorrowFuturology For Entrepreneurs: 7 Ways To Spot The Opportunities Of Tomorrow
Futurology For Entrepreneurs: 7 Ways To Spot The Opportunities Of Tomorrow
 
Visualizing large datasets (BIG DATA itnig friday)
Visualizing large datasets (BIG DATA itnig friday)Visualizing large datasets (BIG DATA itnig friday)
Visualizing large datasets (BIG DATA itnig friday)
 
Make your own Open Source transition with CocoaPods
Make your own Open Source transition with CocoaPodsMake your own Open Source transition with CocoaPods
Make your own Open Source transition with CocoaPods
 
"El boom del Consumo Colaborativo" by Albert Cañigueral
"El boom del Consumo Colaborativo" by Albert Cañigueral"El boom del Consumo Colaborativo" by Albert Cañigueral
"El boom del Consumo Colaborativo" by Albert Cañigueral
 
Control Your Life - The Startup Way
Control Your Life - The Startup WayControl Your Life - The Startup Way
Control Your Life - The Startup Way
 
Analítica Ágil - De la Sobrecarga a la Evidencia de los Datos
Analítica Ágil - De la Sobrecarga a la Evidencia de los DatosAnalítica Ágil - De la Sobrecarga a la Evidencia de los Datos
Analítica Ágil - De la Sobrecarga a la Evidencia de los Datos
 
Ser público en internet lo es todo.
Ser público en internet lo es todo.Ser público en internet lo es todo.
Ser público en internet lo es todo.
 
Performance marketingonline enterategratis_
Performance marketingonline enterategratis_Performance marketingonline enterategratis_
Performance marketingonline enterategratis_
 
SEO para ecommerce by Alfonso Moure
SEO para ecommerce by Alfonso MoureSEO para ecommerce by Alfonso Moure
SEO para ecommerce by Alfonso Moure
 
Hablar en Público by Marion Chevalier
Hablar en Público by Marion ChevalierHablar en Público by Marion Chevalier
Hablar en Público by Marion Chevalier
 
La burbuja publicitaria
La burbuja publicitariaLa burbuja publicitaria
La burbuja publicitaria
 
Analisis de las empresas del Ibex35
Analisis de las empresas del Ibex35Analisis de las empresas del Ibex35
Analisis de las empresas del Ibex35
 
One graph to rule them all - Facebook
One graph to rule them all - FacebookOne graph to rule them all - Facebook
One graph to rule them all - Facebook
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Último (20)

Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

Collecting metrics with Graphite and StatsD

  • 1.
  • 2. Collecting metrics with Graphite and StatsD Víctor Martínez @knoopx http://github.com/knoopx http://knoopx.net
  • 4. What is Graphite? An all-in-one solution for storing and visualizing realtime time-series data in an efficient manner. Key features: Efficient storage and ultra-fast retrieval. http://graphite.wikidot.com/
  • 5. Graphite Architecture Graphite Web The frontend of Graphite. It provides a dashboard for retrieval and visualization of our metrics and a powerful plotting API. Carbon The core of Graphite. It consists of set of three processes that take care of receiving incoming data, aggregating it and persisting it to disk. Whisper The current (stable) data persistence storage; an efficient time-series based database. * There's a new persistence layer called Ceres in the works
  • 6. Feeding in your data PORT=2003 SERVER=graphite.your.org echo "stats.app.logins.count 1 `date +%s`" | nc ${SERVER} ${PORT}; PORT=2003 SERVER=graphite.your.org echo "stats.app.logins.count 1 `date +%s`" | nc ${SERVER} ${PORT}; PORT=2003 SERVER=graphite.your.org echo "stats.app.logins.count 1 `date +%s`" | nc ${SERVER} ${PORT}; schema.application_name.namespace.metric_name.metric_type Value Name Timestamp
  • 7. Understanding how Carbon works storage-schemas.conf Allows you to define how your data should be persisted (retention rules) and in which order (priority). storage-aggregation.conf Allows you to define how your metrics should be aggregated. Key configuration files
  • 8. Understanding how Carbon works storage-schemas.conf What does retention mean? In a timespan of X time, in how much granularity I want to store my data
  • 9. Understanding how Carbon works storage-schemas.conf ● For a timespan of 6 hours I want to store my data in intervals of 10 seconds. ● For a timespan of 7 days I want to store my data in intervals of 1 minute. ● For a timespan of 1 year I want to store my data in intervals of 1 hour. ● For a timespan of 5 year I want to store my data in intervals of 24 hours.
  • 10. Understanding how Carbon works storage-schemas.conf
  • 11. Understanding how Carbon works storage-aggregation.conf Some examples: stats.app.users.logins.count stats.app.emails.sent.count stats.app.orders.amount.max stats.app.orders.amount.min stats.app.response.time
  • 12. Understanding how Carbon works storage-aggregation.conf
  • 13. Understanding how Carbon works Carbon limitations What happens if I send two metrics at the same timespan (1h)? 1 new user – 6 minutes ago 2 new users – 5 minutes ago
  • 14. Understanding how Carbon works Carbon limitations Carbon discards everything but the last one 2 users
  • 15. Understanding how Carbon works Carbon limitations ● Increase schema retention: 1s:12h,[...] and never, ever, push metrics older than 12 hours/push more than once per second ● Pre-aggregate your data before pushing ● Use StatsD Possible Solutions:
  • 16. Understanding how Carbon works Pre-aggregate your data https://gist.github.com/knoopx/4738209
  • 17. Understanding how Carbon works Use StatsD What is StatdD? A network daemon that runs on the Node.js platform and listens for statistics, like counters and timers, sent over UDP and sends aggregates to one or more pluggable backend services (e.g., Graphite). Key features: Aggregates the data for us, fire and forget communication protocol (UDP) https://github.com/etsy/statsd/
  • 18. Understanding how Carbon works https://github.com/Shopify/statsd-instrument StatsD.increment('revenue', 23.99) StatsD.measure('worker.time') do Worker.perform(value) end StatsD Instrument Gem Important: Carefully read StatsD documentation and ensure that your Carbon configuration explicitly matches StatsD naming conventions
  • 19. Visualizing your metrics Using the Graphite dashboard Common functions: ● summarize ● timeShift ● keepLastValue ● integral ● drawAsInfinite ● sumSeries ● alias ● aliasByNode Full Documentation: http://graphite.readthedocs. org/en/1.0/functions.html
  • 20. Visualizing your metrics Using the Graphite dashboard Time-shifting and aliasing: alias(timeShift(camaloon.sidekiq.workers.success.count,"24h"),"Yesterday") alias(camaloon.sidekiq.workers.success.count,"Today")
  • 21. Visualizing your metrics Using the Graphite dashboard Summarizing data: summarize(camaloon.sidekiq.workers.success.count,"1h") 1h
  • 22. Visualizing your metrics Using the Graphite dashboard Aliasing and combining series: aliasByNode(camaloon.sidekiq.workers.*.count, 3)
  • 23. Visualizing your metrics Tasseo https://github.com/obfuscurity/tasseo Cubism.js https://github.com/square/cubism
  • 24. Visualizing your metrics Graphene https://github.com/jondot/graphene
  • 25. Visualizing your metrics Your own solution /render/?target=camaloon.users.count&format=json We internally use Highchart Highstock