Search code examples
javaspring-bootopentracingjaeger

OpenTracing with Spring Boot 2.0.2 does not yield any traces in Jaeger


I'm struggling with setting up OpenTracing/Jaeger for a Spring Boot 2.0.2 application. Starting from a working but very sample for Spring Boot 1.5.3 I moved on to Spring Boot 2.0.2 -- which properly sent the traces. But the dependencies used there were ridiculously old (like 0.0.4 for opentracing-spring-web-autoconfigure, which is now available in 0.3.2).

So I migrated the application to the latest dependencies which resulted in no traces appearing anymore in Jaeger.

I've upload my tests to https://gitlab.com/ceedee_/opentracing-spring-boot. The branches are as follows:

  1. master -> Spring 1.5.3 implementation (working)
  2. spring-boot-2-0-2-RELEASE -> Spring 2.0.2 implementation (working with outdated deps)
  3. spring-boot-2-0-2-RELEASE-latest-deps -> Spring 2.0.2 implementation (not working!)

Differences from 2. to 3. are as follows:

  1. Updated pom.xml for the updated dependencies.
  2. jaegerTracer bean uses builder (no Const-Sampler configured anymore, should be default)
  3. application.properties activates Const-Sampler (commented out since it does not improve anything)

Does anyone have a clue what I'm doing wrong in order to properly put traces into Jaeger? Hints on debugging OpenTracing/Jaeger are appreciated as well!

Best regards, cd_


Solution

  • The problem was, that the Report instance used a NoopSender -- thus ignoring the connection settings.

    Using

        <dependency>
            <groupId>io.jaegertracing</groupId>
            <artifactId>jaeger-thrift</artifactId>
            <version>0.32.0</version>
        </dependency>
    

    in your POM will provide an appropriate Sender to the SenderFactory used by Jaeger's SenderResolver::resolve method.

    This solved my problem.