I don't know much about tracing. I am trying to apply tracing to event-driven/reactive code (both in-process and cross-process) in order to make event chains more visible and to provide profiling data for optimizations.
Event-driven and reactive systems have inverted call stacks. While normal traces look like A.produceX() -> B.produceY() -> C.getZ(), event-driven and reactive traces look like C.handleX() -> B.invalidateY() -> A.updateZ(). This looks odd, but all the information is still there.
The problem becomes apparent when one of the lower-level components decides that propagating some event upwards is unnecessary. The trace then looks like C.handleX() -> B.invalidateY(). Object A, the owner of the whole object graph, is left out, including all identifying information in its tags. Such headless traces are often quite useless.
As a workaround, I am currently propagating tags down the ownership tree (A's tags to B and C and B's tags to C). This works, but it's messy, results in repetitive tags in spans, and adds overhead.
I was thinking that maybe opentracing could include explicit modelling of ownership relationships. Every span could have an owner and every owner could have a higher-level owner. Owners could have tags.
In event-driven and reactive programs, events are first subscribed before the backflow of events starts. This subscription is a good opportunity to capture and remember the owner relationship that can be subsequently added to all spans.