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

[jaeger-client-java/jax-rs2] Remove jaeger-context dependence for JAX-RS2 jaeger instrumentation #319

Merged
merged 20 commits into from
Jan 30, 2018

Conversation

dray92
Copy link
Contributor

@dray92 dray92 commented Jan 20, 2018

Have not removed from build.gradle since deprecated class TracingUtils still depends on it.

@codecov
Copy link

codecov bot commented Jan 20, 2018

Codecov Report

Merging #319 into master will increase coverage by 0.38%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #319      +/-   ##
============================================
+ Coverage     83.79%   84.17%   +0.38%     
- Complexity      563      565       +2     
============================================
  Files            91       91              
  Lines          2222     2225       +3     
  Branches        257      258       +1     
============================================
+ Hits           1862     1873      +11     
+ Misses          258      251       -7     
+ Partials        102      101       -1
Impacted Files Coverage Δ Complexity Δ
...a/com/uber/jaeger/filters/jaxrs2/TracingUtils.java 42.85% <ø> (-14.29%) 2 <0> (-1)
...a/com/uber/jaeger/filters/jaxrs2/ServerFilter.java 95% <ø> (ø) 8 <0> (ø) ⬇️
...eger/filters/jaxrs2/ClientSpanInjectionFilter.java 84.21% <ø> (+10.52%) 5 <0> (+1) ⬆️
...a/com/uber/jaeger/filters/jaxrs2/ClientFilter.java 100% <ø> (ø) 5 <0> (ø) ⬇️
...aeger/filters/jaxrs2/ClientSpanCreationFilter.java 100% <100%> (ø) 4 <2> (+1) ⬆️
...ger-core/src/main/java/com/uber/jaeger/Tracer.java 86.89% <0%> (+0.43%) 20% <0%> (+1%) ⬆️
...java/com/uber/jaeger/reporters/RemoteReporter.java 90% <0%> (+2.85%) 9% <0%> (ø) ⬇️
...jaeger/reporters/protocols/ThriftUdpTransport.java 84.74% <0%> (+3.38%) 14% <0%> (ø) ⬇️
...ain/java/com/uber/jaeger/senders/ThriftSender.java 77.55% <0%> (+4.08%) 10% <0%> (ø) ⬇️

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 0a5090e...1751422. Read the comment docs.

@yurishkuro
Copy link
Member

Related to #188

@@ -63,8 +60,7 @@ public void setUp() throws Exception {
tracer =
new com.uber.jaeger.Tracer.Builder("Angry Machine", reporter, new ConstSampler(true))
.build();
traceContext = new ScopeManagerTraceContext(tracer.scopeManager());
undertest = new ClientFilter(tracer, traceContext);
undertest = new ClientFilter(tracer);
Copy link
Member

Choose a reason for hiding this comment

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

Doing this reduces code coverage because the deprecated methods are no longer exercised. Is there a way to exclude them from coverage?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

let me look around

Copy link
Contributor Author

@dray92 dray92 Jan 21, 2018

Choose a reason for hiding this comment

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

jacoco plugin version 0.8 seems to support this {PR}

Methods annotated with @lombok.Generated (generated by Lombok getters, setters, equals, hashcode, toString, etc)

Copy link
Member

Choose a reason for hiding this comment

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

yeah, that looks dirty. Why not just invoke the deprecated methods here, like new ClientFilter(tracer, null);? Strictly speaking just because a function is deprecated doesn't mean it does not need to work correctly, so exercising it in tests is a good thing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

haha yes looks very wretched

yup! just gonna call the deprecate methods :)

@dray92
Copy link
Contributor Author

dray92 commented Jan 21, 2018

@yurishkuro lombok generated annotation + jacoco 0.8 definitely seems to do the trick, but it is a little bit of a hack - depends on how you feel about it :)

Copy link
Contributor

@vprithvi vprithvi left a comment

Choose a reason for hiding this comment

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

Looks good, also remove the jaeger-context subproject dependency in build.gradle

build.gradle Outdated
@@ -46,6 +46,10 @@ allprojects {
}
}

jacoco {
toolVersion = "0.8.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this still required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nah - not really; getting rid of it

@dray92
Copy link
Contributor Author

dray92 commented Jan 22, 2018

@vprithvi Can't get rid of jaeger-context from jaeger-jaxrs2/build.gradle

Deprecated methods will need it as compile time dep :(
Leaving a comment/fixme item for when the deprecated functions are removed

@@ -60,7 +57,7 @@ public void setUp() {
tracer =
new com.uber.jaeger.Tracer.Builder("Angry Machine", reporter, new ConstSampler(true))
.build();
undertest = new ServerFilter(tracer);
undertest = new ServerFilter(tracer, null);
Copy link
Member

Choose a reason for hiding this comment

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

may want to add a comment "Using deprecated constructor for test coverage"

@@ -63,8 +60,7 @@ public void setUp() throws Exception {
tracer =
new com.uber.jaeger.Tracer.Builder("Angry Machine", reporter, new ConstSampler(true))
.build();
traceContext = new ScopeManagerTraceContext(tracer.scopeManager());
undertest = new ClientFilter(tracer, traceContext);
undertest = new ClientFilter(tracer, null);
Copy link
Member

Choose a reason for hiding this comment

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

may want to add a comment "Using deprecated constructor for test coverage"

tracer.scopeManager().activate(currentSpan, true);
when(clientRequestContext.getProperty(CURRENT_SPAN_CONTEXT_KEY)).thenReturn(currentSpan);

// FIXME (debo): remove to use {@link ClientSpanInjectionFilter(Tracer)}
Copy link
Member

Choose a reason for hiding this comment

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

may want to add a comment "Using deprecated constructor for test coverage"

@dray92 dray92 force-pushed the jaxrs2_remove_tracing_utils branch 2 times, most recently from f2e5f18 to 4edc8cd Compare January 24, 2018 06:15
…-RS2 tracing instrumentation

Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
…-RS2 tracing instrumentation

Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
Signed-off-by: Debosmit Ray <debo@uber.com>
@dray92 dray92 force-pushed the jaxrs2_remove_tracing_utils branch from 4edc8cd to 7c02f90 Compare January 26, 2018 07:52
@dray92
Copy link
Contributor Author

dray92 commented Jan 26, 2018

rebased on master

debo-C02V61KPHTDG:jaeger-client-java Debo$ git diff origin/jaxrs2_remove_tracing_utils
diff --git a/.travis.yml b/.travis.yml
index 74e0fb1..6524764 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -37,7 +37,7 @@ before_install:
 - ./travis/prepare-signing.sh $encrypted_677f232983c0_key $encrypted_677f232983c0_iv
 - if [ "$CROSSDOCK" == true ]; then bash ./travis/install-crossdock-deps.sh ; fi
 script:
-- if [ "$TESTS" == true ]; then make test ; else echo 'skipping tests'; fi
+- if [ "$TESTS" == true ]; then travis_wait 25 make test-travis ; else echo 'skipping tests'; fi
 - if [ "$COVERAGE" == true ]; then ./gradlew codeCoverageReport ; else echo 'skipping coverage'; fi
 - if [ "$CROSSDOCK" == true ]; then bash ./travis/build-crossdock.sh ; else echo 'skipping crossdock'; fi
 after_success:
diff --git a/Makefile b/Makefile
index 81d38f6..7170c69 100644
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,10 @@ clean:
 test:
        ./gradlew check
 
+.PHONY: test-travis
+test-travis:
+       ./gradlew -is check --info
+
 .PHONY: release
 release: clean
        ./gradlew -i uploadArchives

@yurishkuro
Copy link
Member

can you rebase off master?

@ghost ghost assigned yurishkuro Jan 30, 2018
@ghost ghost added the review label Jan 30, 2018
@yurishkuro
Copy link
Member

nvm, I think I was able to do it myself

@vprithvi vprithvi merged commit 0b1b547 into jaegertracing:master Jan 30, 2018
@ghost ghost removed the review label Jan 30, 2018
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.

None yet

4 participants