helidon-io / helidon

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

Reorder checking of delegate vs. wrapper in OTel tracer unwrap #8855

Closed tjquinno closed 4 weeks ago

tjquinno commented 4 weeks ago

Description

Resolves #8854

A recent PR added the ability to unwrap the OTel tracer as the Helidon Tracer wrapper (to the pre-existing ability to unwrap the OTel delegate tracer) by checking the wrapper first, then the delegate.

This broke previous behavior where users used unwrap(Object.class).toString() to display delegate information.

This PR reorders the checking in the OTel Tracer wrapper to restore the earlier behavior for unwrapping as Object while still adding the ability to unwrap as the wrapper (which was the purpose of this part of the earlier PR).

The PR also adds tests to make sure the older behavior works again.

Documentation

Bug fix; no doc impact.