Skip to content
🎉 Launch sale:50% off everything over $22 — automatically applied at checkout· ends Aug 2Shop the sale →
DevOps AI ToolKit
Newsletter
advanced Premium Monitoring · ⏱ 50 min

Monitor Containers with Prometheus & Grafana

Scenario

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

  1. Download and unzip the lab.
  2. Start the stack: docker compose up -d.
  3. 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.

Unlock with Pro

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 completed
  • 1 — Validation failed
  • 2 — Required dependency missing
  • 3 — Lab environment not running
  • 4 — Configuration error
  • 5 — 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.

Upgrade to Pro

Reset the lab

  • docker compose down -v && docker compose up -d from 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.

Related labs