Conversation
Still Missing: * MockTracer and TestTracer must be implemented * Exectors should be subclassed with traced wrapper methods https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Executors.html * Some tests mebbe
| /** | ||
| * XXX(bhs): comment | ||
| */ | ||
| public interface ActiveSpanManager { |
There was a problem hiding this comment.
Split out from the Tracer. Also note the Snapshot sub-interface.
| /** | ||
| * XXX: comment | ||
| */ | ||
| void deactivate(Snapshot snapshot); |
There was a problem hiding this comment.
I don't love that this requires a Snapshot (rather than just a Span), but doing a Span has bad implications for the impl.
| /** | ||
| * XXX: comment | ||
| */ | ||
| public class MDCActiveSpanManager implements io.opentracing.ActiveSpanManager { |
There was a problem hiding this comment.
proving to myself that this can work well with MDC and the context map.
| void finish(); | ||
|
|
||
| // XXX: comment | ||
| boolean isFinished(); |
There was a problem hiding this comment.
this is necessary if we want to avoid Tracer/Span wrappers (which I kinda want to avoid)
|
|
||
| public class TracedExecutorService implements ExecutorService { | ||
| private ExecutorService executor; | ||
| private ActiveSpanManager manager; |
There was a problem hiding this comment.
note how this thing does not need a Tracer ref anymore, and it's also pretty easy to write given an ASM.
| * <li>If no single tracer service is found, the {@link io.opentracing.NoopTracer NoopTracer} will be used.</li> | ||
| * </ol> | ||
| */ | ||
| public final class GlobalTracer implements Tracer { |
| this.parentId = parent.spanId; | ||
| } | ||
|
|
||
| if (tracer.getActiveSpanManager() != null) { |
There was a problem hiding this comment.
would need to do something to get around all of these checks. I think it's going to be racy to have the ASM settable at something other than construction-time for a Tracer.
| public interface ActiveSpanManager { | ||
| // Basically a marker interface | ||
| public interface Snapshot { | ||
| Span span(); |
Just some commentary...