Difficulty: beginner
Estimated Time: 10-15 minutes

With Docker 1.13, they introduced an experimental feature that allows the Docker Engine metrics to be exported using the Prometheus syntax.

Prometheus is an open source monitoring system and time series database. It's defined to collect metrics from multiple sources, such as the Operating System, MySQL or ElasticSearch, across multiple servers within your clusters. These metrics can then be graphed and displayed on a dashboard using Prometheus itself or tooling such as Grafana.

The Docker Engine metrics will include a number of containers started, stopped, created and deleted. This allows users to collect and visualise a Docker hosts activity.

Graphing Docker 1.13 metrics with Prometheus

Step 1 of 5

Step 1 - Enable Metrics

The first task is to enable the new experimental flag that will enable the metrics feature and define the metrics address to listen on localhost:9323.

The command below will update the systemd configuration used to start Docker to set the flags when the daemon starts and then restarts Docker.

echo '{ "metrics-addr" : "", "experimental" : true }' > /etc/docker/daemon.json
systemctl restart docker

The metrics endpoint will be accessible once Docker has begun. You can see the raw metrics using curl localhost:9323/metrics

These metrics are outputted in the Prometheus format and designed to be scraped by a Prometheus server which will launch in the next steps.