Executive Summary
Distributed tracing is an essential diagnostic tool for microservice architectures, providing visibility into request paths across complex service webs. However, the overhead associated with recording every "span" (function call) is often prohibitive, impacting CPU, storage, and network performance. This paper introduces Astraea, an online system that leverages machine learning to selectively enable instrumentation. By identifying the small subset of "vital" spans that explain the majority of performance variations, Astraea reduces tracing overhead by up to 24x while maintaining 92% diagnostic accuracy.
The Challenge: The High Cost of Visibility
In modern cloud environments, a single user request can trigger hundreds of internal operations. Capturing the full trace of these operations is resource-intensive. For instance, industry reports have noted latency increases of over 16% in search applications due solely to tracing overhead, with tail latency impact being even more severe.
The fundamental problem is that most tracing data is redundant for troubleshooting. Analysis of production traces reveals that approximately 90% of spans do not contribute useful information for explaining performance anomalies. The difficulty lies in identifying the "vital" 10% in real-time, as these spans change dynamically with code updates and traffic shifts.
The Astraea Approach: Online Probabilistic Tracing
Astraea addresses this by treating tracing as an "exploration vs. exploitation" problem, managed through a multi-armed bandit framework.
- Online Bayesian Learning: Astraea models the utility of each span using Beta distributions. This allows the system to quantify uncertainty; spans with limited observations have wider distributions, prompting further "exploration."
- Multi-Armed Bandit (ABS): Using Approximate Bayesian Sampling, the system calculates the probability that a span belongs to the "vital set"—those spans contributing most to latency variance.
- Probabilistic Control: Instead of binary switches, Astraea assigns sampling probabilities. Highly useful spans are traced frequently (e.g., 90%), while others are sampled at a low "exploration" rate (e.g., 5%).
- Zero-Offline Training: Unlike previous methods requiring lab-based profiling, Astraea learns directly from production traffic, making it highly adaptable to changing environments.
Key Insights: The 80/20 Rule of Latency
The researchers confirmed that roughly 15% of spans account for over 80% of total latency variance. Astraea focuses its resources on this critical minority. Furthermore, by maintaining causal context (parent-child relationships), Astraea can pinpoint which specific child span is responsible for a parent service's delay, steering instrumentation more effectively than per-process logging tools.
Results and Performance
Astraea was evaluated using microservice benchmarks (Social Network, Media, Train Ticket) and large-scale production datasets. Key findings include:
- Accuracy: The system localized injected performance faults with 92% average accuracy.
- Efficiency: Astraea achieved this while enabling only 10–28% of available instrumentation, resulting in 3–24x lower latency overhead compared to state-of-the-art baselines like VAIF and Log².
- Scalability: Inference for traces with over 500 spans was completed in under 100ms, demonstrating readiness for internet-scale traffic.
Limitations and Future Outlook
While highly effective for performance-related issues, Astraea is currently latency-centric. It may overlook functional errors that do not impact timing. Future work involves expanding the "utility" definition to include error rates or business-specific metrics. Additionally, while currently implemented on Jaeger, the underlying logic is designed to be framework-agnostic.
Paper Citation: M. Toslali, S. Qasim, et al., "An Online Probabilistic Distributed Tracing System," arXiv:2405.15645v1 [cs.PF], May 2024.
Summary updated