A simple monitoring demonstration.
The following tools are used
- Prometheus to scrape all endpoints and store the data
- Grafana to visualize the data
- node_exporter to export machine metrics (host metrics)
- cAdvisor to analyze containers
You need to have docker-compose
on your system.
-
Clone the repository
git clone [email protected]:hbm/monitoring.git
-
Go into the newly created folder
cd monitoring
-
Start the containers
docker-compose up -d
-
Make sure all containers are running
docker-compose ps
-
Go to http://localhost:3000 to access Grafana. Username is
admin
and password is alsoadmin
. -
On the main screen click on the "Docker Prometheus Monitoring" dashboard.
-
In the end if you want to shut down everything run
docker-compose down
- node_exporter: http://localhost:9100
- cadvisor: http://localhost:8080
- prometheus: http://localhost:9090
As you can see everything is configured via .yml
files.
docker-compose.yml
If you want to add another service, e.g. backend application (Go, PHP, Python, Node.js, Java, etc.) or database/cache (PostgreSQL, Redis, etc.) this is where to add it.
prometheus/prometheus.yml
Do you want to add another scrape target? Change the scraping frequency? Do it here.
grafana/...
Change the datasource for Grafana or install a new dashboard.