Quick installation
Requirements
As PDCE is for getting docker metrics, Docker must be installed on the machine.
To get a secure connection between PDCE and Prometheus, you should also have openssl installed.
Some explanations
To get all that working, you must have a monitored server, the one which contains a Docker environment with it's containers you want to be monitored by your Prometheus/Grafana installation. PDCE is installed on it, and run a simple server in the port 9100, secured by an autogenerated SSL certificate, with Basic Auth authentification.
In another hand, you must run a Prometheus server. For each PDCE monitored instance, Prometheus must have a configuration, composed of the private key, and the login/password for the Basic Auth.
Install & launch the Exporter
# install and lauch the exporter
git clone git@gitlab.com:prometheus-docker-exporter/prometheus-docker-exporter.git
cd ./prometheus-docker-exporter/app
./gen_certificate.sh
cd ..
cp .env-sample .env
# edit now .env, and change your credentials
docker-compose up -d
Configure Prometheus to gain access to you metrics
To configure Prometheus, you must edit a file called prometheus.yml. This file list all the monitored servers Prometheus parses. For each PDCE instance, you should add (under scrape_configs key), this configuration :
- job_name: # a human readable common name
scheme: https
tls_config:
ca_file: /etc/prometheus/node_exporter.cert # the certificate key you ust have copyied from the monitored server
insecure_skip_verify: true
basic_auth:
username: # The login you defined in PDCE .env file
password: #The password you defined in PDCE .env file
static_configs:
- targets: ['pdce_ip_or_domain:9100']
At this time, restart you Prometheus instance if necessary, you should see your metrics in Prometheus !