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

417 views
Skip to first unread message

Björn K.

unread,
Nov 29, 2018, 3:37:33 AM11/29/18
to Jaeger Tracing

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,

Björn


plo...@redhat.com

unread,
Nov 29, 2018, 3:53:55 AM11/29/18
to Jaeger Tracing
Hi Bjorn,

could you please provide an output of `mvn dependency:tree` for not working version?

Regards,

Björn K.

unread,
Nov 29, 2018, 5:21:58 AM11/29/18
to Jaeger Tracing
Of course, here it is:

[INFO] sample:opentracing-spring-boot:jar:0.0.1-SNAPSHOT
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.0.2.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter:jar:2.0.2.RELEASE:compile
[INFO] |  |  +- org.springframework.boot:spring-boot:jar:2.0.2.RELEASE:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-logging:jar:2.0.2.RELEASE:compile
[INFO] |  |  |  +- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO] |  |  |  |  \- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO] |  |  |  +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.10.0:compile
[INFO] |  |  |  |  \- org.apache.logging.log4j:log4j-api:jar:2.10.0:compile
[INFO] |  |  |  \- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
[INFO] |  |  +- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] |  |  \- org.yaml:snakeyaml:jar:1.19:runtime
[INFO] |  +- org.springframework.boot:spring-boot-starter-json:jar:2.0.2.RELEASE:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.9.5:compile
[INFO] |  |  |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.0:compile
[INFO] |  |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.9.5:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.9.5:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.9.5:compile
[INFO] |  |  \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.9.5:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.0.2.RELEASE:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.31:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.31:compile
[INFO] |  |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.31:compile
[INFO] |  +- org.hibernate.validator:hibernate-validator:jar:6.0.9.Final:compile
[INFO] |  |  +- javax.validation:validation-api:jar:2.0.1.Final:compile
[INFO] |  |  +- org.jboss.logging:jboss-logging:jar:3.3.2.Final:compile
[INFO] |  |  \- com.fasterxml:classmate:jar:1.3.4:compile
[INFO] |  +- org.springframework:spring-web:jar:5.0.6.RELEASE:compile
[INFO] |  |  \- org.springframework:spring-beans:jar:5.0.6.RELEASE:compile
[INFO] |  \- org.springframework:spring-webmvc:jar:5.0.6.RELEASE:compile
[INFO] |     +- org.springframework:spring-aop:jar:5.0.6.RELEASE:compile
[INFO] |     +- org.springframework:spring-context:jar:5.0.6.RELEASE:compile
[INFO] |     \- org.springframework:spring-expression:jar:5.0.6.RELEASE:compile
[INFO] +- io.opentracing.contrib:opentracing-spring-web-autoconfigure:jar:0.3.2:compile
[INFO] |  +- io.opentracing.contrib:opentracing-spring-web:jar:0.3.2:compile
[INFO] |  |  \- io.opentracing.contrib:opentracing-web-servlet-filter:jar:0.1.0:compile
[INFO] |  +- io.opentracing.contrib:opentracing-tracerresolver:jar:0.1.4:compile
[INFO] |  \- org.springframework.boot:spring-boot-autoconfigure:jar:2.0.2.RELEASE:compile
[INFO] +- io.jaegertracing:jaeger-core:jar:0.32.0:compile
[INFO] |  +- io.opentracing:opentracing-api:jar:0.31.0:compile
[INFO] |  +- io.opentracing:opentracing-util:jar:0.31.0:compile
[INFO] |  |  \- io.opentracing:opentracing-noop:jar:0.31.0:compile
[INFO] |  +- com.google.code.gson:gson:jar:2.8.4:compile
[INFO] |  \- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO] \- org.springframework.boot:spring-boot-starter-test:jar:2.0.2.RELEASE:test
[INFO]    +- org.springframework.boot:spring-boot-test:jar:2.0.2.RELEASE:test
[INFO]    +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.0.2.RELEASE:test
[INFO]    +- com.jayway.jsonpath:json-path:jar:2.4.0:test
[INFO]    |  \- net.minidev:json-smart:jar:2.3:test
[INFO]    |     \- net.minidev:accessors-smart:jar:1.2:test
[INFO]    |        \- org.ow2.asm:asm:jar:5.0.4:test
[INFO]    +- junit:junit:jar:4.12:test
[INFO]    +- org.assertj:assertj-core:jar:3.9.1:test
[INFO]    +- org.mockito:mockito-core:jar:2.15.0:test
[INFO]    |  +- net.bytebuddy:byte-buddy:jar:1.7.11:test
[INFO]    |  +- net.bytebuddy:byte-buddy-agent:jar:1.7.11:test
[INFO]    |  \- org.objenesis:objenesis:jar:2.6:test
[INFO]    +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO]    +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO]    +- org.skyscreamer:jsonassert:jar:1.5.0:test
[INFO]    |  \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO]    +- org.springframework:spring-core:jar:5.0.6.RELEASE:compile
[INFO]    |  \- org.springframework:spring-jcl:jar:5.0.6.RELEASE:compile
[INFO]    +- org.springframework:spring-test:jar:5.0.6.RELEASE:test
[INFO]    \- org.xmlunit:xmlunit-core:jar:2.5.1:test

Björn K.

unread,
Nov 29, 2018, 5:38:55 AM11/29/18
to Jaeger Tracing
Here's some additional information:

I've set a breakpoint in io.jaegertracing.internal.JaegerTracer::reportSpan(JaegerSpan span). I can see that this.reporter uses NoopSender as sender. In the working project sender references a UDPSender instance.

From my understanding Spring should take care of setting up the UDPSender from the properties specified in application.properties.

Björn K.

unread,
Nov 29, 2018, 6:15:27 AM11/29/18
to Jaeger Tracing
Ok, I solved the problem:

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


This was the missing dependency.

I found that out by debugging deeper into into the construction process of the JaegerTracer. io.jaegertracing.internal.senders.SenderResolver::resolve queried its factory, but got no Senders. So I tried including other Jaeger dependencies, which led me to Thrift.

Best regards and thanks for the dependency hinting!
Björn
Reply all
Reply to author
Forward
0 new messages