Imagine this: You finally get a moment to relax and start your favorite movie. Just as the tension builds, the screen freezes. It comes back — then freezes again. What should be an enjoyable evening quickly becomes a frustrating cycle of interruptions.
Meanwhile, on the backend, an engineer sees that something is slowing the system down. What they are dealing with, however, is far from a simple application with a few hundred lines of code. Instead, the streaming platform is made up of many so-called microservices working together. For example, some services retrieve video chunks from storage, while database services store personalized settings, watchlists, and preferences, and orchestration services coordinate multiple streaming tasks such as buffering, caching, and segment requests. Each service may call a bunch of other services, usually shown as a call graph with arrows pointing from one service to the services it calls.

Figure 1: Example of a microservice architecture adapted from the dowhy package.[1]
Figure 1 shows an example of such a graph, including an S3 instance storing files and an AWS Lambda service that runs code when something triggers it — for instance, when you press play.
In reality, there are thousands of services and connections between the services, and no one knows the full shape of the graph. This makes tracing down the source of the failure far from trivial. For example, a database might be missing some entries by mistake, which then causes errors to ripple through the services it feeds — one after another — and the problem may only become obvious after dozens of services are already affected.
Root Cause Analysis (RCA)
Fortunately, each service generates lots of useful data:
- Metrics such as CPU, latency, or queue length
- Logs capturing events and errors.
These data can be used to build the call graph, since services with highly correlated metrics are likely connected. More formally, we can model the call-callee relationship linearly:
$$X_i = \sum_{j\in C_i} a_{ij} X_j + N_i$$
Xi stands for the data collected from service i, Ci is the group of services that call it, and Ni accounts for minor random fluctuations. The coefficients aij describe the strength of influence one service has on another. The metric Xi depends on the services that call it, not the other way around, because if one service experiences high computational load — like many users streaming on a website — that load propagates downstream to all services it calls, and then further along the chain.
Using this model, we can first gather data from a period when everything was working normally and learn the graph via a causal discovery algorithm. Later, if an incident occurs, we can search for a service exhibiting unusual behavior — such as high latency — while its callers appear normal, indicating where the issue likely started.[2] The approach is intuitive, but with a very large number of services (often more than the sample size), learning the graph becomes increasingly difficult and computationally expensive.
Therefore, our approach aims to bypass learning the entire graph and instead directly search for the root cause. In particular, we employ the fact that the covariance matrix of the data, where everything worked as usual, is calculated as
$$\Sigma = (I-A)^{-1}\Sigma_N (I-A)^{-T}$$
In here, the matrix A=(aij) collects the linear coefficients and ΣN is the covariance of the noise terms. This shows that the covariance indirectly encodes both the graph structure and the strengths of the effects. Building on the intuition that we can pinpoint the root cause by looking at data from the failure period and taking the graphical structure into account, we define the vector
$$\xi=\Sigma^{-1}\tilde{X}$$
where X̃ is a vector with one metric for each service, from the first time point where the failure occurred. Indeed, in the paper we show that in this vector ξ the dependencies are effectively reversed: In X̃, the entries corresponding to the root cause and all its subsequent services — i.e., services that call it directly or indirectly — appear as outliers. In contrast, in ξ, the root cause and all services that are called by the root cause are outlying. By intersecting the indices of outliers in both X̃ and Σ-1X̃, we can accurately identify the original root cause. If you are interested in further details or want to see how the same methodology can be applied in genetics research, check out this paper[3].
Image sources
- Cover Photo by Freestocks on Unsplash
References
[1] Sharma, A., & Kiciman, E. (2020). DoWhy: An End-to-End Library for Causal Inference. Arxiv Preprint. ↩
[2] Orachard et al. (2025). Root Cause Analysis of Outliers with Missing Structural Knowledge. In: The Proceedings of the Thirty-ninth Annual Conference on Neural Information Processing Systems. ↩
[3] Schkoda, D. & Janzing, D. (2026). Root Cause Analysis of Outliers in Unknown Cyclic Graphs. In: The Proceedings of the 29th International Conference on Artificial Intelligence and Statistics. ↩















