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


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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值