Simple application to expose Docker container running state as Prometheus metrics.
By default, exposes metrics on all interfaces, port 12345
From the source directory, run go build
From the source directory, run docker build -t docker-exporter .
No configuration is required; run the binary on the local machine.
There are two key things here: mounting the Docker daemon socket to the container and exposing the Prometheus metrics endpoint
Because Docker does not give access to information out of the box, we can override values via environment variables.
HOSTNAME
allows us to override the host found inos.Hostname()