opentracing / opentracing-java

OpenTracing API for Java. 🛑 This library is DEPRECATED! https://github.com/opentracing/specification/issues/163
http://opentracing.io
Apache License 2.0
1.68k stars 344 forks source link

Something like Brave span/scope decorators should be part of opentracing-java #324

Open thegreystone opened 5 years ago

thegreystone commented 5 years ago

It's hard to build something like the java-jfr-tracer without extra object allocations unless something like this is available and supported by the tracers themselves.

yurishkuro commented 5 years ago

+1, I recently had to subclass ScopeManager just to add trace IDs to logs

mirage22 commented 5 years ago

+1, I definitely agree, make things transparent

thegreystone commented 5 years ago

The problem is that every tracer will have to implement their own custom integrations to get the best performance, unless this is available. Which means that every tracer will have their own little flavour of the functionality.

For example, in the case of the java-jfr-tracer, part of the functionality has been integrated into brave already. But only working for JDK 11 and above, and only the scope event. Which will have its own event ID. Which means any UI built for JMC will need to be either made for multiple different event flavours, or ignore the custom events in brave.

So, if this existed, the java-jfr-tracer could be built once and utilised by all tracers, at a comparable performance. And as a multirelease jar supporting Oracle JDK 8+ AND OpenJDK 11+. And supporting the span events. And work the same with all tracers, so that we could spend time on one UI with one flavour of the events.

thegreystone commented 5 years ago

If we do something like this, we may want to consider propagating the parentId. Otherwise allocations will be required for wrappers just to propagate the parentId...

thegreystone commented 5 years ago

See #336 for continued discussions.