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" : "127.0.0.1:9323", "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.