Skip to content

Conversation

@laurit
Copy link
Contributor

@laurit laurit commented Oct 24, 2024

Resolves #12504
In case of unbridgeable span we currently return null context from SpanKey.storeInContext which is unexpected. This PR changes the behavior so that when the span can't be bridged we'll let the original method proceed and store the span using the unbridged key in the application context. Similarly reading the span will fall back to the application context when the span is not found from the agent context.

@laurit laurit requested a review from a team as a code owner October 24, 2024 07:56
Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, basically giving priority to the agent span key and if not found then falling back to the application span key (if any)

…c/main/java/io/opentelemetry/javaagent/instrumentation/instrumentationapi/SpanKeyInstrumentation.java

Co-authored-by: Trask Stalnaker <[email protected]>
@laurit laurit enabled auto-merge (squash) October 25, 2024 06:26
@laurit laurit merged commit 970881a into open-telemetry:main Oct 25, 2024
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

opentelemetry-javaagent cause resttemplate error

2 participants