zeus00456

导航

统计

微服务架构 | 链路追踪 - [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 端口查看
在这里插入图片描述


传送门:
微服务架构 | 组件目录

posted on   问仙长何方蓬莱  阅读(64)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
点击右上角即可分享
微信分享提示