spring boot3, rabbitMQ, Different Request in Zipkin

61 Views Asked by At

I am using Spring Boot 3 and RabbitMQ. It turns out that when I make a request from microservice A to microservice B, Zipkin shows a separate request for the request to microservice A and a different request for service B and RabbitMQ. The two requests have different TraceIds but do not appear to depend on one another, although they are part of the same request. Do you know how I could solve this problem?

Here is my pom.xml dependencies

       <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>io.micrometer</groupId>
            <artifactId>micrometer-tracing-bridge-brave</artifactId>
        </dependency>
        <dependency>
            <groupId>io.zipkin.reporter2</groupId>
            <artifactId>zipkin-reporter-brave</artifactId>
        </dependency>

here application.yml

rabbitmq:
  in:
    requests:
      queue: q.requests.creation
      exchange: sms_requests
  out:
    books:
      queue: q.books.availabilities
      exchange: sms_books
      routingkey: sms_books_routingkey


logging:
  pattern:
    level: '%5p [${spring.application.name:},%X{traceId:-},%X{spanId:-}]'

management:
  tracing:
    sampling:
      probability: 1.0
    propagation:
      type: w3c, b3_multi, b3
    exporter:
      zipkin:
        enabled: true

and a config file maybe could help to see where is the problem

 @Configuration
    public class MyConfiguration implements WebMvcConfigurer {
        @Bean
        ContainerCustomizer<SimpleMessageListenerContainer> containerCustomizer() {
            return container -> container.setObservationEnabled(true);
        }
    }

and at last the url to the repo and the image how Zipkin show these two request as a different one. If u want to see something in more detailenter image description here

https://github.com/ksreyr/unir-shop

I appreciate the help very much, and any advice is welcome.

0

There are 0 best solutions below