Service Dependency Graph Analysis with Distributed Tracing and Fault Injection
Expert · 60 minutes · 100 points
In this expert-level lab, you will build a service dependency graph from simulated distributed trace spans using Python and NetworkX. You will parse exported trace data, construct a directed graph of service call relationships, inject a latency fault into a target service, and implement a root-cause analysis algorithm that walks upstream from alerting services to rank the most likely culprit. This lab mirrors real-world SRE workflows for diagnosing cascading failures in microservice architectures.
What you’ll learn
- Parse and load exported distributed trace spans from a JSON dataset into a structured Python representation
- Build a directed service dependency graph using NetworkX from parent-child span relationships
- Inject a simulated latency fault into a specific service node and propagate anomaly flags downstream
- Implement an upstream-walking root-cause ranking algorithm using graph traversal and weighted scoring
- Identify and report the highest-ranked root-cause service from a set of alerting services
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 5 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
Topics: distributed-tracing, networkx, root-cause-analysis, graph-algorithms, fault-injection, microservices, SRE, observability, python, incident-response
Create a free account to start this lab.
Keep going
- Full Observability Stack: Metrics, Logs & Traces Correlation
- Build an Alert Similarity Graph and Incident Grouping with NetworkX and Louvain Community Detection
- Long-Term Metrics Storage with Thanos
- Cortex for Multi-Tenant Prometheus
- Continuous Profiling with Pyroscope
- eBPF-Based Observability with Hubble