Skip to content

Conversation

@qinfchen
Copy link
Contributor

@qinfchen qinfchen commented Sep 5, 2018

remoting-tracing has been moved to https://github.com/palantir/tracing-java

@qinfchen qinfchen requested review from j-baker and schlosna September 5, 2018 14:51
versions.props Outdated
com.google.guava:* = 18.0
com.palantir.baseline:* = 0.29.4
com.palantir.remoting3:* = 3.5.1
com.palantir.tracing:* = 1.1.0
Copy link
Contributor

Choose a reason for hiding this comment

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

@qinfchen Do we have a gradle substitute rule for this for downstream consumers?

Copy link
Contributor

Choose a reason for hiding this comment

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

actually, nevermind as we're changing packages as well so consumers can have both remoting3 & new tracing coexist peacefully, though we'll want all tracing using a single Tracer

Copy link
Contributor

Choose a reason for hiding this comment

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

having both co-existing is actually quite concerning though, because if com.palantir.remoting3.Tracer#getTraceId() and com.palantir.tracing.Tracer#getTraceId() disagree then you'd be in a pretty weird state. Also the logging subscribers will probably only be attached to one of them!

Copy link
Contributor

@iamdanfox iamdanfox left a comment

Choose a reason for hiding this comment

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

Can we take a few mins to plan how we do this seamlessly?

@j-baker
Copy link
Contributor

j-baker commented Sep 5, 2018

Why would we rebrand tracing? Doesn't it just break all of our tracing?

@j-baker
Copy link
Contributor

j-baker commented Sep 5, 2018

It's all based around thread locals, you need everyone to be using the same thread locals :(

api project(':tritium-api')
api project(':tritium-core')
api 'com.palantir.remoting3:tracing'
api 'com.palantir.tracing:tracing-api'
Copy link
Contributor

Choose a reason for hiding this comment

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

does this even need to be api?

Copy link
Contributor

Choose a reason for hiding this comment

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

moving tracing to implementation

Copy link
Contributor

@schlosna schlosna left a comment

Choose a reason for hiding this comment

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

Putting on hold per @iamdanfox & @j-baker discussion around coalescing from remoting3 to single Tracer

@iamdanfox
Copy link
Contributor

OK here's a proposal:

  1. let's release a version of com.palantir.remoting3.Tracer which delegates all methods to the shiny new com.palantir.tracing.Tracer.
  2. add a static block to some class in tracing-java that throws if the remoting3 Tracers class is on the classpath (it would check implementationVersion and allow the ones that delegate)

@schlosna
Copy link
Contributor

schlosna commented Sep 5, 2018

@iamdanfox 's proposal sounds reasonable to me. Should we have similar plumbing & state checks for remoting2 & remoting1 Tracers? We'll also want to manually migrate folks like AtlasDB CloseableTrace over as well.

https://github.com/palantir/http-remoting/blob/2.6.3/tracing/src/main/java/com/palantir/remoting2/tracing/Tracer.java
https://github.com/palantir/http-remoting/blob/1.1.2/tracing/src/main/java/com/palantir/remoting1/tracing/Tracer.java

@iamdanfox
Copy link
Contributor

@schlosna from 3.43.0 onwards, remoting3's tracing delegates to the shiny new tracing jars so I think this is now ready to consider merging again!

@schlosna
Copy link
Contributor

@iamdanfox we probably need to force folks to upgrade to remoting3 3.43.0+ before I can merge this.

Copy link
Contributor

@schlosna schlosna left a comment

Choose a reason for hiding this comment

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

@iamdanfox I think I'm happy with this now. I added some defensive code here to try and prevent double tracing where folks still have an older http-remoting3 tracer.


private static boolean shouldUseJavaTracing() {
// ugly but avoids double traces if old http-remoting3 tracing does not delegate to java-tracing
Runnable wrappedTrace = com.palantir.remoting3.tracing.Tracers.wrap(() -> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally, I'd prefer not to require this class on the classpath. What about using reflection to just test for the existence of this class, then use .getPackage().getImplementationVersion()?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I can adjust this to test using reflection and fallback to reflection for slow path when old remoting3 is detected. I won’t keep that in tritium long term, but know there are some places that won’t get both excavated together, so want some transition time.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you have a time frame you need this change & release?

@schlosna
Copy link
Contributor

schlosna commented Oct 1, 2018

@iamdanfox Updated to use reflection check & fallback to reflection. Let me know if this looks good to you and I'll merge & tag a build

Copy link
Contributor

@schlosna schlosna left a comment

Choose a reason for hiding this comment

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

There are significant performance slow downs using the new com.palantir.tracing.Tracer implementation as evidenced by jmh, see
#115 (comment):

Before, using com.palantir.remoting3:tracing on develop:

Benchmark                                          Mode  Cnt    Score    Error  Units
ProxyBenchmark.instrumentedWithEverything          avgt    5  882.844 ± 52.446  ns/op
ProxyBenchmark.instrumentedWithTracing             avgt    5  450.734 ± 74.964  ns/op
ProxyBenchmark.instrumentedWithMetrics             avgt    5  352.870 ±  5.791  ns/op
ProxyBenchmark.instrumentedWithPerformanceLogging  avgt    5   17.203 ±  0.932  ns/op
ProxyBenchmark.raw                                 avgt    5    3.001 ±  0.232  ns/op

After, using com.palantir.tracing.Tracer on ds/java-tracing:

Benchmark                                          Mode  Cnt     Score    Error  Units
ProxyBenchmark.instrumentedWithEverything          avgt    5  1447.724 ± 26.477  ns/op
ProxyBenchmark.instrumentedWithTracing             avgt    5   630.983 ± 18.414  ns/op
ProxyBenchmark.instrumentedWithMetrics             avgt    5   355.538 ±  9.785  ns/op
ProxyBenchmark.instrumentedWithPerformanceLogging  avgt    5    17.266 ±  0.511  ns/op
ProxyBenchmark.raw                                 avgt    5     2.912 ±  0.061  ns/op

@schlosna schlosna merged commit e8872e1 into develop Oct 17, 2018
@schlosna schlosna deleted the qchen/tracing branch October 17, 2018 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants