Docker Compose lab for learning traces, metrics, and logs with a small Python app, OpenTelemetry Collector, and Grafana LGTM components.
- How an app emits telemetry
- What the OpenTelemetry Collector does
- How traces, logs, and metrics fit together
- How to run a local observability stack without cloud cost
flowchart LR
Browser["Browser or curl"] --> App["Python demo app"]
App --> Collector["OpenTelemetry Collector"]
Collector --> Prometheus["Prometheus metrics"]
Collector --> Tempo["Tempo traces"]
Prometheus --> Grafana["Grafana dashboards"]
Tempo --> Grafana
- Docker
- Docker Compose plugin
make validate
make up
make logs
make downOpen:
- App:
http://localhost:8080 - Grafana:
http://localhost:3000withadmin/admin - Prometheus:
http://localhost:9090
Generate traffic:
curl http://localhost:8080/
curl http://localhost:8080/slow
curl http://localhost:8080/errormake validateThis runs docker compose config so students catch indentation, service, port, and volume mistakes before starting the stack.
- Port conflict on
3000,8080, or9090: stop the other local service or edit the left side of the port mapping indocker-compose.yml. - Grafana has no data: run the
curlcommands above, then refresh Explore or dashboards. - Collector cannot start: check
otel-collector.yamlwithmake logsand confirm the mounted file path exists. - Images take time on first run: the first
make uppulls Grafana, Tempo, Prometheus, and Collector images.
make downThis stops the containers and removes lab volumes so the next run starts clean.
- Add a new endpoint and create a custom span.
- Add a dashboard panel for request count.
- Change the collector pipeline to drop noisy logs.
- Add an alert for repeated
/errorcalls.