play-zipkin-tracing
play-zipkin-tracing copied to clipboard
support overriding context
currently my play application uses finagle to communicate with other services. i would like to use the finaggle context in the tracer so that everything lines up. the problem is that the version of brave in this lib is too old to set the context of the tracer. it would be great if we could configure the tracing context like
Tracer tracer = Tracing.newBuilder()
.currentTraceContext(new FinagleCurrentTraceContext()).build().tracer();
You are right. The version of brave is old. OK, we will handle this soon.
@LarryFinn 1.2.0-SNAPSHOT has been deployed to the sonatype snapshot repository: https://oss.sonatype.org/content/repositories/snapshots/
Using this snapshot, you can do it by overriding ZipkinTraceService.tracing, and create an alternative module of ZipkinModule to bind your extended class to ZipkinTraceServiceLike.
Could you try it? If it works fine, we will release 1.2.0 after some extra fixes.
curious on this, would we need to do something to hook brave Tracing.currentTraceContext() to the akka dispatcher's executor somehow? It seems like if we didn't asynchronous code would lose the context (which might be backed by finagle implementation)
http://doc.akka.io/docs/akka/current/scala/dispatchers.html#types-of-dispatchers
Hmm... I'm not sure about Finagle implementation, so I don't know clearly what do we have to do to propagate the context between Play and Finagle.
@LarryFinn Do you have any advice?
Naoki, so one thing to experiment with is using Brave's log4j or slf4j integration. If an async callback doesn't show up in the logs then the context isn't being used properly. Once this works, finagle will work (as it is also a plugin like slf4j)