当前位置: 首页 > 知识库问答 >
问题:

Zipkin未显示跟踪日志

陆高峰
2023-03-14

大家好,希望有人能帮助我,我正在尝试获得一个非常基本的zipkin实现,以掌握分布式跟踪。我正在使用Spring靴来做这件事,但似乎不能使它工作。当我尝试为我的服务查找跟踪时,zipkin UI中不会显示任何内容。

我有两个部署如下:

我想要登录的spring boot应用程序:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.example</groupId>
    <artifactId>zipkinClient</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>zipkinClient</name>
    <description>Demo project for Spring Boot</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.3.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
        <spring-cloud.version>Dalston.RELEASE</spring-cloud.version>
    </properties>

    <dependencies>
        <!-- If i only put this dependency in then my app does not start -->
        <!-- dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-zipkin</artifactId>
        </dependency-->

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-sleuth-zipkin-stream</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-sleuth</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-stream-rabbit</artifactId>
        </dependency>


        <dependency>
            <groupId>io.zipkin.java</groupId>
            <artifactId>zipkin-autoconfigure-ui</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>


</project>
package com.example.demo;

import java.util.logging.Level;
import java.util.logging.Logger;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.sleuth.sampler.AlwaysSampler;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
@RestController
public class ZipkinApplication {

    private static final Logger LOG = Logger.getLogger(ZipkinApplication.class.getName());

    @Autowired
    private RestTemplate restTemplate;

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

    @Bean
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }

    @Bean
    public AlwaysSampler defaultSampler() {
      return new AlwaysSampler();
    }

    @RequestMapping("/zipkin")
    public String home() {
        LOG.log(Level.INFO, "you called home");
        return "Hello World";
    }

    @RequestMapping("/callhome")
    public String callHome() {
        LOG.log(Level.INFO, "calling home");
        return restTemplate.getForObject("http://localhost:8080/zipkin", String.class);
    }
}
2017-05-17 15:20:09.425  INFO [zipkin demo,13ad9334863d28cf,13ad9334863d28cf,true] 23980 --- [nio-8080-exec-1] com.example.demo.ZipkinApplication       : calling home
2017-05-17 15:20:09.550  INFO [zipkin demo,13ad9334863d28cf,a637530dc2dc2852,true] 23980 --- [nio-8080-exec-5] com.example.demo.ZipkinApplication       : you called home

我得完整日志:

2017-05-17 15:19:45.162  INFO [zipkin demo,,,] 23980 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Located managed bean 'rabbitConnectionFactory': registering with JMX server as MBean [org.springframework.amqp.rabbit.connection:name=rabbitConnectionFactory,type=CachingConnectionFactory]
2017-05-17 15:19:45.172  INFO [zipkin demo,,,] 23980 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Located managed bean 'refreshEndpoint': registering with JMX server as MBean [org.springframework.cloud.endpoint:name=refreshEndpoint,type=RefreshEndpoint]
2017-05-17 15:19:45.183  INFO [zipkin demo,,,] 23980 --- [           main] o.s.i.monitor.IntegrationMBeanExporter   : Registering beans for JMX exposure on startup
2017-05-17 15:19:45.184  INFO [zipkin demo,,,] 23980 --- [           main] o.s.i.monitor.IntegrationMBeanExporter   : Registering MessageChannel errorChannel
2017-05-17 15:19:45.189  INFO [zipkin demo,,,] 23980 --- [           main] o.s.i.monitor.IntegrationMBeanExporter   : Located managed bean 'org.springframework.integration:type=MessageChannel,name=errorChannel': registering with JMX server as MBean [org.springframework.integration:type=MessageChannel,name=errorChannel]
2017-05-17 15:19:45.283  INFO [zipkin demo,,,] 23980 --- [           main] o.s.i.monitor.IntegrationMBeanExporter   : Registering MessageChannel nullChannel
2017-05-17 15:19:45.285  INFO [zipkin demo,,,] 23980 --- [           main] o.s.i.monitor.IntegrationMBeanExporter   : Located managed bean 'org.springframework.integration:type=MessageChannel,name=nullChannel': registering with JMX server as MBean [org.springframework.integration:type=MessageChannel,name=nullChannel]
2017-05-17 15:19:45.303  INFO [zipkin demo,,,] 23980 --- [           main] o.s.i.monitor.IntegrationMBeanExporter   : Registering MessageChannel sleuth
2017-05-17 15:19:45.305  INFO [zipkin demo,,,] 23980 --- [           main] o.s.i.monitor.IntegrationMBeanExporter   : Located managed bean 'org.springframework.integration:type=MessageChannel,name=sleuth': registering with JMX server as MBean [org.springframework.integration:type=MessageChannel,name=sleuth]
2017-05-17 15:19:45.336  INFO [zipkin demo,,,] 23980 --- [           main] o.s.i.monitor.IntegrationMBeanExporter   : Registering MessageHandler errorLogger
2017-05-17 15:19:45.338  INFO [zipkin demo,,,] 23980 --- [           main] o.s.i.monitor.IntegrationMBeanExporter   : Located managed bean 'org.springframework.integration:type=MessageHandler,name=errorLogger,bean=internal': registering with JMX server as MBean [org.springframework.integration:type=MessageHandler,name=errorLogger,bean=internal]
2017-05-17 15:19:45.373  INFO [zipkin demo,,,] 23980 --- [           main] o.s.i.monitor.IntegrationMBeanExporter   : Registering MessageSource sleuthStreamSpanReporter.poll.inboundChannelAdapter
2017-05-17 15:19:45.375  INFO [zipkin demo,,,] 23980 --- [           main] o.s.i.monitor.IntegrationMBeanExporter   : Located managed bean 'org.springframework.integration:type=MessageSource,name=sleuthStreamSpanReporter.poll.inboundChannelAdapter,bean=endpoint': registering with JMX server as MBean [org.springframework.integration:type=MessageSource,name=sleuthStreamSpanReporter.poll.inboundChannelAdapter,bean=endpoint]
2017-05-17 15:19:45.698  INFO [zipkin demo,,,] 23980 --- [           main] o.s.c.support.DefaultLifecycleProcessor  : Starting beans in phase -2147482648
2017-05-17 15:19:46.060  INFO [zipkin demo,,,] 23980 --- [           main] com.example.demo.ZipkinApplication       : No active profile set, falling back to default profiles: default
2017-05-17 15:19:46.068  INFO [zipkin demo,,,] 23980 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@28941a68: startup date [Wed May 17 15:19:46 BST 2017]; parent: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@2dcd168a
2017-05-17 15:19:46.248  INFO [zipkin demo,,,] 23980 --- [           main] o.s.c.support.GenericApplicationContext  : Refreshing org.springframework.context.support.GenericApplicationContext@5f1db390: startup date [Wed May 17 15:19:46 BST 2017]; root of context hierarchy
2017-05-17 15:19:46.351  INFO [zipkin demo,,,] 23980 --- [           main] com.example.demo.ZipkinApplication       : Started ZipkinApplication in 0.575 seconds (JVM running for 27.035)
2017-05-17 15:19:48.498  WARN [zipkin demo,,,] 23980 --- [           main] o.s.amqp.rabbit.core.RabbitAdmin         : Failed to declare exchange: Exchange [name=sleuth, type=topic, durable=true, autoDelete=false, internal=false, arguments={}], continuing... org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused: connect
2017-05-17 15:19:48.528  INFO [zipkin demo,,,] 23980 --- [           main] o.s.integration.channel.DirectChannel    : Channel 'zipkin demo.sleuth' has 1 subscriber(s).
2017-05-17 15:19:48.529  INFO [zipkin demo,,,] 23980 --- [           main] o.s.c.support.DefaultLifecycleProcessor  : Starting beans in phase 0
2017-05-17 15:19:48.610  INFO [zipkin demo,,,] 23980 --- [           main] o.s.i.endpoint.EventDrivenConsumer       : Adding {logging-channel-adapter:_org.springframework.integration.errorLogger} as a subscriber to the 'errorChannel' channel
2017-05-17 15:19:48.611  INFO [zipkin demo,,,] 23980 --- [           main] o.s.i.channel.PublishSubscribeChannel    : Channel 'zipkin demo.errorChannel' has 1 subscriber(s).
2017-05-17 15:19:48.611  INFO [zipkin demo,,,] 23980 --- [           main] o.s.i.endpoint.EventDrivenConsumer       : started _org.springframework.integration.errorLogger
2017-05-17 15:19:48.645  INFO [zipkin demo,,,] 23980 --- [           main] o.s.i.e.SourcePollingChannelAdapter      : started sleuthStreamSpanReporter.poll.inboundChannelAdapter
2017-05-17 15:19:48.646  INFO [zipkin demo,,,] 23980 --- [           main] o.s.c.support.DefaultLifecycleProcessor  : Starting beans in phase 2147482647
2017-05-17 15:19:48.646  INFO [zipkin demo,,,] 23980 --- [           main] o.s.c.support.DefaultLifecycleProcessor  : Starting beans in phase 2147483647
2017-05-17 15:19:48.786  INFO [zipkin demo,,,] 23980 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
2017-05-17 15:19:48.793  INFO [zipkin demo,,,] 23980 --- [           main] com.example.demo.ZipkinApplication       : Started ZipkinApplication in 28.094 seconds (JVM running for 29.477)
2017-05-17 15:20:09.056  INFO [zipkin demo,,,] 23980 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring FrameworkServlet 'dispatcherServlet'
2017-05-17 15:20:09.057  INFO [zipkin demo,,,] 23980 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : FrameworkServlet 'dispatcherServlet': initialization started
2017-05-17 15:20:09.308  INFO [zipkin demo,,,] 23980 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : FrameworkServlet 'dispatcherServlet': initialization completed in 250 ms
2017-05-17 15:20:09.425  INFO [zipkin demo,13ad9334863d28cf,13ad9334863d28cf,true] 23980 --- [nio-8080-exec-1] com.example.demo.ZipkinApplication       : calling home
2017-05-17 15:20:09.550  INFO [zipkin demo,13ad9334863d28cf,a637530dc2dc2852,true] 23980 --- [nio-8080-exec-5] com.example.demo.ZipkinApplication       : you called home
2017-05-17 15:20:10.084  INFO [zipkin demo,0058e6e4818c17f1,0058e6e4818c17f1,false] 23980 --- [ask-scheduler-1] o.s.i.codec.kryo.CompositeKryoRegistrar  : registering [40, java.io.File] with serializer org.springframework.integration.codec.kryo.FileSerializer
2017-05-17 15:20:12.147 ERROR [zipkin demo,6f315febeb5c2176,6f315febeb5c2176,true] 23980 --- [ask-scheduler-1] o.s.integration.handler.LoggingHandler   : org.springframework.messaging.MessageHandlingException: error occurred in message handler [org.springframework.integration.amqp.outbound.AmqpOutboundEndpoint@5206a959]; nested exception is org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused: connect, failedMessage=GenericMessage [payload=byte[948], headers={spanTraceId=0058e6e4818c17f1, spanId=0058e6e4818c17f1, messageSent=true, id=eb339ffc-5b54-edea-b348-60ca5eac05a1, spanSampled=0, contentType=application/x-java-object;type=org.springframework.cloud.sleuth.stream.Spans, timestamp=1495030810113}]
    at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:139)
    at org.springframework.cloud.stream.binder.AbstractMessageChannelBinder$SendingHandler.handleMessageInternal(AbstractMessageChannelBinder.java:326)
    at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:127)
    at org.springframework.integration.dispatcher.AbstractDispatcher.tryOptimizedDispatch(AbstractDispatcher.java:116)
    at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:148)
    at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:121)
    at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:89)
    at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:423)
    at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:373)
    at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:115)
    at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:45)
    at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:105)
    at org.springframework.integration.endpoint.SourcePollingChannelAdapter.handleMessage(SourcePollingChannelAdapter.java:210)
    at org.springframework.integration.endpoint.AbstractPollingEndpoint.doPoll(AbstractPollingEndpoint.java:272)
    at org.springframework.integration.endpoint.AbstractPollingEndpoint.access$000(AbstractPollingEndpoint.java:58)
    at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:190)
    at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:186)
    at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller$1.run(AbstractPollingEndpoint.java:353)
    at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:55)
    at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50)
    at org.springframework.integration.util.ErrorHandlingTaskExecutor.execute(ErrorHandlingTaskExecutor.java:51)
    at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.run(AbstractPollingEndpoint.java:344)
    at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
    at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused: connect
    at org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java:62)
    at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:367)
    at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:565)
    at org.springframework.amqp.rabbit.core.RabbitTemplate.doExecute(RabbitTemplate.java:1430)
    at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:1411)
    at org.springframework.amqp.rabbit.core.RabbitTemplate.send(RabbitTemplate.java:712)
    at org.springframework.integration.amqp.outbound.AmqpOutboundEndpoint.send(AmqpOutboundEndpoint.java:134)
    at org.springframework.integration.amqp.outbound.AmqpOutboundEndpoint.handleRequestMessage(AmqpOutboundEndpoint.java:122)
    at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:109)
    at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:127)
    ... 30 more

我部署的第二个应用程序是我的zipkin客户机/UI

Pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.example</groupId>
    <artifactId>zipkinClient</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>zipkinClient</name>
    <description>Demo project for Spring Boot</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.3.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
        <spring-cloud.version>Dalston.RELEASE</spring-cloud.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-zipkin</artifactId>
        </dependency>

        <dependency>
            <groupId>io.zipkin.java</groupId>
            <artifactId>zipkin-autoconfigure-ui</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>


</project>
package com.example.zipkinClient;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class ZipkinClientApplication {

    public static void main(String[] args) {
        SpringApplication.run(ZipkinClientApplication.class, args);
    }
}
spring.application.name=zipkin server
server.port=9411
2017-05-17 15:27:21.822  INFO [zipkin server,,,] 13888 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 9411 (http)
2017-05-17 15:27:21.829  INFO [zipkin server,,,] 13888 --- [           main] c.e.z.ZipkinClientApplication            : Started ZipkinClientApplication in 11.14 seconds (JVM running for 12.111)
2017-05-17 15:27:38.513  INFO [zipkin server,,,] 13888 --- [nio-9411-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring FrameworkServlet 'dispatcherServlet'
2017-05-17 15:27:38.514  INFO [zipkin server,,,] 13888 --- [nio-9411-exec-1] o.s.web.servlet.DispatcherServlet        : FrameworkServlet 'dispatcherServlet': initialization started
2017-05-17 15:27:38.638  INFO [zipkin server,,,] 13888 --- [nio-9411-exec-1] o.s.web.servlet.DispatcherServlet        : FrameworkServlet 'dispatcherServlet': initialization completed in 124 ms
2017-05-17 15:27:40.828  WARN [zipkin server,,,] 13888 --- [ender@38e778c9)] z.r.AsyncReporter$BoundedAsyncReporter   : Dropped 2 spans due to HttpClientErrorException(404 null)

org.springframework.web.client.HttpClientErrorException: 404 null
    at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:63) ~[spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE]
    at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:700) ~[spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE]
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:653) ~[spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE]
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:628) ~[spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE]
    at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:590) ~[spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE]
    at org.springframework.cloud.sleuth.zipkin.RestTemplateSender.post(RestTemplateSender.java:73) ~[spring-cloud-sleuth-zipkin-1.2.0.RELEASE.jar:1.2.0.RELEASE]
    at org.springframework.cloud.sleuth.zipkin.RestTemplateSender.sendSpans(RestTemplateSender.java:46) ~[spring-cloud-sleuth-zipkin-1.2.0.RELEASE.jar:1.2.0.RELEASE]
    at zipkin.reporter.AsyncReporter$BoundedAsyncReporter.flush(AsyncReporter.java:228) [zipkin-reporter-0.6.12.jar:na]
    at zipkin.reporter.AsyncReporter$Builder.lambda$build$0(AsyncReporter.java:153) [zipkin-reporter-0.6.12.jar:na]
    at zipkin.reporter.AsyncReporter$Builder$$Lambda$1.run(Unknown Source) [zipkin-reporter-0.6.12.jar:na]

共有1个答案

马哲
2023-03-14

正如M.Deinum所说的,删除streamstream-rabbit依赖项,如果您不需要某个AMQP服务器来存储跟踪消息,该怎么办。

从application-configuration(两者)配置AMQP(代码中的rabbitMQ),并在zipkin-streamstream-rabbit中添加zipkin-server端,因此这一次您的应用程序(zipkin-client)不会直接与zipkin-server连接,而是:

zipkin-client <==> AMQP(rabbitMQ) <==> zipkin-server
 类似资料:
  • Zipkin跟踪演示使用Zipkin作为跟踪服务端,提供跟踪Envoy请求记录展示的功能。这个沙箱与上面描述的前端代理架构非常类似,但有一点不同:在响应返回之前,service1对service2进行API调用。这三个容器将被部署在名为envoymesh的虚拟网络中。 所有的请求都经过前端Envoy进行路由,该Envoy充当位于envoymesh网络边缘的反向代理。端口80通过docker com

  • Sleuth没有将跟踪信息发送给Zipkin,尽管Zipkin运行良好。我使用的是spring 1.5.8.Release,spring cloud Dalston.sr4和我在我的微服务中添加了以下依赖项: 我的日志总是出现错误:[FOOMS,2E740F33C26E286D,2E740F33C26E286D,false] 我的Zipkin依赖项是: 为什么我的口供是假的而不是真的?但是,所有调

  • 我正在尝试将sleuth集成到Spring Boot应用程序中,这样它就可以与zipkin服务器进行跟踪,但我的运气不太好。我已经学习了一些教程(链接到tutorial),让他们与zipkin对话没有问题,但是它不能很好地转换到我的应用程序中,我不确定该去哪里找。 基本上,在build.gradle文件的依赖项部分,我添加了: 并且,我将这些内容添加到application.properties文

  • 我最近将我的项目从spring boot 1.4.1、spring cloud Sleuth 1.1.0、spring cloud Zipkin 1.1.0升级到spring boot 1.5.3、spring cloud Sleuth 1.2.0、spring cloud Zipkin 1.2.0。 在最新版本的spring cloud Sleuth中,他们添加了“错误”标签,一旦出现任何异常,

  • 当我创建spring.Zipkin.sender.type=web时,Zipkin dashboard中显示了跟踪,这里有没有我缺少的东西。

  • 有关zipkin跟踪配置的示例,请参阅zipkin沙箱设置。 返回 上一级