Software Engineering
New Framework Smartly Samples Traces and Logs to Catch Microservice Failures
UniSage combines trace and log sampling with lightweight analysis to preserve diagnostic evidence while cutting storage costs in distributed systems.
Microservice systems generate enormous volumes of diagnostic traces and logs, yet keeping them all is costly. A new research paper introduces UniSage, a sampling framework that intelligently decides what to retain by understanding which data matters most for diagnosing failures.
The Problem with Current Approaches#
Most sampling methods operate in a "collect-then-discard" mode: data is filtered before anyone knows whether it holds evidence needed for diagnosis. This risks losing the very signals that could explain what went wrong. Additionally, existing systems typically focus on sampling traces alone, treating logs as a separate concern. This breaks the connection between anomalous transaction flows and the error messages that explain them.
How UniSage Works#
UniSage takes a different approach by embedding lightweight analysis into the sampling pipeline itself. Rather than blindly filtering, the framework evaluates the diagnostic value of data as it arrives and decides retention based on that assessment.
Critically, UniSage treats traces and logs as a unified whole. By exploiting correlations between these two signal types—recognizing that a trace showing a failed request often relates to specific log entries—the system can make smarter retention choices that keep both pieces of evidence together when they matter.
Results and Performance#
Testing on three datasets of real microservice traffic showed consistent improvements. At just 5% of full data volume, UniSage retained 6.8% to 22.0% more diagnostic-quality traces than competing baselines and achieved the best log recall on datasets where ground truth was labeled. Overhead remained modest across tested workloads, suggesting the approach is practical for production use.