AutoScope: Code Knowledge Enhanced Span-level Sampling for Distributed Tracing
Open Access
- 24 July 2026
- journal article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Software Engineering and Methodology
Abstract
Distributed tracing is essential for observing microservices but incurs prohibitive storage costs. Existing solutions primarily rely on trace-level sampling, which indiscriminately discards entire traces based on probability or tail latency. This coarse-grained approach often loses critical off-the-path anomalies and fails to retain normal baselines required for comparative diagnosis. To address these limitations, we introduce the concept of span-level sampling, a fine-grained paradigm that retains only essential spans rather than full traces. However, we identify a critical challenge in this new approach where naive span retention leads to structural ambiguity, as the removal of intermediate spans disrupts the graph topology and renders the remaining data useless for analysis. To resolve this, we propose AutoScope , a novel framework that leverages static code knowledge to enable structurally safe span-level sampling. AutoScope constructs a Bridged Call Site Control Flow Graph (CSCFG) to map runtime spans to static execution logic. By identifying Dominant Span Sets (DSS), it exploits the “Sample One, Infer All” property to enable aggressive compression while preserving the structural skeleton of every request. Extensive evaluations on two benchmark microservice systems demonstrate that AutoScope achieves an 80.2% storage reduction while maintaining a state-of-the-art faulty span coverage of 98.1%. Furthermore, the reconstructed traces enhance downstream Root Cause Analysis (RCA) tasks, improving the Mean Reciprocal Rank (MRR) by an average of 8.3%.Keywords
All Related Versions
This publication has 11 references indexed in Scilit:
- Tai-e: A Developer-Friendly Static Analysis Framework for Java by Harnessing the Good Designs of Classics2023
- Eadro: An End-to-End Troubleshooting Framework for Microservices on Multi-source Data2023
- Deployment and communication patterns in microservice architectures: A systematic literature reviewJournal of Systems and Software, 2021
- Performance Characterization of Communication Protocols in Microservice Applications2021
- Grafana2021
- A Real-Time Trace-Level Root-Cause Diagnosis System in Alibaba DatacentersIEEE Access, 2019
- Fault Analysis and Debugging of Microservice Systems: Industrial Survey, Benchmark System, and Empirical StudyIEEE Transactions on Software Engineering, 2018
- TcpRT2018
- Betweenness centrality2013
- Static analysis for securityIEEE Security & Privacy, 2004