EDIT: After some more experimenting, I got the tracing to work with GlobalTracer.
I had to reformat the code somewhat. The use of a separate execution context for database calls made the calls lose their tracing scope context, apparently.
Jaeger Tracing uses a ThreadLocal scope, which would explain that(I think).
I’ve always assumed this, but was never certain.
When play receives an HTTP call, is this handled within its own thread? As in, each call is its own thread?
Reason I’m asking is because I’m wondering about Dependency Injection acts singleton… but per thread.
So not Singleton in the sense of “one instance for the entire application, shared across all threads”, but “one instance per thread”.
Which is related to trying to get tracing to work: https://github.com/KoenDG/play-java-ebean-example/pull/1
The main problem being that either you have a singleton which isn’t what I need(I think), or the dependency injection creates a new object every time it’s injected, which also isn’t what I need.
The main solution I can think of now is to put it in the ThreadLocal Context and request it where I need it.