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 可观测性工程
将事件拼接成链路
|
61
Parent ID
这个字段用来区别链路整个生命周期内的嵌套包含关系。当然根
span
中不存在
Parent ID
(这就是我们知道它是根的原因)
时间戳
每个
span
都必须展示开始时间。
执行时长
每个
span
都必须记录工作开始到结束时花费的时长。
这些字段对于构成一个链路都是必需的,当然有的系统可能也需要其他字段来更有效地
标识
span
。任何添加到
span
的额外信息都是一系列的标签。
这里有一些示例:
服务名
出于调查的目的,可以有展示服务名称的需求。
span
为了理解每个阶段的关联性,给
span
命名有助于标识和区别不同的工作,例如,如
果它们表示同一服务或网络跃点(
network hop
)内的不同工作流,那么可以命名为
intense_computation1
或者
intense_computation2
使用以上数据可以构建所有请求的可视化的瀑布图,并快速定位任何问题。现在看一下
如何在代码中埋点来产生以上数据。
6.3 硬编码探针构建链路追踪
为了理解一条链路追踪的核心组件如何构建,我们将创建一个十分简单的手动链路追踪
系统的示例。分布式链路追踪系统中的大多数信息都被添加到链路上,旨在让链路数据
更具可用性。例如,在将链路发送给后端数据存储前,用户可能想要使用其他元数据丰
富链路(详见第
16
章)
如果想从 0 开始做一个苹果派,你可能需要先创造出一个宇宙来。
卡尔
·
萨根
出于演示目的,假设存在后端服务存储数据,那就仅需要关注在客户端上的探针。先假
设数据可以通过
HTTP
发送到系统。
假设有一个简易的 ...
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