Skip to Content
可观测性工程
book

可观测性工程

by Charity Majors, Liz Fong-Jones, George Miranda
July 2023
Beginner to intermediate
270 pages
4h 48m
Chinese
China Machine Press
Content preview from 可观测性工程
58
6
将事件拼接成链路
5
章探讨了事件成为可观测系统基本
构建块
的原因,本章将演示如何把事件拼接成
链路(
trace
。近十年来,分布式链路追踪已经成为软件研发团队必不可少的故障排查
工具。
分布式链路追踪仅是一系列存在关联关系的事件。分布式链路追踪系统提供依赖包,能
自动创建并管理这些事件的关联关系。用于创建和追踪不关联事件的概念有很多,这些
概念能应用到的场景也很多,已经远超传统的链路追踪场景。为了进一步探究可观测系
统的可能性,必须研究链路追踪系统的内部原理。
本章将通过检查分布式链路追踪的核心组件及其对可观测系统的重要性,深入浅出地讲
解分布式链路追踪。我们将解释链路组件,并通过代码示例演示合成链路的步骤和链路
组件的工作原理。通过向链路事件(或
span
)添加相关数据的示例来讲解为什么需要该
数据。最后,在展示完如何手动创建一条链路后,将该方法应用到非传统的链路案例中
(例如拼接日志事件)
6.1 分布式链路追踪及其重要性
链路追踪是一种重要的软件调试技术,在整个程序执行过程中记录各种各样的信息,以
诊断问题。自两台计算机连接并交换信息的第一天开始,软件工程师就在不断地发现程
序或者协议中的各种“小魔怪”。无论付出多少努力,这些“小魔怪”都总能分散在“细
缝”中,而且在分布式系统成为规范的年代,使用的调试技术必须不断发展才能适应日
益复杂的需求。
分布式链路追踪是追踪单一请求整个过程(链路)的一种方式,且该请求过程可能经过
一个应用中的多个服务。为了满足功能,请求可能要跨进程、机器甚至网络边界,这也 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

可观察性工程

可观察性工程

Charity Majors, Liz Fong-Jones, George Miranda
What Successful Project Managers Do

What Successful Project Managers Do

W. Scott Cameron, Jeffrey S. Russell, Edward J. Hoffman, Alexander Laufer

Publisher Resources

ISBN: 9787111729099