侦探未将跟踪信息发送到Zipkin

cod*_*ash 4 java spring zipkin spring-boot spring-cloud-sleuth

即使Zipkin运行正常,Sleuth也不会将跟踪信息发送到Zipkin。我正在使用Spring 1.5.8.RELEASE,Spring Cloud Dalston.SR4,并且在我的微服务中添加了以下依赖项:

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-zipkin</artifactId>
</dependency>
Run Code Online (Sandbox Code Playgroud)

我的日志总是错误的:[FOOMS,2e740f33c26e286d,2e740f33c26e286d,false]

我的Zipkin依赖项是:

<dependency>
    <groupId>io.zipkin.java</groupId>
    <artifactId>zipkin-server</artifactId>
</dependency>
<dependency>
    <groupId>io.zipkin.java</groupId>
    <artifactId>zipkin-autoconfigure-ui</artifactId>
    <scope>runtime</scope>
</dependency>
Run Code Online (Sandbox Code Playgroud)

为什么我在懒惰的陈述中变得虚假而不是真实?虽然为所有调用正确生成了traceId和SpanId。我的Zipkin在端口9411中运行

小智 9

对于最新版本的云依赖项<version>Finchley.SR2</version>
,将跟踪发送到 zipkin 的正确属性是:spring.sleuth.sampler.probability=1.0 已从百分比更改为概率。


cod*_*ash 7

我发现我需要添加一个采样百分比。默认情况下,将发送零百分比的样本,这就是侦探没有向zipkin发送任何内容的原因。当我添加spring.sleuth.sampler.percentage=1.0属性文件时,它开始工作。

  • 在最新版本中,密钥更改为“ spring.sleuth.sampler.probability”。 (9认同)
  • http://cloud.spring.io/spring-cloud-static/Edgware.RELEASE/multi/multi__features_2.html在“重要”部分中写道:&gt;如果使用Zipkin,请配置使用spring.sleuth导出的跨度百分比.sampler.percentage(默认值为0.1,即10%)。否则,您可能会认为Sleuth无法正常工作,因为它忽略了一些跨度。 (3认同)