Reputation: 36
When I learned Sleuth, I found that it was outdated, so I used Micrometer Tracing to replace it. How to integrate Spring Stream + RabbitMQ +Zipkin
I've already connected Zipkin directly, but I don't understand how to transfer through rabbitMQ
Add 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>
Configure:
management:
tracing:
sampling:
probability: 1.0
zipkin:
tracing:
endpoint: http://192.168.31.112:9411/api/v2/spans
zipkin:
docker run -d -p 9411:9411 --name zipkin -e RABBIT_ADDRESSES=192.168.31.112:5672 -e RABBIT_USER=rabbit -e RABBIT_PASSWORD=rabbit112 openzipkin/zipkin
How can I modify it to achieve Sleuth's effect:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-zipkin</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-binder-rabbit</artifactId>
</dependency>
spring:
sleuth:
sampler:
probability: 1.0
rate: 1000
zipkin:
sender:
type: rabbit
rabbitmq:
addresses: 127.0.0.1:5672
queue: zipkin
Want to achieve in the end: zipkin.sender.type=rabbit
How can I implement it, or which documents can be helpful?
Upvotes: 0
Views: 59