--- url: "http://microservices.io/patterns/cn/observability/distributed-tracing.html" titulek: "Distributed tracing" h1: "Pattern: Distributed tracing" popis: "" jazyk: "" kanonicka: "" drobecky: [] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-13 21:11:34" znaku: 6082 slov: 347 kodovani: "iso-8859-2" sha256: "fa37591a831384d425e1f0dc3ecdc7cb8a0d020b97ff873506868a2b9b2a7545" --- #### [Chris Richardson 的微服务架构网站](/index.html) **本站由[Kong](https://konghq.com/)提供支持** #### 微服务架构咨询和培训服务 本站点由 Chris Richardson 编写和维护,他是经典技术著作《POJOS IN ACTION》一书的作者,也是 cloudfoundry.com 最初的创始人。Chris çš„ç ”çŠśé˘†ĺŸŸĺŒ…ć‹Ź Spring、Scala、微服务架构设计、领域驱动设计、NoSQL 数据库、分布式数据管理、事件驱动的应用编程等。Chris 是一位连续创业者,[eventuate.io](http://eventuate.io) 是他的最新创业项目,一个微服务应用和数据服务平台。 Chris 定期为企业提供微服务设计培训和实战项目的架构咨询服务。近年来 Chris 多次访问中国,为包括华为、SAPă€ćƒ ć™Žă€ä¸œéŁŽćą˝č˝Śç­‰ĺ¤§ĺž‹äźä¸šćäž›ĺžŽćœĺŠĄćžśćž„ç›¸ĺ…łçš„ćŠ€ćœŻĺ’¨čŻ˘ćœĺŠĄă€‚ĺŚ‚ć‚¨ĺ¸Œćœ›ä¸Ž Chris 深入交流,建立合作,请点击下方按钮跟他取得联系。 [预约课程](http://www.chrisrichardson.net/contactus.html) #### ĺžŽćœĺŠĄĺş”ç”¨çš„ç¤şäž‹äťŁç  为了避免纸上谈兵,Chris ćäž›äş†ä¸€ĺĽ—ä¸Žčż™äş›ć¨Ąĺźç›¸ĺ…łçš„ç¤şäž‹äťŁç ă€‚čż™çť„äťŁç ä˝żç”¨[eventuate](http://eventuate.io)框架,实现了微服务架构下分布式数据的存取。请点击下方按钮访问。 [čŽżé—ŽäťŁç ](http://eventuate.io/exampleapps.html) --- ### 模式库 ć ¸ĺżƒć¨Ąĺź - [单体架构](/patterns/cn/monolithic.html) - [微服务架构](/patterns/cn/microservices.html) 服务拆分 - [ć šćŽä¸šĺŠĄčƒ˝ĺŠ›ć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-business-capability.html) new - [ć šćŽé˘†ĺŸŸçš„ĺ­ĺŸŸć‹†ĺˆ†](/patterns/cn/decomposition/decompose-by-subdomain.html) new 部署模式 - [单主机上部署服务的多个实例](/patterns/cn/deployment/multiple-services-per-host.html) - [单主机上部署服务的单个实例](/patterns/cn/deployment/single-service-per-host.html) - [服务实例与虚拟机一一对应](/patterns/cn/deployment/service-per-vm.html) - [服务实例与容器一一对应](/patterns/cn/deployment/service-per-container.html) - [ć— ćœĺŠĄĺ™¨éƒ¨ç˝˛](/patterns/cn/deployment/serverless-deployment.html) - [服务部署平台](/patterns/cn/deployment/service-deployment-platform.html) new 需要关注的边界问题 - [微服务的基底](/patterns/cn/microservice-chassis.html) - [配置信息外部化](/patterns/cn/externalized-configuration.html) new 通讯模式 - [远程过程调用](/patterns/cn/communication-style/rpi.html) - [月息](/patterns/cn/communication-style/messaging.html) - [领域独用协议](/patterns/cn/communication-style/domain-specific.html) new - [API 网关](/patterns/cn/apigateway.html) - [服务前端的后端](/patterns/cn/apigateway.html) - [客户端服务发现](/patterns/cn/client-side-discovery.html) - [服务器端服务发现](/patterns/cn/server-side-discovery.html) - [服务注册表](/patterns/cn/service-registry.html) - [自注册](/patterns/cn/self-registration.html) - [第三方注册](/patterns/cn/3rd-party-registration.html) - [断路器](/patterns/cn/reliability/circuit-breaker.html) new 数据管理 - [每服务数据库](/patterns/cn/data/database-per-service.html) - [共享数据库](/patterns/cn/data/shared-database.html) - [事件驱动架构](/patterns/cn/data/event-driven-architecture.html) - [事件溯源](/patterns/cn/data/event-sourcing.html) - [CQRS](/patterns/cn/data/cqrs.html) - [事务日志跟踪](/patterns/cn/data/transaction-log-tailing.html) - [数据库触发器](/patterns/cn/data/database-triggers.html) - [应用程序事件](/patterns/cn/data/transactional-outbox.html) 安全模式 - [访问令牌](/patterns/cn/security/access-token.html) new 可测试性 - [服务组件测试](/patterns/cn/testing/service-component-test.html) new - [服务集成协议测试](/patterns/cn/testing/service-integration-contract-test.html) new 可观测性 - [应用日志](/patterns/cn/observability/application-logging.html) new - [ĺş”ç”¨ćŒ‡ć ‡](/patterns/cn/observability/application-metrics.html) new - [审计日志](/patterns/cn/observability/audit-logging.html) new - [分布式追踪](/patterns/cn/observability/distributed-tracing.html) new - [异常追踪](/patterns/cn/observability/exception-tracking.html) new - [健康检查](/patterns/cn/observability/health-check-api.html) new UI 模式 - [ćœĺŠĄĺ™¨çŤŻéĄľé˘ç˘Žç‰‡ĺŒ–ĺ…ƒç´ ćž„ĺťş](/patterns/cn/ui/server-side-page-fragment-composition.html) new - [厢戡獯 UI 构建](/patterns/cn/ui/client-side-ui-composition.html) new --- [订阅微服务邮件列表](http://visitor.r20.constantcontact.com/d.jsp?llr=ula8akwab&p=oi&m=1123470377332&sit=l6ktajjkb&f=15d9bba9-b33d-491f-b874-73a41bba8a76) --- 全新的微服务应用支撑平台,成功解决微服务架构下分布式数据管理的难题。 [了解更多](http://eventuate.io/) ĺŠ ĺ…Ľ [微服务架构的 Google 讨论组](https://groups.google.com/forum/#!forum/microservices)(需要翻墙) # Pattern: Distributed tracing ## Context You have applied the [Microservice architecture pattern](../microservices.html). ## Problem How to understand the behavior of an application and troubleshoot problems? ## Solution Instrument services with code that assigns each external request an unique identifier. The external request id is passed to all services that are involved in handling the request and included in [Log aggregation](application-logging.html) messages. Record information (e.g. start time, end time) about the work (e.g. service requests) performed when handling the external request in a centralized service. - [Log aggregation](application-logging.html) - external request identifier is included in each log messages ## Examples - [Spring Cloud Sleuth](https://cloud.spring.io/spring-cloud-sleuth/) - distributed tracing for Spring Cloud applications - [Open Zipkin](http://zipkin.io/) - service for recording and displaying tracing information - [Open Tracing](http://opentracing.io) - standardized API for distributed tracing --- Tweet [关注本站推特账号 @crichardson](https://twitter.com/crichardson) Š 2017 Chris Richardson 版权所有 • 保留一切权利 • 本站由 [Kong](https://konghq.com/) 提供支持.