It's a simple example, template of usage stack Nginx, Prometheus (Node Exporter, Nginx Exporter, Cadvisor) and Grafana.
- Nginx with https - selfsigned certificate.
- Prometheus for storing metrics.
- Prometheus-node-exporter for monitoring your operating system.
- Prometheus-nginx-exporter for monitoring your nginx.
- Cadvisor for monitoring your containers.
- Grafana to visualize data.
- Clone repository to your working directory:
https://github.com/rvva/nginx-prometheus-grafana/
- Create Prometheus and Grafana data directory:
mkdir -p nginx-prometheus-grafana/{prometheus,grafana}/data mkdir nginx-prometheus-grafana/nginx/log
- Configure .env file
Modify GF_SECURITY_ADMIN parameters to set your personal Grafana credentials.
- Run it!
docker-compose up -d
- Login into Grafana localhost:3000 and add Data Source -> Prometheus.
- As url address use
http://prometheus:9090
- Add dashboards. I recommend you:
- for nginx: https://grafana.com/grafana/dashboards/12708
- for cadvisor: https://grafana.com/grafana/dashboards/13946
- for node: https://grafana.com/grafana/dashboards/1860