opentracing-contrib / java-spring-rabbitmq

OpenTracing RabbitMQ instrumentation
Apache License 2.0
18 stars 21 forks source link

Tracing isn't appearing in jaeger #27

Closed monkeonman closed 5 years ago

monkeonman commented 5 years ago

Hi,

I'm using the following method call:

this.template.convertAndSend("fanout.exchange", "", message);

But I'm seeing no tracing for RabbitMQ appear in my jaeger all in one instance.

I've added these to my pom:

    <dependency>
        <groupId>io.opentracing.contrib</groupId>
        <artifactId>opentracing-spring-jaeger-cloud-starter</artifactId>
        <version>1.0.3</version>
    </dependency>

    <dependency>
        <groupId>io.opentracing.contrib</groupId>
        <artifactId>opentracing-spring-rabbitmq-starter</artifactId>
        <version>1.0.1</version>
    </dependency>

I haven't defined a Tracer bean in my code, as I believe this is supplied by opentracing-spring-jaeger-cloud-starter. I am seeing tracing for the API call I am making (when I did define the bean in my code, I wasn't even seeing that).

Any idea why I might not be seeing any tracing for the queue?

ask4gilles commented 5 years ago

Your dependencies are correct. (I'm currently using the same setup)

I haven't defined a Tracer bean in my code, as I believe this is supplied by opentracing-spring-jaeger-cloud-starter. That's correct also.

when I did define the bean in my code, I wasn't even seeing that Which bean?

Can you share a minimal example project somewhere?

monkeonman commented 5 years ago

Thanks for replying so quickly! The Bean I was talking about was the Tracer bean that you'll see commented out in the MessagingApplication class in the repo below:

https://github.com/monkeonman/rabbitexample

Hopefully you'll be able to see what I'm doing wrong!

ask4gilles commented 5 years ago

so, you have to add:

  @Bean
  public RabbitTemplate rabbitTemplate(ConnectionFactory connectionFactory) {
    return new RabbitTemplate(connectionFactory);
  }

And it's fixed...We need to work on this, sorry about that.

jaeger

monkeonman commented 5 years ago

That's awesome, just confirmed that here too.

Glad it wasn't anything too dumb, might just be worth adding that to the README. Thanks for your help!