SlideShare ist ein Scribd-Unternehmen logo
1 von 31
Downloaden Sie, um offline zu lesen
Graphite




Johan Gunnarsson @ Inits teknikdag
johan.gunnarsson@init.se / se.linkedin.com/in/jgunnarsson / @j_gunnarsson
Vad är graphite?
●   Användargenererade grafer
●   Behöver ingen förkonfigurering av nya källor
●   Grafer i (nästan) realtid
●   Skalbart
●   URL API
●   Dumt namn
Nödvändigheter
● Ursprungligen utvecklat av Chris Davis på
  Orbitz.com, första versionen 2006
● Skrivet i Python, webappen i django med
  EXTjs för javascript GUI
● Licens: Apache 2.0
Översikt
Carbon
● Agent på serversidan
● Kö för lagring i Whisper
● lyssnar på tcp/2003
Få in data till Carbon
Format:
"metric_path value timestamp n"

foo.bar.baz 7 1359633139

$ echo "foo.bar.baz 7 $(date +%s)" | nc
graphite 2003
Få in data till carbon - exempel
#!/bin/bash
idgmoln=$(curl --silent www.idg.se | grep --count --ignore-case moln)
echo "webcount.idg.moln "$idgmoln" "$(date +%s) | nc graphite 2003
Whisper
●   Fix-storlek datastorage
●   Liknar RRD (fast bättre)
●   Tillåter uppdateringar i "oordning"
●   Kräver inte fördeklarerade datastores
Whisper - databasdefinition
$ cat storage-schemas.conf
# Schema definitions for Whisper files. Entries are scanned in order,
# and first match wins. This file is scanned for changes every 60 seconds.
#
# [name]
# pattern = regex
# retentions = timePerPoint:timeToStore, timePerPoint:timeToStore, ...

[everything_1min_13months]
priority = 100
pattern = .*
retentions = 1m:395d
Graphite-web
●   Django
●   PyCairo för rendering av grafer
●   Inte riktigt en dashboard
●   Använd mest för att prototypa grafer
●   Enkelt CLI
●   URL API
Graphite-web - UI
Graphite-web - CLI
Graphite URL API
● Graphites webapp exponerar ett URL-API på
  http://graphite/render
● Parametrar anges som /render/?
  param=value&param2=value2
● Output i form av png, json, csv, raw, svg
●
Graphite - URL API exempel
http://graphite/render/?
width=586&height=308&target=webcount.idg.moln
Graphite URL API - mer exempel

# average load across web machines over last 12 hours
http://graphite/render?target=averageSeries(server.web*.load)&from=-12hours

# number of registered users over past day as raw json data
http://graphite/render?target=app.numUsers&format=json

# rate of new signups per minute
http://graphite/render?target=summarize(deriviative(app.numUsers),"1min")
&title=New_Users_Per_Minute
Plugins och verktyg för Graphite
CollectD
● Samlar in system metrics
● God tillgång på externa plugins för
  mätvärden
● Flera olika plugins för output till graphite
StatsD - github.com/etsy/statsd/
●   Aggregator som körs på noden
●   UDP in (fire and forget), TCP ut
●   Flushar ut aggregerat data till graphite
●   Bindings till dom flesta språk
StatsD - exempel
import statsd

timer = statsd.Timer('MyApplication')

timer.start()
# spännande kod
timer.stop('SomeTimer')
JMXTrans - github.com/jmxtrans/jmxtrans
● Verktyg för monitorering av JVM
Logstash
http://logstash.net/


● Verktyg för att hantera loggar och events
● Används normalt som ersättare till splunk
  tillsammans med ES och kibana
● Innehåller grok för att filtrera ut och
  organisera data ur loggar
● Output för graphite
...och många fler
● Graphios
  - verktyg som skickar nagiosmetrics
● Logster
  - Hantering av loggfiler, ungeför som
  logstash
● Ganglia
  - Distribuerat system för metrics,
  ursprungligen för HPC. Har graphite-output.
● Diamond
  - Samlar in system-metrics, skrivet i python.
Användningsfall CD 1/2
(lånat från: http://codeascraft.etsy.com/2010/12/08/track-every-release/)


Grafa antal errors över tid. Men vad hände?
Användningsfall CD 2/2
(lånat från: http://codeascraft.etsy.com/2010/12/08/track-every-release/)


Lägg in events.deploy.website 1 $(date +%s)
i ditt deployverktyg och använd drawAsInfinite
Dashboards
Eftersom graphites inbyggda dashboard inte är
en ordentlig dashboard finns ett antal externa
projekt...
Dashboards - Team dashboard
github.com/fdietz/team_dashboard
Dashboards - Tasseo
github.com/obfuscurity/tasseo
Dashboards - Graphene
https://github.com/jondot/graphene
Dashboards - dashing
http://shopify.github.com/dashing/
Prova själv!

Vagrant up!

Färdig maskin med graphite, jmxtrans, collectd
och logster:

https://github.com/KrisBuytaert/vagrant-
graphite
Mer information
●   http://graphite.wikidot.com/
●   https://launchpad.net/graphite
●   http://graphite.readthedocs.org/en/0.9.10/
●   http://codeascraft.etsy.com/

Weitere ähnliche Inhalte

Empfohlen

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Empfohlen (20)

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 

Graphite teknikdag

  • 1. Graphite Johan Gunnarsson @ Inits teknikdag johan.gunnarsson@init.se / se.linkedin.com/in/jgunnarsson / @j_gunnarsson
  • 2. Vad är graphite? ● Användargenererade grafer ● Behöver ingen förkonfigurering av nya källor ● Grafer i (nästan) realtid ● Skalbart ● URL API ● Dumt namn
  • 3. Nödvändigheter ● Ursprungligen utvecklat av Chris Davis på Orbitz.com, första versionen 2006 ● Skrivet i Python, webappen i django med EXTjs för javascript GUI ● Licens: Apache 2.0
  • 5. Carbon ● Agent på serversidan ● Kö för lagring i Whisper ● lyssnar på tcp/2003
  • 6. Få in data till Carbon Format: "metric_path value timestamp n" foo.bar.baz 7 1359633139 $ echo "foo.bar.baz 7 $(date +%s)" | nc graphite 2003
  • 7. Få in data till carbon - exempel #!/bin/bash idgmoln=$(curl --silent www.idg.se | grep --count --ignore-case moln) echo "webcount.idg.moln "$idgmoln" "$(date +%s) | nc graphite 2003
  • 8. Whisper ● Fix-storlek datastorage ● Liknar RRD (fast bättre) ● Tillåter uppdateringar i "oordning" ● Kräver inte fördeklarerade datastores
  • 9. Whisper - databasdefinition $ cat storage-schemas.conf # Schema definitions for Whisper files. Entries are scanned in order, # and first match wins. This file is scanned for changes every 60 seconds. # # [name] # pattern = regex # retentions = timePerPoint:timeToStore, timePerPoint:timeToStore, ... [everything_1min_13months] priority = 100 pattern = .* retentions = 1m:395d
  • 10. Graphite-web ● Django ● PyCairo för rendering av grafer ● Inte riktigt en dashboard ● Använd mest för att prototypa grafer ● Enkelt CLI ● URL API
  • 13. Graphite URL API ● Graphites webapp exponerar ett URL-API på http://graphite/render ● Parametrar anges som /render/? param=value&param2=value2 ● Output i form av png, json, csv, raw, svg ●
  • 14. Graphite - URL API exempel http://graphite/render/? width=586&height=308&target=webcount.idg.moln
  • 15. Graphite URL API - mer exempel # average load across web machines over last 12 hours http://graphite/render?target=averageSeries(server.web*.load)&from=-12hours # number of registered users over past day as raw json data http://graphite/render?target=app.numUsers&format=json # rate of new signups per minute http://graphite/render?target=summarize(deriviative(app.numUsers),"1min") &title=New_Users_Per_Minute
  • 16. Plugins och verktyg för Graphite
  • 17. CollectD ● Samlar in system metrics ● God tillgång på externa plugins för mätvärden ● Flera olika plugins för output till graphite
  • 18. StatsD - github.com/etsy/statsd/ ● Aggregator som körs på noden ● UDP in (fire and forget), TCP ut ● Flushar ut aggregerat data till graphite ● Bindings till dom flesta språk
  • 19. StatsD - exempel import statsd timer = statsd.Timer('MyApplication') timer.start() # spännande kod timer.stop('SomeTimer')
  • 20. JMXTrans - github.com/jmxtrans/jmxtrans ● Verktyg för monitorering av JVM
  • 21. Logstash http://logstash.net/ ● Verktyg för att hantera loggar och events ● Används normalt som ersättare till splunk tillsammans med ES och kibana ● Innehåller grok för att filtrera ut och organisera data ur loggar ● Output för graphite
  • 22. ...och många fler ● Graphios - verktyg som skickar nagiosmetrics ● Logster - Hantering av loggfiler, ungeför som logstash ● Ganglia - Distribuerat system för metrics, ursprungligen för HPC. Har graphite-output. ● Diamond - Samlar in system-metrics, skrivet i python.
  • 23. Användningsfall CD 1/2 (lånat från: http://codeascraft.etsy.com/2010/12/08/track-every-release/) Grafa antal errors över tid. Men vad hände?
  • 24. Användningsfall CD 2/2 (lånat från: http://codeascraft.etsy.com/2010/12/08/track-every-release/) Lägg in events.deploy.website 1 $(date +%s) i ditt deployverktyg och använd drawAsInfinite
  • 25. Dashboards Eftersom graphites inbyggda dashboard inte är en ordentlig dashboard finns ett antal externa projekt...
  • 26. Dashboards - Team dashboard github.com/fdietz/team_dashboard
  • 30. Prova själv! Vagrant up! Färdig maskin med graphite, jmxtrans, collectd och logster: https://github.com/KrisBuytaert/vagrant- graphite
  • 31. Mer information ● http://graphite.wikidot.com/ ● https://launchpad.net/graphite ● http://graphite.readthedocs.org/en/0.9.10/ ● http://codeascraft.etsy.com/