At work, we have been busy playing around with Docker (initially for development environments, with a view to bump these into higher environments further down the track.
I wanted to get some performance metrics for my running docker containers. Below is a recipe that I ended up using (which may be of interest to others).
The Code
https://github.com/gavinjackson/docker-metrics
How it Works
It consists of the following four containers (defined in the docker-compose.yml file):
- cadvisor collects container stats
- node-exporter collects physical hardware stats.
- prometheus harvests this data.
- grafana is configured to consume data from the prometheus server and present some pre-made dashboards to visualise the data.
Once running, this is what the dashboards look like:
The cool thing about this is that you can copy this into your existing docker project and you will get instant metrics for all of your running containers (and host system).
Interesting links:
cadvisor - the magical container that extracts the docker container metrics https://github.com/google/cadvisor
node-exporter - the container that harvests the host metrics https://github.com/prometheus/node_exporter
prometheus - the tool that collects this data https://prometheus.io/
grafana - the time based visualisation layer that draws it's data from prometheus https://grafana.com/
The following grafana dashboards were provisioned:
- https://grafana.com/grafana/dashboards/1860 Node Exporter Full, and
- https://grafana.com/grafana/dashboards/893 Docker and system Monitoring
- https://grafana.com/grafana/dashboards/8321 Docker monitoring with node selection

