Monitor Containers with Prometheus & Grafana
Your team has no container visibility. Deploy a monitoring stack, collect host and container metrics, visualize them in Grafana, and configure an alert — then prove the alert condition triggers.
Learning objectives
- Deploy the monitoring services
- Collect host + container metrics
- Import a Grafana dashboard
- Configure an alert rule
- Validate the alert fires under load
Before you start
Required software: Docker Engine 24+ with Compose v2
Prerequisites: Docker Monitoring & Troubleshooting path
- Download and unzip the lab.
- Start the stack:
docker compose up -d. - Open Grafana at the URL in the README (default creds in README).
Instructions
Full instructions are part of Individual Pro
Unlock the step-by-step instructions, the solution guide, validation scripts, and downloadable files.
Hints
💡 Prometheus shows no container metrics
cAdvisor exposes container metrics on its own port — Prometheus must have a scrape job targeting it. Check prometheus.yml scrape_configs for a cadvisor target.
💡 How do I make the alert fire?
The lab includes a load generator. Set the alert threshold below the load it produces, then run it and watch the alert transition to firing.
Validate your work
From the lab folder, run:
bash validation/validate.sh The script reads only your local Docker state, never transmits data off your machine, and returns a status code:
0— Lab successfully completed1— Validation failed2— Required dependency missing3— Lab environment not running4— Configuration error5— Validation timed out
Note: validation targets Linux first. On Docker Desktop (macOS/Windows) some host-level checks (e.g. disk usage) may report differently; each script documents its limitations.
Solution
The full solution + troubleshooting explanation is available to Individual Pro members. Try to solve it first — that’s where the learning is.
Reset the lab
docker compose down -v && docker compose up -dfrom the original lab files restores the starting (broken) state.
Interview questions
- What do cAdvisor and node-exporter each provide?
- How does Prometheus discover what to scrape?
- What is the difference between a pending and firing alert?
Finished this lab?
Sign in to record your completion and track progress across the path. Completion is recorded server-side.