【问题标题】:Service dependencies not shown in Jaeger between Spring Boot ApplicationsSpring Boot 应用程序之间的 Jaeger 中未显示服务依赖项
【发布时间】:2019-08-09 21:32:12
【问题描述】:

我目前正在尝试使用 https://github.com/opentracing-contrib/java-spring-web 使用 Jaeger 跟踪两个 Spring Boot (2.1.1) 应用程序

<dependency>
  <groupId>io.opentracing.contrib</groupId>
  <artifactId>opentracing-spring-web-starter</artifactId>
</dependency> 

也试过了,没有成功

<dependency>
  <groupId>io.opentracing.contrib</groupId>
  <artifactId>opentracing-spring-jaeger-cloud-starter</artifactId>
</dependency>

跟踪每个服务/应用程序的 Span 工作正常,但不能在全局级别上通过 REST 请求。 如图所示,服务之间没有显示依赖关系。

不应该通过图书馆开箱即用吗?或者我是否必须自己实现一些拦截器和请求过滤器,如果是这样,如何实现?

您可以检查一个包含问题的简约项目 here

顺便说一句:Jaeger 通过 docker 一体式运行并按预期工作

docker run \
--rm \
--name jaeger \
-p5775:5775/udp \
-p6831:6831/udp \
-p6832:6832/udp \
-p5778:5778 \
-p16686:16686 \
-p14268:14268 \
-p9411:9411 \
jaegertracing/all-in-one:latest

【问题讨论】:

    标签: spring spring-boot opentracing jaeger


    【解决方案1】:

    问题是您使用RestTemplate template = new RestTemplate(); 获取RestTemplate 的实例来进行REST 调用。

    这样做意味着 Opentracing 无法检测调用以添加必要的 HTTP 标头。

    请考虑使用@Autowired RestTemplate restTemplate

    【讨论】:

      【解决方案2】:

      您能否尝试使用更新版本的 Jaeger:https://www.jaegertracing.io/docs/latest/getting-started/#all-in-one - 实际上 1.11 现已发布,所以可以尝试一下。

      【讨论】:

      • 实际上我确实使用“最新”。我编辑了我的问题来解决这个问题。还是谢谢。
      猜你喜欢
      • 2018-10-07
      • 1970-01-01
      • 1970-01-01
      • 2022-01-03
      • 1970-01-01
      • 1970-01-01
      • 2018-06-14
      • 2022-01-08
      • 2020-12-09
      相关资源
      最近更新 更多