SlideShare a Scribd company logo
1 of 31
Download to read offline
graphing time-series data
using python end-to-end:
based on experiences at deviantART
Chase Pettet, 2014
Network And Systems Engineer
https://github.com/chasemp
Why?
At Velocity 2012 I saw OmniTI CEO give a talk called ‘It’s all about Telemetry”
I walked away thinking Cacti was in the stone age.
Lessons learned:
Data presentation matters a lot
Cacti and RRD in general are too static for presentation
Trending data (a baseline) has an extremely high ROI.
There are a lot of projects in this space
https://github.com/sensu
http://collectd.org/
https://github.com/noahhl/batsd
For more see:
http://graphite.readthedocs.org/en/latest/tools.html
Seeing value in Graphite
You can use globbing across metrics: web*.cpu.percent
You can use timeshifting to compare to previous:
This week vs. last week

This week vs. last 3 weeks
You can get raw data in json format for any purpose.
Graphite is a platform for integrating trending data into your work.
Since the API is so nice people have built lots of dashboards.
But you don’t need to use an external dashboard.

Graphite has a rendering engine built in. That means you can embed graphs anywhere.
Graphite has a bunch of built in post-processing functions for data.
Graphite can overlay any events relevant to your data:
curl -X POST http://localhost:8000/events/ -d '{"what": "Something Interesting", "tags" : "tag1 "}'
tl;dr: Graphite is flexible.
How is this devopsy?
Ops and Dev…

shared tools man...
What?
Diamond
Host based collection and submission service
for providing statistics to an upstream receiver.
Existing output handlers:
Graphite, RabbitMQ, Riemann, Sentry,
ZeroMQ, Syslog, Statsd, HTTP, etc
Statsd
Service that receives, aggregates, and flushes statistics at
a set interval to Graphite.
I am using a deviantART specific fork that is mostly
compatible with the canonical version from etsy.
https://github.com/deviantART/pystatsd
Aggregation methods:
Counter, Set, Gauge, Timer
Logster
Aggregates statistics from log files and submits
them to an upstream receiver.
Existing format handlers:
Postfix, Squid, Log4j, etc
Graphite
A highly scalable graphing system.
Internals:
Carbon receives and persists statistics
Whisper is the fixed size time series file format
Graphite-Web is a Django based front end
Lots of stuff, right?
How?
Running Diamond Agent
Installation:
aptitude install python-configobj
git clone https://github.com/BrightcoveOS/Diamond.git
cd Diamond/ && make builddeb
dpkg -i build/diamond_3.4.266_all.deb
Default Statistics Collectors:

tail /var/log/diamond/diamond.log

CPU
Disk Space / Usage
Load Average
Memory
MountStats
SocketStats
VMStat

[2014-02-25 09:40:17,344] [Thread-29735] servers.idle23.memory.Buffers 1245184 1393350017
[2014-02-25 09:40:17,346] [Thread-29735] servers.idle23.memory.Active 457539584 1393350017
[2014-02-25 09:40:17,346] [Thread-29735] servers.idle23.memory.Inactive 100413440 1393350017
[2014-02-25 09:40:17,346] [Thread-29735] servers.idle23.memory.SwapTotal 0 1393350017
[2014-02-25 09:40:17,346] [Thread-29735] servers.idle23.memory.SwapFree 0 1393350017
Running Logster: Log Culling
Installation:
git clone https://github.com/etsy/logster.git
python bin/logster 
-p servers.myhost.postfix 
--output=statsd 
--statsd-host=statsd:8125 
PostfixLogster /var/log/mail.log
statsd:8125 servers.proxy01b.postfix.numSent:1000|g
statsd:8125 servers.proxy01b.postfix.pctSent:100.0|g
statsd:8125 servers.proxy01b.postfix.numDeferred:2|g
statsd:8125 servers.proxy01b.postfix.pctDeferred:3.0|g
statsd:8125 servers.proxy01b.postfix.numBounced:0|g
statsd:8125 servers.proxy01b.postfix.pctBounced:0.0|g
Running Statsd
Running statsd (not persistent):
aptitude install python-twisted
git clone https://github.com/deviantART/pystatsd.git
cd pystatsd/ && python statsd.py
Sending data to Statsd:
import socket
#get socket module
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0)
#setup socket handler
s.connect((10.10.10.10, 8125))
#open ‘connection’
s.send("counter_at_50_perc_sample:1|c|@0.5")
#send a counter sampled at half your rate
s.send("counter_at_one_to_one:1|c|@1")
#send a counter sampled at 1:1 rate
s.send("mytimer:100|ms")
#send the operation time of mytime
s.send("mygauge:1|g")
#send a gauge for 1
s.send("myset:1")
#send a set of 1
s.close()
dA Statsd Niceties
●

Uses Twisted to handle the network portion

●

Can withstand Qualys and Nessus Vulnerability Scanning

●

Provides an XMLRPC interface for monitoring

●

Publishes a lot more meta stats about internals

●

Cleanly handles 'bad' metric types w/ discard

●

Survives and reports failed Graphite flushes

●

Allows multiple metrics in a single message using newline character

●

Failures go to stderror

●

Has a '-d' debug option for dumping matching incoming stats to terminal

●

Can notify NSCA on failures if an notify_nsca function is provided

●

Allows incoming stats over TCP as well as UDP

Can handle 50,000+ metric output on a 1 core VM using >1Gig RAM

statsdmonitor.py output
Understanding Statsd
Question:

If Diamond can send statistics directly to Graphite then why do I need Statsd?
Answer:

You need Statsd if you want to submit data at intervals smaller than the smallest one stored by Graphite.

Statsd accepts data at all times, summarizes it and submits to Graphite.

Graphite only needs to store one datapoint per X seconds saving on disk space, and resources.
If you want to submit a value very ten seconds and you store 10 second intervals of data in Graphite you do not need Statsd.
Running Graphite
Installation:
pip install whisper
pip install carbon
pip install graphite-web

Further instructions:
http://chasemp.github.io/2013/06/15/debian-graphite-install/
http://chasemp.github.io/2013/09/12/graphite-on-centos6-lessons-learned/
Graphite Web Interface
Resources:
http://velocityconf.com/velocity2012/public/schedule/detail/23354
https://github.com/BrightcoveOS/Diamond
https://github.com/chasemp/pystatsd
https://github.com/graphite-project
https://github.com/etsy/logster
http://chasemp.github.io/2013/05/17/using-graphite-events/
http://chasemp.github.io/2013/08/15/graphite-test-clients/
http://chasemp.github.io/2013/06/15/debian-graphite-install/
http://chasemp.github.io/2013/03/01/graphite-all-metrics/
http://chasemp.github.io/2013/09/12/graphite-on-centos6-lessons-learned/

More Related Content

What's hot

Grafana introduction
Grafana introductionGrafana introduction
Grafana introductionRico Chen
 
Timeseries - data visualization in Grafana
Timeseries - data visualization in GrafanaTimeseries - data visualization in Grafana
Timeseries - data visualization in GrafanaOCoderFest
 
The Dark Side Of Go -- Go runtime related problems in TiDB in production
The Dark Side Of Go -- Go runtime related problems in TiDB  in productionThe Dark Side Of Go -- Go runtime related problems in TiDB  in production
The Dark Side Of Go -- Go runtime related problems in TiDB in productionPingCAP
 
Temporal Performance Modelling of Serverless Computing Platforms - WoSC6
Temporal Performance Modelling of Serverless Computing Platforms - WoSC6Temporal Performance Modelling of Serverless Computing Platforms - WoSC6
Temporal Performance Modelling of Serverless Computing Platforms - WoSC6Nima Mahmoudi
 
Flink Forward Berlin 2017: Jörg Schad, Till Rohrmann - Apache Flink meets Apa...
Flink Forward Berlin 2017: Jörg Schad, Till Rohrmann - Apache Flink meets Apa...Flink Forward Berlin 2017: Jörg Schad, Till Rohrmann - Apache Flink meets Apa...
Flink Forward Berlin 2017: Jörg Schad, Till Rohrmann - Apache Flink meets Apa...Flink Forward
 
OSMC 2018 | Why we recommend PMM to our clients by Matthias Crauwels
OSMC 2018 | Why we recommend PMM to our clients by Matthias CrauwelsOSMC 2018 | Why we recommend PMM to our clients by Matthias Crauwels
OSMC 2018 | Why we recommend PMM to our clients by Matthias CrauwelsNETWAYS
 
Flink Forward San Francisco 2018: Steven Wu - "Scaling Flink in Cloud"
Flink Forward San Francisco 2018: Steven Wu - "Scaling Flink in Cloud" Flink Forward San Francisco 2018: Steven Wu - "Scaling Flink in Cloud"
Flink Forward San Francisco 2018: Steven Wu - "Scaling Flink in Cloud" Flink Forward
 
Stream Processing Live Traffic Data with Kafka Streams
Stream Processing Live Traffic Data with Kafka StreamsStream Processing Live Traffic Data with Kafka Streams
Stream Processing Live Traffic Data with Kafka StreamsTim Ysewyn
 
Cost Effective Presto on AWS with Spot Nodes - Strata SF 2019
Cost Effective Presto on AWS with Spot Nodes - Strata SF 2019Cost Effective Presto on AWS with Spot Nodes - Strata SF 2019
Cost Effective Presto on AWS with Spot Nodes - Strata SF 2019Shubham Tagra
 
Hadoop summit - Scaling Uber’s Real-Time Infra for Trillion Events per Day
Hadoop summit - Scaling Uber’s Real-Time Infra for  Trillion Events per DayHadoop summit - Scaling Uber’s Real-Time Infra for  Trillion Events per Day
Hadoop summit - Scaling Uber’s Real-Time Infra for Trillion Events per DayAnkur Bansal
 
Stream Processing Live Traffic Data with Kafka Streams
Stream Processing Live Traffic Data with Kafka StreamsStream Processing Live Traffic Data with Kafka Streams
Stream Processing Live Traffic Data with Kafka StreamsTim Ysewyn
 
Time Series Database and Tick Stack
Time Series Database and Tick StackTime Series Database and Tick Stack
Time Series Database and Tick StackGianluca Arbezzano
 
Cassandra To Infinity And Beyond
Cassandra To Infinity And BeyondCassandra To Infinity And Beyond
Cassandra To Infinity And BeyondRomain Hardouin
 
HBaseCon2017 Data Product at AirBnB
HBaseCon2017 Data Product at AirBnBHBaseCon2017 Data Product at AirBnB
HBaseCon2017 Data Product at AirBnBHBaseCon
 
Scaling 100PB Data Warehouse in Cloud
Scaling 100PB Data Warehouse in CloudScaling 100PB Data Warehouse in Cloud
Scaling 100PB Data Warehouse in CloudChangshu Liu
 
Stream processing with Apache Flink @ OfferUp
Stream processing with Apache Flink @ OfferUpStream processing with Apache Flink @ OfferUp
Stream processing with Apache Flink @ OfferUpBowen Li
 
202107 - Orion introduction - COSCUP
202107 - Orion introduction - COSCUP202107 - Orion introduction - COSCUP
202107 - Orion introduction - COSCUPRonald Hsu
 
Monitoring Kafka w/ Prometheus
Monitoring Kafka w/ PrometheusMonitoring Kafka w/ Prometheus
Monitoring Kafka w/ Prometheuskawamuray
 
Golang in TiDB (GopherChina 2017)
Golang in TiDB  (GopherChina 2017)Golang in TiDB  (GopherChina 2017)
Golang in TiDB (GopherChina 2017)PingCAP
 

What's hot (20)

Grafana introduction
Grafana introductionGrafana introduction
Grafana introduction
 
Timeseries - data visualization in Grafana
Timeseries - data visualization in GrafanaTimeseries - data visualization in Grafana
Timeseries - data visualization in Grafana
 
The Dark Side Of Go -- Go runtime related problems in TiDB in production
The Dark Side Of Go -- Go runtime related problems in TiDB  in productionThe Dark Side Of Go -- Go runtime related problems in TiDB  in production
The Dark Side Of Go -- Go runtime related problems in TiDB in production
 
Temporal Performance Modelling of Serverless Computing Platforms - WoSC6
Temporal Performance Modelling of Serverless Computing Platforms - WoSC6Temporal Performance Modelling of Serverless Computing Platforms - WoSC6
Temporal Performance Modelling of Serverless Computing Platforms - WoSC6
 
Flink Forward Berlin 2017: Jörg Schad, Till Rohrmann - Apache Flink meets Apa...
Flink Forward Berlin 2017: Jörg Schad, Till Rohrmann - Apache Flink meets Apa...Flink Forward Berlin 2017: Jörg Schad, Till Rohrmann - Apache Flink meets Apa...
Flink Forward Berlin 2017: Jörg Schad, Till Rohrmann - Apache Flink meets Apa...
 
OSMC 2018 | Why we recommend PMM to our clients by Matthias Crauwels
OSMC 2018 | Why we recommend PMM to our clients by Matthias CrauwelsOSMC 2018 | Why we recommend PMM to our clients by Matthias Crauwels
OSMC 2018 | Why we recommend PMM to our clients by Matthias Crauwels
 
Flink Forward San Francisco 2018: Steven Wu - "Scaling Flink in Cloud"
Flink Forward San Francisco 2018: Steven Wu - "Scaling Flink in Cloud" Flink Forward San Francisco 2018: Steven Wu - "Scaling Flink in Cloud"
Flink Forward San Francisco 2018: Steven Wu - "Scaling Flink in Cloud"
 
Stream Processing Live Traffic Data with Kafka Streams
Stream Processing Live Traffic Data with Kafka StreamsStream Processing Live Traffic Data with Kafka Streams
Stream Processing Live Traffic Data with Kafka Streams
 
Cost Effective Presto on AWS with Spot Nodes - Strata SF 2019
Cost Effective Presto on AWS with Spot Nodes - Strata SF 2019Cost Effective Presto on AWS with Spot Nodes - Strata SF 2019
Cost Effective Presto on AWS with Spot Nodes - Strata SF 2019
 
Hadoop summit - Scaling Uber’s Real-Time Infra for Trillion Events per Day
Hadoop summit - Scaling Uber’s Real-Time Infra for  Trillion Events per DayHadoop summit - Scaling Uber’s Real-Time Infra for  Trillion Events per Day
Hadoop summit - Scaling Uber’s Real-Time Infra for Trillion Events per Day
 
Tick
TickTick
Tick
 
Stream Processing Live Traffic Data with Kafka Streams
Stream Processing Live Traffic Data with Kafka StreamsStream Processing Live Traffic Data with Kafka Streams
Stream Processing Live Traffic Data with Kafka Streams
 
Time Series Database and Tick Stack
Time Series Database and Tick StackTime Series Database and Tick Stack
Time Series Database and Tick Stack
 
Cassandra To Infinity And Beyond
Cassandra To Infinity And BeyondCassandra To Infinity And Beyond
Cassandra To Infinity And Beyond
 
HBaseCon2017 Data Product at AirBnB
HBaseCon2017 Data Product at AirBnBHBaseCon2017 Data Product at AirBnB
HBaseCon2017 Data Product at AirBnB
 
Scaling 100PB Data Warehouse in Cloud
Scaling 100PB Data Warehouse in CloudScaling 100PB Data Warehouse in Cloud
Scaling 100PB Data Warehouse in Cloud
 
Stream processing with Apache Flink @ OfferUp
Stream processing with Apache Flink @ OfferUpStream processing with Apache Flink @ OfferUp
Stream processing with Apache Flink @ OfferUp
 
202107 - Orion introduction - COSCUP
202107 - Orion introduction - COSCUP202107 - Orion introduction - COSCUP
202107 - Orion introduction - COSCUP
 
Monitoring Kafka w/ Prometheus
Monitoring Kafka w/ PrometheusMonitoring Kafka w/ Prometheus
Monitoring Kafka w/ Prometheus
 
Golang in TiDB (GopherChina 2017)
Golang in TiDB  (GopherChina 2017)Golang in TiDB  (GopherChina 2017)
Golang in TiDB (GopherChina 2017)
 

Similar to Graph Time-Series Data Using Python

Statsd introduction
Statsd introductionStatsd introduction
Statsd introductionRick Chang
 
Time series data monitoring at 99acres.com
Time series data monitoring at 99acres.comTime series data monitoring at 99acres.com
Time series data monitoring at 99acres.comRavi Raj
 
OGCE Overview for SciDAC 2009
OGCE Overview for SciDAC 2009OGCE Overview for SciDAC 2009
OGCE Overview for SciDAC 2009marpierc
 
Monitoring as Software Validation
Monitoring as Software ValidationMonitoring as Software Validation
Monitoring as Software ValidationBioDec
 
Graphite tattle
Graphite tattleGraphite tattle
Graphite tattleDraco2002
 
Graphite, an introduction
Graphite, an introductionGraphite, an introduction
Graphite, an introductionjamesrwu
 
Collecting metrics with Graphite and StatsD
Collecting metrics with Graphite and StatsDCollecting metrics with Graphite and StatsD
Collecting metrics with Graphite and StatsDitnig
 
StasD & Graphite - Measure anything, Measure Everything
StasD & Graphite - Measure anything, Measure EverythingStasD & Graphite - Measure anything, Measure Everything
StasD & Graphite - Measure anything, Measure EverythingAvi Revivo
 
Reactive Stream Processing in Industrial IoT using DDS and Rx
Reactive Stream Processing in Industrial IoT using DDS and RxReactive Stream Processing in Industrial IoT using DDS and Rx
Reactive Stream Processing in Industrial IoT using DDS and RxSumant Tambe
 
Monitoring as an entry point for collaboration
Monitoring as an entry point for collaborationMonitoring as an entry point for collaboration
Monitoring as an entry point for collaborationJulien Pivotto
 
Eclipse Con Europe 2014 How to use DAWN Science Project
Eclipse Con Europe 2014 How to use DAWN Science ProjectEclipse Con Europe 2014 How to use DAWN Science Project
Eclipse Con Europe 2014 How to use DAWN Science ProjectMatthew Gerring
 
How to Build a Telegraf Plugin by Noah Crowley
How to Build a Telegraf Plugin by Noah CrowleyHow to Build a Telegraf Plugin by Noah Crowley
How to Build a Telegraf Plugin by Noah CrowleyInfluxData
 
Building a Telegraf Plugin by Noah Crowly | Developer Advocate | InfluxData
Building a Telegraf Plugin by Noah Crowly | Developer Advocate | InfluxDataBuilding a Telegraf Plugin by Noah Crowly | Developer Advocate | InfluxData
Building a Telegraf Plugin by Noah Crowly | Developer Advocate | InfluxDataInfluxData
 
RTBkit Meetup - Developer Spotlight, Behind the Scenes of RTBkit and Intro to...
RTBkit Meetup - Developer Spotlight, Behind the Scenes of RTBkit and Intro to...RTBkit Meetup - Developer Spotlight, Behind the Scenes of RTBkit and Intro to...
RTBkit Meetup - Developer Spotlight, Behind the Scenes of RTBkit and Intro to...Datacratic
 
Overview Of Parallel Development - Ericnel
Overview Of Parallel Development -  EricnelOverview Of Parallel Development -  Ericnel
Overview Of Parallel Development - Ericnelukdpe
 
Apache StreamPipes – Flexible Industrial IoT Management
Apache StreamPipes – Flexible Industrial IoT ManagementApache StreamPipes – Flexible Industrial IoT Management
Apache StreamPipes – Flexible Industrial IoT ManagementApache StreamPipes
 
Instrumenting and Scaling Databases with Envoy
Instrumenting and Scaling Databases with EnvoyInstrumenting and Scaling Databases with Envoy
Instrumenting and Scaling Databases with EnvoyDaniel Hochman
 
Pivotal Real Time Data Stream Analytics
Pivotal Real Time Data Stream AnalyticsPivotal Real Time Data Stream Analytics
Pivotal Real Time Data Stream Analyticskgshukla
 
Cf summit-2016-monitoring-cf-sensu-graphite
Cf summit-2016-monitoring-cf-sensu-graphiteCf summit-2016-monitoring-cf-sensu-graphite
Cf summit-2016-monitoring-cf-sensu-graphiteJeff Barrows
 

Similar to Graph Time-Series Data Using Python (20)

Statsd introduction
Statsd introductionStatsd introduction
Statsd introduction
 
Time series data monitoring at 99acres.com
Time series data monitoring at 99acres.comTime series data monitoring at 99acres.com
Time series data monitoring at 99acres.com
 
OGCE Overview for SciDAC 2009
OGCE Overview for SciDAC 2009OGCE Overview for SciDAC 2009
OGCE Overview for SciDAC 2009
 
Monitoring as Software Validation
Monitoring as Software ValidationMonitoring as Software Validation
Monitoring as Software Validation
 
Graphite tattle
Graphite tattleGraphite tattle
Graphite tattle
 
Graphite, an introduction
Graphite, an introductionGraphite, an introduction
Graphite, an introduction
 
Collecting metrics with Graphite and StatsD
Collecting metrics with Graphite and StatsDCollecting metrics with Graphite and StatsD
Collecting metrics with Graphite and StatsD
 
StasD & Graphite - Measure anything, Measure Everything
StasD & Graphite - Measure anything, Measure EverythingStasD & Graphite - Measure anything, Measure Everything
StasD & Graphite - Measure anything, Measure Everything
 
Reactive Stream Processing in Industrial IoT using DDS and Rx
Reactive Stream Processing in Industrial IoT using DDS and RxReactive Stream Processing in Industrial IoT using DDS and Rx
Reactive Stream Processing in Industrial IoT using DDS and Rx
 
Monitoring as an entry point for collaboration
Monitoring as an entry point for collaborationMonitoring as an entry point for collaboration
Monitoring as an entry point for collaboration
 
Eclipse Con Europe 2014 How to use DAWN Science Project
Eclipse Con Europe 2014 How to use DAWN Science ProjectEclipse Con Europe 2014 How to use DAWN Science Project
Eclipse Con Europe 2014 How to use DAWN Science Project
 
How to Build a Telegraf Plugin by Noah Crowley
How to Build a Telegraf Plugin by Noah CrowleyHow to Build a Telegraf Plugin by Noah Crowley
How to Build a Telegraf Plugin by Noah Crowley
 
Building a Telegraf Plugin by Noah Crowly | Developer Advocate | InfluxData
Building a Telegraf Plugin by Noah Crowly | Developer Advocate | InfluxDataBuilding a Telegraf Plugin by Noah Crowly | Developer Advocate | InfluxData
Building a Telegraf Plugin by Noah Crowly | Developer Advocate | InfluxData
 
RTBkit Meetup - Developer Spotlight, Behind the Scenes of RTBkit and Intro to...
RTBkit Meetup - Developer Spotlight, Behind the Scenes of RTBkit and Intro to...RTBkit Meetup - Developer Spotlight, Behind the Scenes of RTBkit and Intro to...
RTBkit Meetup - Developer Spotlight, Behind the Scenes of RTBkit and Intro to...
 
Overview Of Parallel Development - Ericnel
Overview Of Parallel Development -  EricnelOverview Of Parallel Development -  Ericnel
Overview Of Parallel Development - Ericnel
 
Apache StreamPipes – Flexible Industrial IoT Management
Apache StreamPipes – Flexible Industrial IoT ManagementApache StreamPipes – Flexible Industrial IoT Management
Apache StreamPipes – Flexible Industrial IoT Management
 
Visual Network Analysis
Visual Network AnalysisVisual Network Analysis
Visual Network Analysis
 
Instrumenting and Scaling Databases with Envoy
Instrumenting and Scaling Databases with EnvoyInstrumenting and Scaling Databases with Envoy
Instrumenting and Scaling Databases with Envoy
 
Pivotal Real Time Data Stream Analytics
Pivotal Real Time Data Stream AnalyticsPivotal Real Time Data Stream Analytics
Pivotal Real Time Data Stream Analytics
 
Cf summit-2016-monitoring-cf-sensu-graphite
Cf summit-2016-monitoring-cf-sensu-graphiteCf summit-2016-monitoring-cf-sensu-graphite
Cf summit-2016-monitoring-cf-sensu-graphite
 

Recently uploaded

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 

Recently uploaded (20)

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 

Graph Time-Series Data Using Python

  • 1. graphing time-series data using python end-to-end: based on experiences at deviantART Chase Pettet, 2014 Network And Systems Engineer https://github.com/chasemp
  • 3. At Velocity 2012 I saw OmniTI CEO give a talk called ‘It’s all about Telemetry” I walked away thinking Cacti was in the stone age. Lessons learned: Data presentation matters a lot Cacti and RRD in general are too static for presentation Trending data (a baseline) has an extremely high ROI.
  • 4. There are a lot of projects in this space https://github.com/sensu http://collectd.org/ https://github.com/noahhl/batsd For more see: http://graphite.readthedocs.org/en/latest/tools.html
  • 5. Seeing value in Graphite
  • 6. You can use globbing across metrics: web*.cpu.percent
  • 7. You can use timeshifting to compare to previous: This week vs. last week This week vs. last 3 weeks
  • 8. You can get raw data in json format for any purpose. Graphite is a platform for integrating trending data into your work.
  • 9. Since the API is so nice people have built lots of dashboards.
  • 10. But you don’t need to use an external dashboard. Graphite has a rendering engine built in. That means you can embed graphs anywhere.
  • 11. Graphite has a bunch of built in post-processing functions for data.
  • 12. Graphite can overlay any events relevant to your data: curl -X POST http://localhost:8000/events/ -d '{"what": "Something Interesting", "tags" : "tag1 "}'
  • 13. tl;dr: Graphite is flexible.
  • 14.
  • 15. How is this devopsy?
  • 16. Ops and Dev… shared tools man...
  • 17. What?
  • 18. Diamond Host based collection and submission service for providing statistics to an upstream receiver. Existing output handlers: Graphite, RabbitMQ, Riemann, Sentry, ZeroMQ, Syslog, Statsd, HTTP, etc
  • 19. Statsd Service that receives, aggregates, and flushes statistics at a set interval to Graphite. I am using a deviantART specific fork that is mostly compatible with the canonical version from etsy. https://github.com/deviantART/pystatsd Aggregation methods: Counter, Set, Gauge, Timer
  • 20. Logster Aggregates statistics from log files and submits them to an upstream receiver. Existing format handlers: Postfix, Squid, Log4j, etc
  • 21. Graphite A highly scalable graphing system. Internals: Carbon receives and persists statistics Whisper is the fixed size time series file format Graphite-Web is a Django based front end
  • 22. Lots of stuff, right?
  • 23. How?
  • 24. Running Diamond Agent Installation: aptitude install python-configobj git clone https://github.com/BrightcoveOS/Diamond.git cd Diamond/ && make builddeb dpkg -i build/diamond_3.4.266_all.deb Default Statistics Collectors: tail /var/log/diamond/diamond.log CPU Disk Space / Usage Load Average Memory MountStats SocketStats VMStat [2014-02-25 09:40:17,344] [Thread-29735] servers.idle23.memory.Buffers 1245184 1393350017 [2014-02-25 09:40:17,346] [Thread-29735] servers.idle23.memory.Active 457539584 1393350017 [2014-02-25 09:40:17,346] [Thread-29735] servers.idle23.memory.Inactive 100413440 1393350017 [2014-02-25 09:40:17,346] [Thread-29735] servers.idle23.memory.SwapTotal 0 1393350017 [2014-02-25 09:40:17,346] [Thread-29735] servers.idle23.memory.SwapFree 0 1393350017
  • 25. Running Logster: Log Culling Installation: git clone https://github.com/etsy/logster.git python bin/logster -p servers.myhost.postfix --output=statsd --statsd-host=statsd:8125 PostfixLogster /var/log/mail.log statsd:8125 servers.proxy01b.postfix.numSent:1000|g statsd:8125 servers.proxy01b.postfix.pctSent:100.0|g statsd:8125 servers.proxy01b.postfix.numDeferred:2|g statsd:8125 servers.proxy01b.postfix.pctDeferred:3.0|g statsd:8125 servers.proxy01b.postfix.numBounced:0|g statsd:8125 servers.proxy01b.postfix.pctBounced:0.0|g
  • 26. Running Statsd Running statsd (not persistent): aptitude install python-twisted git clone https://github.com/deviantART/pystatsd.git cd pystatsd/ && python statsd.py Sending data to Statsd: import socket #get socket module s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0) #setup socket handler s.connect((10.10.10.10, 8125)) #open ‘connection’ s.send("counter_at_50_perc_sample:1|c|@0.5") #send a counter sampled at half your rate s.send("counter_at_one_to_one:1|c|@1") #send a counter sampled at 1:1 rate s.send("mytimer:100|ms") #send the operation time of mytime s.send("mygauge:1|g") #send a gauge for 1 s.send("myset:1") #send a set of 1 s.close()
  • 27. dA Statsd Niceties ● Uses Twisted to handle the network portion ● Can withstand Qualys and Nessus Vulnerability Scanning ● Provides an XMLRPC interface for monitoring ● Publishes a lot more meta stats about internals ● Cleanly handles 'bad' metric types w/ discard ● Survives and reports failed Graphite flushes ● Allows multiple metrics in a single message using newline character ● Failures go to stderror ● Has a '-d' debug option for dumping matching incoming stats to terminal ● Can notify NSCA on failures if an notify_nsca function is provided ● Allows incoming stats over TCP as well as UDP Can handle 50,000+ metric output on a 1 core VM using >1Gig RAM statsdmonitor.py output
  • 28. Understanding Statsd Question: If Diamond can send statistics directly to Graphite then why do I need Statsd? Answer: You need Statsd if you want to submit data at intervals smaller than the smallest one stored by Graphite. Statsd accepts data at all times, summarizes it and submits to Graphite. Graphite only needs to store one datapoint per X seconds saving on disk space, and resources. If you want to submit a value very ten seconds and you store 10 second intervals of data in Graphite you do not need Statsd.
  • 29. Running Graphite Installation: pip install whisper pip install carbon pip install graphite-web Further instructions: http://chasemp.github.io/2013/06/15/debian-graphite-install/ http://chasemp.github.io/2013/09/12/graphite-on-centos6-lessons-learned/