Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Support OpenTracing 0.32.0 and 0.33.0 #623

Merged
merged 6 commits into from
Jul 31, 2019

Conversation

pavolloffay
Copy link
Member

Signed-off-by: Pavol Loffay [email protected]

@codecov
Copy link

codecov bot commented May 6, 2019

Codecov Report

Merging #623 into master will decrease coverage by 0.24%.
The diff coverage is 77.77%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #623      +/-   ##
============================================
- Coverage     89.62%   89.37%   -0.25%     
+ Complexity      564      562       -2     
============================================
  Files            69       69              
  Lines          2063     2071       +8     
  Branches        262      263       +1     
============================================
+ Hits           1849     1851       +2     
- Misses          134      138       +4     
- Partials         80       82       +2
Impacted Files Coverage Δ Complexity Δ
...n/java/io/jaegertracing/internal/JaegerTracer.java 88.92% <77.77%> (-0.05%) 26 <0> (ø)
...rtracing/internal/reporters/CompositeReporter.java 71.42% <0%> (-28.58%) 6% <0%> (-1%)
...gertracing/internal/reporters/LoggingReporter.java 81.81% <0%> (-9.1%) 4% <0%> (-1%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0d4c675...74af1c8. Read the comment docs.

@pavolloffay
Copy link
Member Author

wait tracerresolver has to be updated too

@bltavares
Copy link

I've recently found the error where the library is instrumented using opentracing 0.33 (on io.pedestal.log) could not use the 0.35 version of Jaeger.

It failed at runtime, when JaegerTracer tried to call .activeSpan on a scopeManager [here]

Stack trace
:via
              [{:type java.lang.NoSuchMethodError
                :message "io.opentracing.ScopeManager.activeSpan()Lio/opentracing/Span;"
                :at [io.jaegertracing.internal.JaegerTracer activeSpan "JaegerTracer.java" 194]}]
              :trace
              [[io.jaegertracing.internal.JaegerTracer activeSpan "JaegerTracer.java" 194]
               [io.opentracing.util.GlobalTracer activeSpan "GlobalTracer.java" 148]
               [io.pedestal.log$eval33020$fn__33030 invoke "log.clj" 845]

This class has been modified, but the method haven't. Could the error have been caused by version conflicts of the interface on the classpath, or is this something should be tackled by the bump as well?

(I didn't have time yet to test it with this PR code tho, sorry about that)

@objectiser
Copy link
Contributor

@bltavares Just tried calling activeSpan() via the GlobalTracer, using Jaeger 0.35.2 and OpenTracing 0.33, and it worked fine - could you double check the jaeger and OT dependencies being used?

@bltavares
Copy link

@objectiser It seems that it is loading another version of opentracing from pedestal. My bad, I've looked only on GitHub for the source of the lib, using the latest code instead of the version.

It fails with Opentracing 0.31.0 and Jaeger 0.35.5. I'll post the dep tree for sake of completeness.

dep tree
+- io.pedestal:pedestal.log:jar:0.5.5:compile
[INFO] |  |  +- (org.clojure:clojure:jar:1.9.0:compile - omitted for conflict with 1.10.0)
[INFO] |  |  +- (org.slf4j:slf4j-api:jar:1.7.25:compile - omitted for duplicate)
[INFO] |  |  +- (io.dropwizard.metrics:metrics-core:jar:4.0.2:compile - omitted for conflict with 3.2.3)
[INFO] |  |  +- io.dropwizard.metrics:metrics-jmx:jar:4.0.2:compile
[INFO] |  |  |  +- (io.dropwizard.metrics:metrics-core:jar:4.0.2:compile - omitted for conflict with 3.2.3)
[INFO] |  |  |  \- (org.slf4j:slf4j-api:jar:1.7.25:compile - omitted for duplicate)
[INFO] |  |  +- io.opentracing:opentracing-api:jar:0.31.0:compile
[INFO] |  |  \- io.opentracing:opentracing-util:jar:0.31.0:compile
[INFO] |  |     +- (io.opentracing:opentracing-api:jar:0.31.0:compile - omitted for duplicate)
[INFO] |  |     \- io.opentracing:opentracing-noop:jar:0.31.0:compile
[INFO] |  |        \- (io.opentracing:opentracing-api:jar:0.31.0:compile - omitted for duplicate)
[INFO] |  +- io.jaegertracing:jaeger-client:jar:0.35.5:compile
[INFO] |  |  +- io.jaegertracing:jaeger-thrift:jar:0.35.5:compile
[INFO] |  |  |  +- (io.jaegertracing:jaeger-core:jar:0.35.5:compile - omitted for duplicate)
[INFO] |  |  |  +- (org.slf4j:slf4j-api:jar:1.7.25:compile - omitted for duplicate)
[INFO] |  |  |  +- (org.apache.thrift:libthrift:jar:0.12.0:compile - omitted for conflict with 0.10.0)
[INFO] |  |  |  \- com.squareup.okhttp3:okhttp:jar:3.9.0:compile
[INFO] |  |  |     \- com.squareup.okio:okio:jar:1.13.0:compile
[INFO] |  |  +- io.jaegertracing:jaeger-core:jar:0.35.5:compile
[INFO] |  |  |  +- (io.opentracing:opentracing-api:jar:0.32.0:compile - omitted for conflict with 0.31.0)
[INFO] |  |  |  +- (io.opentracing:opentracing-util:jar:0.32.0:compile - omitted for conflict with 0.31.0)
[INFO] |  |  |  +- (com.google.code.gson:gson:jar:2.8.2:compile - omitted for conflict with 2.3.1)
[INFO] |  |  |  \- (org.slf4j:slf4j-api:jar:1.7.25:compile - omitted for duplicate)
[INFO] |  |  \- io.jaegertracing:jaeger-tracerresolver:jar:0.35.5:compile
[INFO] |  |     +- (io.jaegertracing:jaeger-core:jar:0.35.5:compile - omitted for duplicate)
[INFO] |  |     \- io.opentracing.contrib:opentracing-tracerresolver:jar:0.1.6:compile
[INFO] |  |        \- (io.opentracing:opentracing-api:jar:0.32.0:compile - omitted for conflict with 0.31.0)

Signed-off-by: Pavol Loffay <[email protected]>
@Override
public void close() {
wrapped.close();
if (finishSpanOnClose) {
Copy link
Member

@yurishkuro yurishkuro Jul 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: could short-circuit this at the top of the method:

if (!finishSpanOnClose) {
    return scopeManager.activate(start());
}

build.gradle Outdated
ext.guavaVersion = getProperty('guavaVersion','18.0')
ext.apacheThriftVersion = getProperty('apacheThriftVersion','0.12.0')
ext.jerseyVersion = getProperty('jerseyVersion','2.22.2')
ext.slf4jVersion = getProperty('slf4jVersion','1.7.25')
ext.gsonVersion = getProperty('gsonVersion','2.8.2')
ext.tracerResolverVersion = getProperty('tracerResolverVersion','0.1.6')
ext.tracerResolverVersion = getProperty('tracerResolverVersion','0.1.7')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Version 0.1.8 has been released with a couple of changes (adding module name and supporting classloader parameter).

Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
@pavolloffay pavolloffay changed the title Bump OpenTracing to 0.33.0 Support OpenTracing 0.32.0 and 0.33.0 Jul 31, 2019
@Deprecated
public JaegerSpan startManual() {
// @Override keep compatibility with 0.32.0
public Span startManual() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this remain JaegerSpan startManual()?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, It has to be Span now as it does not override the API anymore.

}

// @Override keep compatibility with 0.32.0
public Span span() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this return JaegerSpan?

Copy link
Member Author

@pavolloffay pavolloffay Jul 31, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the previous message, we cannot return covariant type as the method is not overridden.

@@ -89,25 +94,30 @@ public void testActiveSpanAutoReference() {
}

@Test
@SuppressWarnings("deprecation")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this test be here now? Isn't it covered in the 0.32 tests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine keeping it here too. Here it uses the direct type whereas in the 0.32 test it uses old interface.

Signed-off-by: Pavol Loffay <[email protected]>
@pavolloffay pavolloffay merged commit cf9f993 into jaegertracing:master Jul 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants