微服务架构 | 链路追踪 - [Sleuth]
@
§1 简介
Spring Cloud Sleuth provides API for distributed tracing solution for Spring Cloud. It integrates with OpenZipkin Brave
Spring Cloud Sleuth is able to trace your requests and messages so that you can correlate that communication to corresponding log entries. You can also export the tracing information to an external system to visualize latency. Spring Cloud Sleuth supports OpenZipkin compatible systems directly.
Spring Cloud Sleuth 提供了对 Spring Cloud 的链路追踪解决方案,并整合 OpenZipkin
Spring Cloud Sleuth 可以追踪你的请求和消息,以便于你通过相关的日志条目将那些通信关联起来。你也可以导出跟踪信息到一个外部系统来把延时可视化。Spring Cloud Sleuth supports 可以直接整合 OpenZipkin
§2 简单使用
依赖
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-zipkin</artifactId>
</dependency>
配置
spring:
application:
name: order-service
zipkin:
base-url: http://192.168.3.7:9411
sleuth:
sampler:
#采样率值介于 0 到 1 之间,1 则表示全部采集,通常0.5
probability: 1
效果
使用 9411 端口查看
传送门:
微服务架构 | 组件目录
分类:
微服务
, spring cloud
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)