helidon-io / helidon

Java libraries for writing microservices
https://helidon.io
Apache License 2.0
3.44k stars 562 forks source link

Check delegate before Helidon wrapper in tracer `unwrap` method #8854

Closed tjquinno closed 4 weeks ago

tjquinno commented 4 weeks ago

Environment Details


Problem Description

In a recent PR, the OTel implementation of the Helidon neutral Tracer interface implementation of the unwrap method added checking of the Helidon wrapper object as well as the delegate.

But that change checks the wrapper first and the delegate second, which changes some behavior (such as unwrapping as Object and printing the unwrapped object's toString() value). This is also the opposite order that the pre-existing OpenTracing Tracer unwrap method checks the two objects.

Steps to reproduce

With the OTel tracing provider in use, invoke helidonTracer.unwrap(Object.class).toString() and you see the Helidon wrapper's value, not the delegate's value as before.