arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2508.11342cs.NI
收藏

CrossTrace:面向微服务的分布式追踪中高效的跨线程与跨服务 Span 关联

CrossTrace: Efficient Cross-Thread and Cross-Service Span Correlation in Distributed Tracing for Microservices

Linh-An Phan, MingXue Wang, Guangyu Wu, Wang Dawei, Chen Liqun, Li Jin

AI总结:

本文提出 CrossTrace,一种无需修改源代码的分布式追踪解决方案,通过贪心算法推断服务内 span 关系并利用 eBPF 将标识符嵌入 TCP 头部实现跨服务关联,在几秒内以超 90% 准确率关联数千个 span,适用于生产部署。

摘要:

分布式追踪已成为调试和排查现代基于微服务的应用程序的关键技术,使软件工程师能够检测性能瓶颈、识别故障并深入了解系统行为。然而,由于需要大量的插桩,在大型应用中实现分布式追踪仍然具有挑战性。为了减轻这一负担,基于 eBPF 的零代码插桩解决方案应运而生,允许在不修改应用代码的情况下收集 span 数据。尽管前景广阔,但 span 关联(即建立 span 之间因果关系的过程)仍然是零代码方法面临的关键挑战。现有解决方案通常依赖线程亲和性、通过要求禁用内核完整性模式而损害系统安全性,或者由于复杂的推理算法而产生显著的计算开销。本文提出了 CrossTrace,这是一种实用且高效的分布式追踪解决方案,旨在支持在不修改源代码的情况下调试微服务应用。CrossTrace 采用贪心算法从延迟模式中推断服务内 span 关系,从而消除对线程标识符的依赖。对于服务间关联,CrossTrace 通过 eBPF 将 span 标识符嵌入 TCP 数据包头部,实现安全高效的关联而不损害系统安全策略。评估结果表明,CrossTrace 能够在几秒内以超过 90% 的准确率关联数千个 span,使其适用于生产部署,对微服务可观测性和诊断具有重要价值。

英文摘要:

Distributed tracing has become an essential technique for debugging and troubleshooting modern microservice-based applications, enabling software engineers to detect performance bottlenecks, identify failures, and gain insights into system behavior. However, implementing distributed tracing in large-scale applications remains challenging due to the need for extensive instrumentation. To reduce this burden, zero-code instrumentation solutions, such as those based on eBPF, have emerged, allowing span data to be collected without modifying application code. Despite this promise, span correlation, the process of establishing causal relationships between spans, remains a critical challenge in zero-code approaches. Existing solutions often rely on thread affinity, compromise system security by requiring the kernel integrity mode to be disabled, or incur significant computational overhead due to complex inference algorithms. This paper presents CrossTrace, a practical and efficient distributed tracing solution designed to support the debugging of microservice applications without requiring source code modifications. CrossTrace employs a greedy algorithm to infer intra-service span relationships from delay patterns, eliminating reliance on thread identifiers. For inter-service correlation, CrossTrace embeds span identifiers into TCP packet headers via eBPF, enabling secure and efficient correlation compromising system security policies. Evaluation results show that CrossTrace can correlate thousands of spans within seconds with over 90% accuracy, making it suitable for production deployment and valuable for microservice observability and diagnosis.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑