scala instrumentation#255
Conversation
20aef1c to
3f6bf62
Compare
There was a problem hiding this comment.
Can you move these tests to the java-concurrent instrumentation, since isn't that what it depends on?
Since the tests use @Trace you can add a testCompile dependency on the trace annotation instrumentation as well.
There was a problem hiding this comment.
I originally did that, but ran into a problem. Bootstrap instrumentation is incompatible with our current test api.
My plan is to fix that as part of the akka tests, then move these tests over. Any objections to leaving them in the integration tests for a little while?
There was a problem hiding this comment.
Eew... are these sleeps necessary?
I would much rather use something like a Phaser than have a bunch of sleeps...
There was a problem hiding this comment.
This is a java class in the groovy folder. Can you move it over or make it a groovy class?
There was a problem hiding this comment.
Try using a Phaser instead.
There was a problem hiding this comment.
Do you care about the ordering or the hierarchy of the trace? Might be good to assert the parental relationship, not just the count.
There was a problem hiding this comment.
I'm curious... what's the reason to use a HashSet here? If the type matters, maybe you should inspect the type of Collection to see if it's a List or a Set and choose the one that matches.
There was a problem hiding this comment.
No particular reason for picking HashSet. I just need a collection to pass to the executor. A list would work fine also. I don't need to preserve the type of tasks.
There was a problem hiding this comment.
There are several cases above where you don't wrap the job. Maybe do a type check before casting?
There was a problem hiding this comment.
Everything from @Advice.Enter should be a DatadogWrapper at this point (assuming wrappedJobs is non-null). Did I miss something?
There was a problem hiding this comment.
Maybe consider adding the close() method for canceling?
There was a problem hiding this comment.
Can this be moved to the module instead of being in ittests, or does the bootstrap class issue prevent that?
|
Do you have a feel for what versions of scala this would support? |
|
I've tested against Scala 2.11 and 2.12. |
3f6bf62 to
dfe267e
Compare
There was a problem hiding this comment.
I don't think this is used anymore...
There was a problem hiding this comment.
Any time I see us instrumenting an anonymous class like this, I expect it to be very fragile across versions.
13c354a to
4fffb61
Compare
90111f5 to
7f57924
Compare
|
@tylerbenson Changes pushed. Notably, I removed the opentracing dependency from dd-trace-api. |
7f57924 to
45aff57
Compare
| testWriter.size() == 1 | ||
| trace.size() == 2 | ||
| trace.get(0).operationName == "parent" | ||
| trace.get(1).operationName == "asyncChild" |
There was a problem hiding this comment.
Minor, but maybe assert that child's parentId is parent's spanId?
| package datadog.trace.context; | ||
|
|
||
| /** An object when can propagate a datadog trace across multiple threads. */ | ||
| public interface ContextPropagator { |
There was a problem hiding this comment.
Thoughts on just renaming this to Scope or TraceScope?
tylerbenson
left a comment
There was a problem hiding this comment.
Only question is if we want to change the name of ContextPropagator.
c8d961a to
428e304
Compare
|
Renamed |
(merging to feature branch)
Propagate traces along
scala.concurrent.*classes (Future, Promise, Map) by instrumenting Java executors.submitandexecute.As a precaution, the instrumented executors/futures are limited to a whitelist of tested implementation classes. In the future we may want to remove this whitelist and instrument all executors.