【问题标题】:Zipkin Client can not connect to the Zipkin ServerZipkin Client 无法连接到 Zipkin Server
【发布时间】:2018-12-05 00:33:34
【问题描述】:

我已经启动了 zipkin-server,我可以看到仪表板。我已经用简单的项目对其进行了测试,没关系。但是当我用我的应用程序测试它时,我遇到了问题。如果在 application.properties 中将 kafka 的属性设置为 true,我有 Spring Boot 项目会生成到 kafka。就我而言,它始终设置为 false 并且工作正常。但是当我添加 zipkin 依赖项时,它开始发送到 kafka。而且我在 zipkin 仪表板中也看不到我的客户端应用程序。我使用的是 Spring Boot 1.5.6.RELEASE 版本

这是我的依赖项:

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-sleuth</artifactId>
        <version>1.3.0.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-zipkin</artifactId>
        <version>1.3.0.RELEASE</version>
    </dependency>

这是我用于 zipkin 和 sleuth 的属性。

#Sleuth
spring.sleuth.scheduled.enabled=false
spring.sleuth.async.enabled=false
spring.sleuth.annotation.enabled=false
spring.sleuth.enabled = true 
spring.sleuth.sampler.probability=1.0
#Zipkin
spring.zipkin.baseUrl = http://localhost:9411 
logging.pattern.level=%d{ABSOLUTE} [%X{X-B3-TraceId}/%X{X-B3-SpanId}] %-5p [%t] %C{2} - %m%n

通过添加前 3 个属性,应用程序不会在开始时发送请求,而是在我向我的应用程序发送请求后开始。

【问题讨论】:

    标签: java spring-boot zipkin


    【解决方案1】:

    尝试用这个改变所有属性:

    #Sleuth
    spring.sleuth.sampler.percentage=1.0
    #Zipkin
    spring.zipkin.sender.type=web
    

    spring.sleuth.sampler.percentage=1.0 是 Edgware 所以你需要那个

    baseUrl 默认是本地主机

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-03
      • 1970-01-01
      相关资源
      最近更新 更多