Repository navigation
Conversation
Save the current baggage value after each request step and restore it after execution context loss. Detach inherited holders before restoring baggage so older API versions cannot change another operation's baggage. Compatibility follow-up for open-telemetry/opentelemetry-dotnet#8042. Discovered by Anthropic's OSS Scanner, as bug ANT-2026-YXEDG1G8.
Pull request dashboard statusWaiting on maintainers · refreshed 2026-11-10 08:06 UTC Merge when ready. Status above doesn't look right?
|
Replace the temporary changelog reference with contrib PR open-telemetry#5948. Discovered by Anthropic's OSS Scanner, as bug ANT-2026-YXEDG1G8.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5948 +/- ##
=======================================
Coverage 79.75% 79.76%
=======================================
Files 520 520
Lines 22786 22793 +7
Branches 3677 3678 +1
=======================================
+ Hits 18174 18181 +7
Misses 3915 3915
Partials 697 697
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Kielek
marked this pull request as ready for review
November 10, 2026 06:34
6 of 8 tasks
martincostello
approved these changes
Nov 10, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow up to open-telemetry/opentelemetry-dotnet#8042
If we have agreement on open-telemetry/opentelemetry-dotnet#8042, this PR can land even now without releases in the upstream.
Changes was tested locally with local build and also with 1.20.1. All works as expected.
Changes
TelemetryHttpModulenow saves the currentBaggagevalue after each requeststep, including when the step throws, and restores it when ASP.NET loses the
execution context. This preserves additions, updates, and clearing with the
isolated baggage writes proposed in
open-telemetry/opentelemetry-dotnet#8042.
Previously the module retained the request-start holder, which becomes stale
when writes replace that holder.
Restoration detaches any inherited holder before assigning
Baggage.Current,so older API versions also preserve the other execution context's baggage.
Trace-only propagation and completed requests retain their existing behavior.
The change uses existing APIs and works with the published API without a
dependency version bump.
Validation
steps, other inherited contexts, trace-only propagation, and request completion.
expected failures, including an existing regression.
build with safe and legacy flow: 132 passed and 2 skipped per configuration.
source sanity checks pass. Formatting reports workspace-loading warnings.
end-to-end IIS/native-thread-switch run is claimed.
Merge requirement checklist
CHANGELOG.mdfile(s) updated for non-trivial changesNote
This PR description was assisted with OpenAI Codex.
Footnotes
Yes, I can answer maintainer questions about the content of this PR without using AI. ↩