The aim of this workshop is to provide a hands-on experience with monitoring Docker containers using Grafana Alloy, Prometheus and Loki. The workshop is divided into 4 parts:
- Part 1: Setting up the monitoring stack (Deploying Grafana Alloy, Prometheus and Loki)
- Part 2: Monitoring Docker Metrics (Use Alloy and cAdvisor to monitor Docker metrics)
- Part 3: Monitoring Docker Logs (Use Alloy to monitor Docker logs)
- Part 5: Building a custom Grafana dashboard (Combine metrics and logs in a custom Grafana dashboard)
- Docker
- Docker Compose
- Git
git clone https://github.com/grafana/docker-monitor-workshop.git
cd docker-monitor-workshop
docker-compose up -d
Open your browser and go to http://localhost:12345
. This should show you a plank Alloy UI.
Take the class through building the Alloy config for metrics. Couple of fun facts:
- You can build an Alloy config from
right
toleft
(output to input) if you would like to show them the Alloy UI after each component is added to the config. - Completed Alloy config can be found in
completed
folder. - There are two ways to reload the Alloy config:
- Restart the Alloy container
- Use the
reload
API endpointcurl -X POST http://localhost:12345/-/reload
Same as above, but for logs.
Both Explore Metrics and Explore Logs are preinstalled in the Grafana instance. The other option is to build a custom dashboard using the Grafana UI.
Currently the workshop will monitor the containers deployed which most likely will be the Grafana Alloy, Prometheus and Loki containers. If you would like to make the workshop more interesting, you can deploy a few more containers and monitor them using Alloy. Included is the greenhouse microservices demo.
docker compose -f "greenhouse/docker-compose-micro.yml" up -d --build