SlideShare a Scribd company logo
1 of 36
Download to read offline
VISUALIZATION OF DOCKER
METRICS
2015/12/09 by janus_wel
WHO?
高木健介janus_wel
archtect/programmer for full-stack
PURPOSE OF
VISUALIZATION ?
TO CHECK LIFE OR DEATH ?
should be covered by orchestration
ex) consul
TO USE RESOURCES EFFICIENTLY !!
figure out bottlenecks
decision a number of containers on a machine
TO MAKE DOCUMENTS
for customers
for executives
TO FOLLOW THE PDCA CYCLE
figure out influences of changes
COLLECTING METRICS USUALLY
is important to trace back
TOOLS
Docker remote API
InfluxDB
DOCKER REMOTE API
https://docs.docker.com/engine/reference/api/docker_remote_
REST LIKE API
The API tends to be REST, but for some
complex commands, like attach or pull, the
HTTP connection is hijacked to transport
STDOUT, STDIN, and STDERR.
AVAILABILITY
maybe, all operations in commands are available.
https://docs.docker.com/engine/reference/api/docker_remote_
FOR EXAMPLE
List containers
Create a container
Start a container
Stop a container
Remove a container
List Images
Build image from a Dockerfile
Create an image
Display system-wide information
Show the docker version information
...
REQUIREMENTS
needs some settings for access control
$DOCKER_OPTS in /etc/init/docker.conf on Ubuntu
$OPTIONS in /etc/sysconfig/docker on other Linux
if 192.0.2.1 is a client,
DOCKER_OPTS="-H 192.0.2.1:2376 -H unix:///var/run/docker.sock"
OPTIONS="-H 192.0.2.1:2376 -H unix:///var/run/docker.sock"
https://docs.docker.com/engine/userguide/basics/#bind-
docker-to-another-host-port-or-a-unix-socket
NOTE
make sure to hear from unix domain socket.
OPTIONS="-H 192.0.2.1:2376 -H unix:///var/run/docker.sock"
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
or, docker commands are not available.
FOR DOCKER MACHINE
machines created by docker-machine needs https
by default, in your ~/.docker/machine/machines/(machine
name)/
cert.pem
key.pem
this path is set by "$(docker-machine env (machine name))"
as $DOCKER_CERT_PATH
INFO
wget http://(machine ip):2376/info -O - -q | jq .
for docker-machine
wget 
--no-check-certificate 
--certificate=${DOCKER_CERT_PATH}/cert.pem 
--private-key=${DOCKER_CERT_PATH}/key.pem 
https://$(docker-machine ip (machine name)):2376/info 
-O - -q | jq .
"curl" can't handle non-checking local cert, so use "wget"
 
STATS API
to get container's metrics, use stats API
GET /containers/(id)/stats
https://docs.docker.com/engine/reference/api/docker_remote_
container-stats-based-on-resource-usage
 
INFLUXDB
https://influxdb.com/
 
POINTS
schemaless
SQL like query
REST like interface
SCHEMALESS
there is no need to define somethings
when writing data, InfluxDB needs only
TABLE NAME and VALUE
these are optional
timestamp
tags
https://influxdb.com/docs/v0.9/concepts/schema_and_data_la
SQL LIKE QUERY
to read
SELECT * FROM cpu_load_short WHERE host=server01 AND region=us-west
-- ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-- table name tags
https://influxdb.com/docs/v0.9/query_language/data_explor
REST LIKE INTERFACE
# CREATE DATABASE
curl -G http://localhost:8086/query --data-urlencode "q=CREATE DATABASE mydb"
# INSERT
curl -i -XPOST 'http://localhost:8086/write?db=mydb' --data-binary 'cpu_load_
# SELECT
curl -G 'http://localhost:8086/query?db=mydb' --data-urlencode "q=SELECT valu
https://influxdb.com/docs/v0.9/guides/writing_data.html
https://influxdb.com/docs/v0.9/guides/querying_data.html
SYSTEM
pull archtecture
collect metrics minutely
run with various OSs
Linux
Windows
others can run Docker
for now, test only in Linux...
 
METRICS COLLECTOR
get metrics from Docker remote API and insert them
InfluxDB
in Ruby
requires gem "clockwork"
runs a collection minutely
VISUALIZE
in HTML and JavaScript
use chart.js
use some EcmaScript 2015 features
"let" statement
Promise
Object.assign
http://www.chartjs.org/
now available with only Google Chrome
DEMO
http://52.193.71.92/
METRICS
legend description type
rx_bytes received bytes counter
tx_bytes transferred bytes counter
total_cpu_usage cpu usage time % counter
SOURCES
https://github.com/januswel/docker-metrics
PROBLEMS
load
stats API is heavy
pull architecture
calling API is proportional to number of containers
handling mass containers
id is not human-friendly
PUSH ARCHITECTURE AND AGENT
to collect with low load, we need inspect /sys
cat /sys/fs/cgroup/memory/docker/<container-id>/memory.stat
cat /sys/fs/cgroup/cpuacct/docker/<container-id>/cpuacct.stat
pull architecture is unfit to cat local files
agent is needed
https://docs.docker.com/engine/articles/runmetrics/
AFTER
increase collectable metrices
I don't know Docker metrics means what is...
agent-ize collector

More Related Content

What's hot

Building a p2 update site using Buckminster
Building a p2 update site using BuckminsterBuilding a p2 update site using Buckminster
Building a p2 update site using Buckminster
guest5e2b6b
 
Apache Camel
Apache CamelApache Camel
Apache Camel
helggeist
 

What's hot (17)

Simple acl with laravel
Simple acl with laravelSimple acl with laravel
Simple acl with laravel
 
A Tour of PostgREST
A Tour of PostgRESTA Tour of PostgREST
A Tour of PostgREST
 
React native-firebase startup-mtup
React native-firebase startup-mtupReact native-firebase startup-mtup
React native-firebase startup-mtup
 
Samuele Resca - REACTIVE PROGRAMMING, DAMN. IT IS NOT ABOUT REACTJS - Codemot...
Samuele Resca - REACTIVE PROGRAMMING, DAMN. IT IS NOT ABOUT REACTJS - Codemot...Samuele Resca - REACTIVE PROGRAMMING, DAMN. IT IS NOT ABOUT REACTJS - Codemot...
Samuele Resca - REACTIVE PROGRAMMING, DAMN. IT IS NOT ABOUT REACTJS - Codemot...
 
Pipeline interface
Pipeline interfacePipeline interface
Pipeline interface
 
Building a p2 update site using Buckminster
Building a p2 update site using BuckminsterBuilding a p2 update site using Buckminster
Building a p2 update site using Buckminster
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API
 
Retrofit library for android
Retrofit library for androidRetrofit library for android
Retrofit library for android
 
Rest web service_with_spring_hateoas
Rest web service_with_spring_hateoasRest web service_with_spring_hateoas
Rest web service_with_spring_hateoas
 
KSQL: The Streaming SQL Engine for Apache Kafka
KSQL: The Streaming SQL Engine for Apache KafkaKSQL: The Streaming SQL Engine for Apache Kafka
KSQL: The Streaming SQL Engine for Apache Kafka
 
Apache Camel
Apache CamelApache Camel
Apache Camel
 
Rails3 way
Rails3 wayRails3 way
Rails3 way
 
Retrolambda+bolts
Retrolambda+boltsRetrolambda+bolts
Retrolambda+bolts
 
Reactive Programming in Java 8 with Rx-Java
Reactive Programming in Java 8 with Rx-JavaReactive Programming in Java 8 with Rx-Java
Reactive Programming in Java 8 with Rx-Java
 
React Native in Production
React Native in ProductionReact Native in Production
React Native in Production
 
Creating a modern web application using Symfony API Platform Atlanta
Creating a modern web application using  Symfony API Platform AtlantaCreating a modern web application using  Symfony API Platform Atlanta
Creating a modern web application using Symfony API Platform Atlanta
 
Otimizando Aplicações em Rails
Otimizando Aplicações em RailsOtimizando Aplicações em Rails
Otimizando Aplicações em Rails
 

Viewers also liked

The State of PHP 2014 - Portsmouth Linux User Group (6th June 2014)
The State of PHP 2014 - Portsmouth Linux User Group (6th June 2014)The State of PHP 2014 - Portsmouth Linux User Group (6th June 2014)
The State of PHP 2014 - Portsmouth Linux User Group (6th June 2014)
James Titcumb
 
Chapter iv
Chapter ivChapter iv
Chapter iv
faevilla
 
Ars breast cancer update
Ars breast cancer updateArs breast cancer update
Ars breast cancer update
spa718
 
ภาษาอังกฤษ 201
ภาษาอังกฤษ 201ภาษาอังกฤษ 201
ภาษาอังกฤษ 201
Marr Ps
 

Viewers also liked (20)

Top ten billionaries in india
Top ten billionaries in indiaTop ten billionaries in india
Top ten billionaries in india
 
Teks negosiasi (fauzatul aruningrum)
Teks negosiasi (fauzatul aruningrum)Teks negosiasi (fauzatul aruningrum)
Teks negosiasi (fauzatul aruningrum)
 
1480552328 6162 revisao_dl_132_2012_vf
1480552328 6162 revisao_dl_132_2012_vf1480552328 6162 revisao_dl_132_2012_vf
1480552328 6162 revisao_dl_132_2012_vf
 
The State of PHP 2014 - Portsmouth Linux User Group (6th June 2014)
The State of PHP 2014 - Portsmouth Linux User Group (6th June 2014)The State of PHP 2014 - Portsmouth Linux User Group (6th June 2014)
The State of PHP 2014 - Portsmouth Linux User Group (6th June 2014)
 
Start small business over internet
Start small business over internetStart small business over internet
Start small business over internet
 
Chapter iv
Chapter ivChapter iv
Chapter iv
 
oligoblastic AML
oligoblastic AMLoligoblastic AML
oligoblastic AML
 
Bp economy-for-99-percent-160117-pt
Bp economy-for-99-percent-160117-ptBp economy-for-99-percent-160117-pt
Bp economy-for-99-percent-160117-pt
 
Hgp platform high flyers v4
Hgp platform high flyers v4Hgp platform high flyers v4
Hgp platform high flyers v4
 
Prezentácia produktov 2
Prezentácia produktov 2Prezentácia produktov 2
Prezentácia produktov 2
 
Ars breast cancer update
Ars breast cancer updateArs breast cancer update
Ars breast cancer update
 
CitNetExplorer: A new software tool for analyzing and visualizing citation ne...
CitNetExplorer: A new software tool for analyzing and visualizing citation ne...CitNetExplorer: A new software tool for analyzing and visualizing citation ne...
CitNetExplorer: A new software tool for analyzing and visualizing citation ne...
 
Foire de Limoges 2017
 Foire de Limoges 2017 Foire de Limoges 2017
Foire de Limoges 2017
 
Hspice proposal workshop
Hspice proposal workshopHspice proposal workshop
Hspice proposal workshop
 
Бизнес почта
Бизнес почтаБизнес почта
Бизнес почта
 
ใบงานสำรวจตนเอง M6
ใบงานสำรวจตนเอง M6ใบงานสำรวจตนเอง M6
ใบงานสำรวจตนเอง M6
 
... now write an interpreter (PHPem 2016)
... now write an interpreter (PHPem 2016)... now write an interpreter (PHPem 2016)
... now write an interpreter (PHPem 2016)
 
ภาษาอังกฤษ 201
ภาษาอังกฤษ 201ภาษาอังกฤษ 201
ภาษาอังกฤษ 201
 
A operação marquês e os negócios
A operação marquês e os negóciosA operação marquês e os negócios
A operação marquês e os negócios
 
Presentazione lg 2.0
Presentazione lg 2.0Presentazione lg 2.0
Presentazione lg 2.0
 

Similar to visualization of Docker metrics

CoreOS @ summer meetup in Utrecht
CoreOS @ summer meetup in UtrechtCoreOS @ summer meetup in Utrecht
CoreOS @ summer meetup in Utrecht
Timo Derstappen
 
Quartz.NET - Enterprise Job Scheduler for .NET Platform
Quartz.NET - Enterprise Job Scheduler for .NET PlatformQuartz.NET - Enterprise Job Scheduler for .NET Platform
Quartz.NET - Enterprise Job Scheduler for .NET Platform
Guo Albert
 

Similar to visualization of Docker metrics (20)

2014 09 30_sparkling_water_hands_on
2014 09 30_sparkling_water_hands_on2014 09 30_sparkling_water_hands_on
2014 09 30_sparkling_water_hands_on
 
Architecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsArchitecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based Deployments
 
Introduction to Docker & CoreOS - Symfony User Group Cologne
Introduction to Docker & CoreOS - Symfony User Group CologneIntroduction to Docker & CoreOS - Symfony User Group Cologne
Introduction to Docker & CoreOS - Symfony User Group Cologne
 
CoreOS @ summer meetup in Utrecht
CoreOS @ summer meetup in UtrechtCoreOS @ summer meetup in Utrecht
CoreOS @ summer meetup in Utrecht
 
Docker for Java Developers
Docker for Java DevelopersDocker for Java Developers
Docker for Java Developers
 
Helsinki dockermeetup 12102017-orchestrate_docker_with_docker
Helsinki dockermeetup 12102017-orchestrate_docker_with_dockerHelsinki dockermeetup 12102017-orchestrate_docker_with_docker
Helsinki dockermeetup 12102017-orchestrate_docker_with_docker
 
Higher order infrastructure: from Docker basics to cluster management - Nicol...
Higher order infrastructure: from Docker basics to cluster management - Nicol...Higher order infrastructure: from Docker basics to cluster management - Nicol...
Higher order infrastructure: from Docker basics to cluster management - Nicol...
 
Why Airflow? & What's new in Airflow 2.3?
Why Airflow? & What's new in Airflow 2.3?Why Airflow? & What's new in Airflow 2.3?
Why Airflow? & What's new in Airflow 2.3?
 
Docker swarm - An introduction to Docker native clustering
Docker swarm - An introduction to Docker native clusteringDocker swarm - An introduction to Docker native clustering
Docker swarm - An introduction to Docker native clustering
 
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz LachJDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
 
What's new in Airflow 2.3?
What's new in Airflow 2.3?What's new in Airflow 2.3?
What's new in Airflow 2.3?
 
Pluggable Databases: What they will break and why you should use them anyway!
Pluggable Databases: What they will break and why you should use them anyway!Pluggable Databases: What they will break and why you should use them anyway!
Pluggable Databases: What they will break and why you should use them anyway!
 
Quartz.NET - Enterprise Job Scheduler for .NET Platform
Quartz.NET - Enterprise Job Scheduler for .NET PlatformQuartz.NET - Enterprise Job Scheduler for .NET Platform
Quartz.NET - Enterprise Job Scheduler for .NET Platform
 
Microservices with docker swarm and consul
Microservices with docker swarm and consulMicroservices with docker swarm and consul
Microservices with docker swarm and consul
 
Automatic docker service announcement with registrator and confd
Automatic docker service announcement with registrator and confdAutomatic docker service announcement with registrator and confd
Automatic docker service announcement with registrator and confd
 
Airflow Best Practises & Roadmap to Airflow 2.0
Airflow Best Practises & Roadmap to Airflow 2.0Airflow Best Practises & Roadmap to Airflow 2.0
Airflow Best Practises & Roadmap to Airflow 2.0
 
ApiOps Tampere meetup 17.11.2017- serverless_with_openfaas
ApiOps Tampere meetup 17.11.2017- serverless_with_openfaasApiOps Tampere meetup 17.11.2017- serverless_with_openfaas
ApiOps Tampere meetup 17.11.2017- serverless_with_openfaas
 
How Stuffle uses Docker for deployments
How Stuffle uses Docker for deploymentsHow Stuffle uses Docker for deployments
How Stuffle uses Docker for deployments
 
Start tracking your ruby infrastructure
Start tracking your ruby infrastructureStart tracking your ruby infrastructure
Start tracking your ruby infrastructure
 
Docker container management
Docker container managementDocker container management
Docker container management
 

Recently uploaded

AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
rknatarajan
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 

Recently uploaded (20)

The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 

visualization of Docker metrics