Question: How to configure Sleuth with Zipkin over RabbitMQ
See original GitHub issueI would like to send spans through a RabbitMQ to Zipkin. Therefore I use the Zipkin distribution jar (zipkin-server-2.8.4-exec.jar
) and deploy it to Cloud Foundry with these manifest arguments:
services:
- elasticsearch-zipkin
- rabbitmq-zipkin
env:
RABBIT_URI: ${vcap.services.rabbitmq-zipkin.credentials.uri}
In the producer app with sleuth, I add the following dependencies:
compile('org.springframework.boot:spring-boot-starter-amqp')
compile('org.springframework.cloud:spring-cloud-starter-zipkin')
compile('org.springframework.amqp:spring-rabbit')
Note that the first one is used to send other messages to another application through RMQ and the last one is just to debug as it’s included in the first one.
The used Cloud and Boot versions are Finchley.RC2
and 2.0.2.RELEASE
.
Finally, I add the following properties to application.yml
:
sleuth:
sampler:
probability: 1.0
messaging:
enabled: true
rabbit:
enabled: true
remote-service-name: rabbitmq-zipkin
zipkin:
sender:
type: rabbit
service:
name: myapp
Note the remote-service-name corresponds to the service name in Cloud Foundry.
When both apps are started, I see that zipkin-server auto-creates the queue named ‘zipkin’. Also, log-files from the sleuth-app look like this:
2018-06-07T15:58:11.42+0200 [APP/PROC/WEB/0] OUT 2018-06-07 13:58:11.421 INFO [myapp,f21e0ded48255245,f21e0ded48255245,true] 8 --- [pool-5-thread-1] o.s.a.r.c.CachingConnectionFactory : Created new connection: SpringAMQP#404913f6:0/SimpleConnection@6beb433f [delegate=amqp://Y342KiwcvGv34ruq@10.10.22.22:5672/9437a9a6-597c-4e94-b4d7-6cb85a2ab647, localPort= 53618]
Unfortunately, I never see the span written to RMQ, the queue named ‘zipkin’ remains empty.
Is there anything I missed to configure? What are possible ways to debug it?
Issue Analytics
- State:
- Created 5 years ago
- Comments:16 (9 by maintainers)
I also have the same problem and the workaround provided in Gitter has helped me to solve it until the permanent solution is in place. For the benefit of others here is the workaround.
Explicitly configure
spring.rabbitmq.addresses
property to point to the credentials of the bounded RabbitMQ service. For example, if the bounded service is calledrabbitmq
the following configuration will work:Hi fellas.
I readded this issue and explored the example project to guide my adventure to build a POC to demonstrate a trace with spring cloud sleuth integratted with RabbitMQ and Zipkin.
After some days readding and adjusting thousen and thousen of Spring’s version, i finnaly found compatibillity to run a fully traced application with 3 simple microservices.
Here’s the result, hope be usefull for someone: https://github.com/vagner-nascimento/poc-zipkin-service/tree/adding-rabbitmq
OBS.: Builded with Gradle for the win!! ❤️ /,/