SlideShare a Scribd company logo
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

PDF
Scala45 spray test
ODP
Understanding Spark Structured Streaming
ODP
Introduction to Akka Streams [Part-II]
ODP
Introduction to Akka Streams [Part-I]
PPT
Asynchronous handlers in asp.net
PDF
Gatling @ Scala.Io 2013
PDF
OpenTox API introductory presentation
KEY
How and why i roll my own node.js framework
Scala45 spray test
Understanding Spark Structured Streaming
Introduction to Akka Streams [Part-II]
Introduction to Akka Streams [Part-I]
Asynchronous handlers in asp.net
Gatling @ Scala.Io 2013
OpenTox API introductory presentation
How and why i roll my own node.js framework

What's hot (17)

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

Viewers also liked (20)

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

Similar to visualization of Docker metrics (20)

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

Recently uploaded (20)

PPTX
Feature types and data preprocessing steps
PDF
Abrasive, erosive and cavitation wear.pdf
PDF
22EC502-MICROCONTROLLER AND INTERFACING-8051 MICROCONTROLLER.pdf
PDF
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
PPTX
Chemical Technological Processes, Feasibility Study and Chemical Process Indu...
PDF
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
PDF
Improvement effect of pyrolyzed agro-food biochar on the properties of.pdf
PDF
Visual Aids for Exploratory Data Analysis.pdf
PDF
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
PDF
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
PPTX
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
PPT
Total quality management ppt for engineering students
PDF
distributed database system" (DDBS) is often used to refer to both the distri...
PDF
August 2025 - Top 10 Read Articles in Network Security & Its Applications
PDF
Categorization of Factors Affecting Classification Algorithms Selection
PPTX
Information Storage and Retrieval Techniques Unit III
PDF
III.4.1.2_The_Space_Environment.p pdffdf
PDF
Exploratory_Data_Analysis_Fundamentals.pdf
PPTX
introduction to high performance computing
PPTX
Management Information system : MIS-e-Business Systems.pptx
Feature types and data preprocessing steps
Abrasive, erosive and cavitation wear.pdf
22EC502-MICROCONTROLLER AND INTERFACING-8051 MICROCONTROLLER.pdf
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
Chemical Technological Processes, Feasibility Study and Chemical Process Indu...
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
Improvement effect of pyrolyzed agro-food biochar on the properties of.pdf
Visual Aids for Exploratory Data Analysis.pdf
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
Total quality management ppt for engineering students
distributed database system" (DDBS) is often used to refer to both the distri...
August 2025 - Top 10 Read Articles in Network Security & Its Applications
Categorization of Factors Affecting Classification Algorithms Selection
Information Storage and Retrieval Techniques Unit III
III.4.1.2_The_Space_Environment.p pdffdf
Exploratory_Data_Analysis_Fundamentals.pdf
introduction to high performance computing
Management Information system : MIS-e-Business Systems.pptx

visualization of Docker metrics