本文介绍了侦探未将跟踪信息发送到Zipkin的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Sleuth is not sending the trace information to Zipkin, even though Zipkin is running fine.I am using Spring 1.5.8.RELEASE, spring cloud Dalston.SR4 and I have added the below dependencies in my microservices:

<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>

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

My Logs are always coming false:[FOOMS,2e740f33c26e286d,2e740f33c26e286d,false]

我的Zipkin依赖项是:

My Zipkin dependencies are:

<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>

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

Why am I getting false instead of true in my slueth statements? The traceId and SpanId are properly generated for all the calls though. My Zipkin is running in port 9411

推荐答案

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

I found that I need to add a sampler percentage. By default zero percentage of the samples are sent and that is why the sleuth was not sending anything to zipkin. when I added spring.sleuth.sampler.percentage=1.0 in the properties files, it started working.

这篇关于侦探未将跟踪信息发送到Zipkin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 08:17