Full Observability Stack: Metrics, Logs & Traces Correlation
Expert · 60 minutes · 100 points
Build a complete observability pipeline from scratch inside a single container. You will instrument a Python application to emit Prometheus-style metrics, structured JSON logs, and OpenTelemetry-compatible trace data. Then you will wire up correlation IDs so that a single request can be tracked across all three observability pillars — metrics, logs, and traces — simulating the foundation of a production-grade observability stack.
What you’ll learn
- Instrument a Python Flask application to expose Prometheus metrics including request counters and latency histograms
- Implement structured JSON logging with trace correlation IDs so every log line is linkable to a specific trace span
- Generate OpenTelemetry-compatible trace data written to disk and verify end-to-end correlation across metrics, logs, and traces using a shared request ID
How this lab works
- Start the lab: One click starts a container on your computer with a real terminal: nothing to install by hand, nothing to clean up.
- Work through 3 tasks: Each task says what to build or fix. You do it yourself, in a real terminal, with hints when you get stuck.
- Check your work: Check my work runs each task’s checks in your container and says what passed and what to fix.
- Finish and keep going: 100 points, your progress saved, and the next lab to try.
What it runs on
- Runs: A container on your computer, with a real terminal
- Image: ubuntu:22.04
What you need
- A free LearnXops account
- The LearnXops desktop app for macOS, Windows or Linux
- Docker Desktop installed and running
- At least 2GB free disk space
- Internet access for package installation
Topics: observability, prometheus, opentelemetry, structured-logging, tracing, metrics, correlation, flask, python, monitoring
Create a free account to start this lab.
Keep going
- Build an Alert Similarity Graph and Incident Grouping with NetworkX and Louvain Community Detection
- Service Dependency Graph Analysis with Distributed Tracing and Fault Injection
- Long-Term Metrics Storage with Thanos
- Cortex for Multi-Tenant Prometheus
- Continuous Profiling with Pyroscope
- eBPF-Based Observability with Hubble