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

Slight clean-up of recent baggage and span scope fix #8258

Merged
merged 1 commit into from Jan 18, 2024

Conversation

tjquinno
Copy link
Member

Description

Further fine-tuning to earlier fix for #8187

The earlier fix properly make sure that, when activating a span, the scope resulting from making an Otel context current correctly reflected both the span information and the baggage.

Because of the way Otel contexts work, we have to create two new contexts, one with the span information, and then another that adds the baggage information. The earlier fix made each of these two contexts "current" on the Otel context stack. That worked, because the context corresponding to the second "active" scope reflected the span and baggage info. Then, when the Helidon Scope was closed the earlier fix closed both scopes internally.

But there is no need to create two scopes and make both of them current and then close both of them later when the Helidon Scope is closed.

This fine-tuning still creates two contexts (necessarily, as noted above) but only uses the second one (that knows about both span and baggage info). It creates only one scope by making that "all-knowing" context current. Then, when the Helidon Scope is closed, there's only the one Otel Scope to close.

This PR also fixes a small bug in the earlier fix which failed to create an "all-knowing" Otel context when creating a context for the Helidon SpanContext

Documentation

No doc impact.

Signed-off-by: Tim Quinn <tim.quinn@oracle.com>
@tjquinno tjquinno self-assigned this Jan 18, 2024
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jan 18, 2024
@tjquinno tjquinno merged commit da8db2f into helidon-io:main Jan 18, 2024
12 checks passed
@tjquinno tjquinno deleted the 4.x-baggage-fine-tuning branch January 18, 2024 13:51
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.

None yet

2 participants