Skip to content

fix: clear OTel context after span execution#395

Open
nicobritos wants to merge 1 commit intotemporalio:mainfrom
nicobritos:fix-otel-attach
Open

fix: clear OTel context after span execution#395
nicobritos wants to merge 1 commit intotemporalio:mainfrom
nicobritos:fix-otel-attach

Conversation

@nicobritos
Copy link

Ensure Context#detach is called after span execution to avoid spans being associated with incorrect traces.

What was changed

Why?

See #394

Checklist

  1. Closes [Bug] OTeL trace context leaking between workflows when threads/fibers are reused #394

  2. How was this tested:
    See [Bug] OTeL trace context leaking between workflows when threads/fibers are reused #394 for reproduction.

Also, test were added for this case. Commenting temporalio/lib/temporalio/contrib/open_telemetry.rb:83 should fail the test.

  1. Any docs updates needed? No

Ensure Context#detach is called after span execution to avoid
spans being associated with incorrect traces.
@nicobritos nicobritos requested a review from a team as a code owner March 5, 2026 14:58
@CLAassistant
Copy link

CLAassistant commented Mar 5, 2026

CLA assistant check
All committers have signed the CLA.

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.

[Bug] OTeL trace context leaking between workflows when threads/fibers are reused

2 participants