Docker Monitoring Stack with Prometheus, Grafana, cAdvisor, NodeExporter and AlertManager
A comprehensive monitoring solution for Docker hosts and containers, utilizing Prometheus, Grafana, cAdvisor, NodeExporter, and AlertManager for alerting.
Clone this repository on your Docker host, navigate to the directory, and run the compose command:
git clone https://github.com/Divya4242/PAGNCstack.git
cd PAGNCstack
Prerequisites
• Docker Engine >= 1.13
• Docker Compose >= 1.11
-
Prometheus: It is an open-source systems monitoring and alerting toolkit. It collects and stores metrics as time series data. Port: 9090
-
Grafana: It is an open-source platform for monitoring and observability. It provides dashboards and visualizations for your data. Port: 3000
-
cAdvisor (Container Advisor): It provides container users an understanding of the resource usage and performance characteristics of their running containers. Port: 8085
-
AlertManager: Handles alerts sent by client applications such as Prometheus. It manages alerts, including silencing, inhibition, aggregation, and sending out notifications. Port: 9093
-
NodeExporter exposes hardware and OS metrics exposed by *nix kernels, which Prometheus can scrape. Port: 9100
Follow the steps in the alertmanager folder's README.md file before running Docker Compose.
docker-compose -f docker-compose.yml up -d
- Ensure all targets are up as shown in the image above.
-
Go to Grafana and add the Prometheus data source:
• Add the Prometheus server URL in the connection settings as shown in the image above.
• Click the "Save & Test" button at the bottom of grafana page.
-
Once the data source is successfully added, import the dashboard:
• Go to Dashboards -> Import -> Import via Dashboard JSON.
• Paste the contents of dashboard.json from the Grafana folder in this repository.
By following these steps, you can set up a robust monitoring stack for your Docker environments, providing insights and alerts to keep your services running smoothly.