question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: How to configure Sleuth with Zipkin over RabbitMQ

See original GitHub issue

I 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:closed
  • Created 5 years ago
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
oiavorskyicommented, Jul 15, 2018

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 called rabbitmq the following configuration will work:

spring.rabbitmq.addresses=${vcap.services.rabbitmq.credentials.uri}
1reaction
vagner-nascimentocommented, Nov 21, 2018

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!! ❤️ /,/

Read more comments on GitHub >

github_iconTop Results From Across the Web

13. All about Zipkin, Spring cloud sleuth and RabbitMQ ...
RabbitMQ download link: https://www. rabbitmq.com/download.html ; Erlang installation link :https://www.erlang.org/downloads ; Zipkin Quickstart: ...
Read more >
Spring, RabbitMQ, Sleuth and Zipkin: No tracings available in ...
Im trying to implement distributed tracing using Spring, RabbitMQ, Sleuth and Zipkin. So I added the dependencies:
Read more >
Spring Cloud Sleuth + RabbitMQ + Zipkin + ElasticSearch
This article assumes that you know how to set up a spring cloud or spring boot project; also, the RabbitMQ and ElasticSearch servers...
Read more >
Spring Cloud Sleuth
If you want Sleuth over RabbitMQ, add the spring-cloud-starter-zipkin and spring-rabbit dependencies. The following example shows how to do so for Gradle: Maven....
Read more >
Understanding Distributed Tracing | Microservices with Spring ...
How to use either RabbitMQ or Kafka to send trace events from our microservices to the Zipkin server. Technical requirements. For instructions on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found