Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jun 6, 2024

Conversation

tjquinno
Copy link
Member

@tjquinno tjquinno commented Jun 6, 2024

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.

Signed-off-by: Tim Quinn <tim.quinn@oracle.com>
@tjquinno tjquinno self-assigned this Jun 6, 2024
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jun 6, 2024
@tjquinno tjquinno merged commit e4f997b into helidon-io:main Jun 6, 2024
12 checks passed
@tjquinno tjquinno deleted the 4.x-unwrap-ordering branch June 6, 2024 17:27
barchetta pushed a commit to barchetta/helidon that referenced this pull request Jun 6, 2024
…on-io#8855)

* Reorder checking of delegate vs. wrapper in OTel tracer unwrap

Signed-off-by: Tim Quinn <tim.quinn@oracle.com>

* Relax the test a bit making sure unwrap(Object.class) returns what we expect

---------

Signed-off-by: Tim Quinn <tim.quinn@oracle.com>
barchetta added a commit that referenced this pull request Jun 6, 2024
#8859)

* Reorder checking of delegate vs. wrapper in OTel tracer unwrap
* Relax the test a bit making sure unwrap(Object.class) returns what we expect
---------
Signed-off-by: Tim Quinn <tim.quinn@oracle.com>
Co-authored-by: Tim Quinn <tim.quinn@oracle.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check delegate before Helidon wrapper in tracer unwrap method
2 participants