• Home
  • Docker
  • Kubernetes
  • Java
  • Ubuntu
  • Maven
  • Big Data
  • CI
  • Install
  • Samples
  • Archived
Docker | Prometheus
  1. Notes
  2. Configure Docker
  3. Start Prometheus
  4. Use Prometheus

  1. Notes
    Please see this page for more information: https://docs.docker.com/config/daemon/prometheus/

    Prometheus is an open-source systems monitoring. It gathers information from endpoints. You can configure Docker as a Prometheus target. You can only monitor Docker itself. You cannot currently monitor your application using the Docker target.
  2. Configure Docker
    Docker integration with Prometheus is experimental and not enabled in the dockerd server by default. You need to configure the dockerd server to enabled the experimental features and expose the metrics address. The configuration can be done using the "experimental" and "metrics-addr" options.

    The options "--experimental" and "--metrics-addr" can be set on the command line (systemd) when starting the dockerd server (/lib/systemd/system/docker.service).

    They can also be put into the "daemon.json" file. The "daemon.json" file can be located in: "/etc/docker/daemon.json". Note that it might not be created by default when you install Docker.


    Restart Docker:

    Prometheus will connect to the port "9323" to get metrics (a listener will be listening on all addresses on port 9323).

    To validate the endpoint:

  3. Start Prometheus
    Copy the following configuration and save it to "/tmp/prometheus.yml":

    Start Prometheus container:

  4. Use Prometheus
    Verify that the Docker target is listed at http://192.168.2.22:9090/targets/:
    Prometheus - Targets

    Click on Graph an select a metric and click Execute: http://192.168.2.22:9090/graph
    Prometheus - Graph
© 2025  mtitek