当发件人类型为 kafka 时,zipkin 中未显示痕迹

traces are not being shown in zipkin, when sender type is kafka

我想使用 Kafka 将我的 spring 启动日志跟踪发送到 Zipkin 服务器

我启动了我的 Kafka 和 Zipkin 服务器,我启动了一个正在收听主题 Zipkin 的 Kafka 消费者,我可以在这里看到我的日志,但是当我打开我的 Zipkin 仪表板时,我找不到任何痕迹

Spring 引导版本 :- 2.1.7.RELEASE
Spring 云端版 :- Greenwich.SR2

依赖管理

    <dependencyManagement>
            <dependencies>
                <dependency>
                    <groupId>org.springframework.cloud</groupId>
                    <artifactId>spring-cloud-dependencies</artifactId>
                    <version>Greenwich.SR2</version>
                    <type>pom</type>
                    <scope>import</scope>
                </dependency>
            </dependencies>
        </dependencyManagement>

依赖关系

    <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>
    <dependency>
            <groupId>org.springframework.kafka</groupId>
            <artifactId>spring-kafka</artifactId>
    </dependency>

我的application.properties文件

        spring.sleuth.sampler.probability=1 

        spring.application.name=dummy

        spring.zipkin.baseUrl=http://localhost:9411

        spring.zipkin.sender.type=kafka

SpringBootApplication 主文件

@SpringBootApplication
public class UserApplication {

    public static void main(String[] args) {
        SpringApplication.run(UserApplication.class, args);
    }

}

我的控制器功能

@GetMapping("/hello")
public String sayHello() {
    log.info("hey im a log");
    return "hello";
}

当我制作 spring.zipkin.sender.type=web 时,痕迹显示在 Zipkin 仪表板中 这里有什么我遗漏的吗?

好的,我终于意识到我用这个命令启动我的 zipkin 服务器时犯了什么错误

 java -jar zipkin-server-2.16.2-exec.jar

但我没有在我的 Kafka 所在的位置指定我的 Zipkin 服务器 运行 所以当我这样做时

 set KAFKA_BOOTSTRAP_SERVERS=localhost:9092
 java -jar zipkin-server-2.16.2-exec.jar 

有效