Introduction
In modern cloud environments, microservice architectures have introduced significant complexity to debugging. Developers frequently use "error wrapping" (common in languages like Go and Rust) to preserve context as an error moves up the call stack. While this creates a rich diagnostic trail, it leads to a phenomenon known as Error Obfuscation. When these errors are finally logged, the hierarchical structure is flattened into a single text string, making it a nightmare for Site Reliability Engineers (SREs) to trace the log back to the specific line of code that triggered the failure.
Methodology: The ErrorPrism Framework
ErrorPrism is a hybrid framework designed to reconstruct these complex error propagation paths by combining the structural precision of offline static analysis with the semantic reasoning of Large Language Models (LLMs).
The system operates in three distinct phases:
- Code Repository Static Analysis: The system builds a Function Call Graph (FCG) and extracts string constants to compute a Constant Transitive Closure. This pre-computed index maps which functions can indirectly contribute specific string fragments to a log message, drastically pruning the search space for subsequent steps.
- Log Template Extraction: Using the Drain3 algorithm, ErrorPrism distills millions of raw logs into unique templates. This separates static text from dynamic variables, allowing the system to focus on the structural "fingerprint" of the error.
- LLM-guided Iterative Tracking: ErrorPrism employs an LLM agent using the ReAct framework to act as a virtual SRE. Starting from the log entry, it performs a backward Breadth-First Search (BFS) using a specialized toolbox of functions.
LLM-Guided Reasoning
The core innovation lies in the LLM's ability to perform deep semantic reasoning on the logic where static analysis might fail, such as bridging "broken" paths in asynchronous calls or RPCs.
The agent utilizes tools like view_callee_closure to see potential matching paths and check_function_code to analyze logic. This hybrid approach ensures that static analysis acts as a filter to "narrow the field," while the LLM provides the final semantic resolution.
Evaluation and Key Results
The authors evaluated ErrorPrism using production data from ByteDance, encompassing 67 microservices (nearly 1 million lines of Go code) and over 3 million raw error logs. The ground truth was established through a benchmark of 102 distinct real-world error events manually verified by developers.
- Effectiveness: ErrorPrism achieved 97.0% accuracy in reconstructing full propagation paths, significantly outperforming pure static analysis (90.7%) and pure LLM approaches (50.5%).
- Efficiency: The average inference time was 5.93 seconds, roughly 8.4x faster than general-purpose software engineering agents.
- Robustness: On complex paths with 4 or more hops, ErrorPrism maintained an accuracy of 85.7%, where traditional methods typically fail.
Conclusion
ErrorPrism demonstrates that the most effective way to handle error obfuscation in microservices is not to rely on a single technique, but to bridge the gap between static code structure and dynamic log semantics. By using static analysis to prune the search space and LLMs to resolve ambiguity, ErrorPrism provides a scalable, accurate solution for automated root-cause analysis in cloud-scale systems.
Summary updated