Skip to Content
Dapr学习手册
book

Dapr学习手册

by Haishi Bai, Yaron Schneider
November 2021
Beginner to intermediate
239 pages
4h 15m
Chinese
China Electric Power Press Ltd.
Content preview from Dapr学习手册
服务
75
这里描述的注册过程很可能在未来的版本中被取消。在撰写本书时,只支持
HTTP
中间件,但我们计划在未来的版本中也支持
gRPC
中间件。
1.6
分布式追踪
诊断分布式应用中的故障是非常有挑战的。你需要从多个服务收集跟踪,并
建立日志条目之间的相关性,以复原完整的调用链。这是一项艰巨的任务,
特别是在一个拥有几十个甚至几百个服务的大规模系统中,在这里每秒钟都
有数百万个事务。
Dapr
会使应用拓扑结构变得更加复杂,因为它在所有参与的服务周围插入了
sidecar
。另外,因为
Dapr
注入了
sidecar
,这可以为诊断提供帮助。由于所有
的流量都流经
Dapr sidecar
Dapr
可以自动建立请求之间的相关性,并将分
布式跟踪收集到一个统一的视图中。
Dapr
利用
OpenTelemetry
https://oreil.
ly/7eqRA
)来实现这一点。
使用
Dapr
分布式跟踪的另一个好处是,服务代码不需要被检测,也不需要包
含任何跟踪类库。所有方法调用都会被
Dapr
自动跟踪。而且因为跟踪配置是
完全独立的,所以改变或重新配置跟踪系统不会影响运行中的应用程序。在
撰写本书时,
Dapr
并没有向用户服务暴露跟踪
API
以满足额外的跟踪需求。
然而,在
Dapr
中是否需要暴露这样一个
API
已经讨论过了。
1.6.1
追踪中间件
Dapr
分布式跟踪是一个中间件,可以插入到任何
Dapr sidecar
中。它可以工
作在
HTTP
gRPC
协议下。该中间件围绕两个关键概念构建:
span
和关联
ID
1.6.1.1 Span
Span ...
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

流畅的Python(第2版)

流畅的Python(第2版)

Luciano Ramalho
数据科学原理

数据科学原理

Posts & Telecom Press, Sinan Ozdemir
Python预测分析实战

Python预测分析实战

Posts & Telecom Press, Alvaro Fuentes
机器学习开发者指南

机器学习开发者指南

Posts & Telecom Press, Rodolfo Bonnin

Publisher Resources

ISBN: 9787519859367