openzipkin / brave

Java distributed tracing implementation compatible with Zipkin backend services.
Apache License 2.0
2.35k stars 714 forks source link

MutableSpan.clone isn't implemented #1429

Open codefromthecrypt opened 3 months ago

codefromthecrypt commented 3 months ago

MutableSpan.clone isn't implemented. It was originally here for folks to transfer a mutable span to another thread when they weren't the end of the line of SpanHandlers.

As no one noticed, it probably doesn't matter, but raising just in case someone cars.

workaround:

You can return false on SpanHandler.end after transferring your span to another thread meanwhile. Returning false will prevent a later handler from working on the same object, and has no harm in typical case where there is only one handler (span reporter) or that is at the end anyway.

codefromthecrypt commented 3 months ago

I think this is also not relevant when all handlers read, but don't mutate, the span.