[release/5.0] Preserve client order of activity baggage items (#26302)#26395
Merged
Conversation
|
Hello human! Please make sure you've included the Shiproom Template in a comment or (preferably) the PR description. Also, make sure this PR is not marked as a draft and is ready-to-merge. |
This was referenced Sep 28, 2020
Contributor
Author
|
I assume the test failures are because dotnet/runtime#42712 hasn't yet propagated to the aspnetcore repo |
62cb3dc to
5aa8237
Compare
Member
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
Contributor
Author
|
Will rebase to include #26404 |
5aa8237 to
45958d0
Compare
Tratcher
approved these changes
Oct 2, 2020
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.
Backport #26302 from master to release/5.0
Description
ASP.NET Core populates
Activity.Baggageitems based on the incomingCorrelation-ContextHTTP header.This PR changes the order in which items are added to
Activity.Baggage.Customer Impact
Since the W3C spec for baggage allows for duplicate keys order is important.
Activity.GetBaggageItem()doesn't have predictable behavior today in the presence of duplicate key since the order of items inActivity.Baggagegets flipped at every HTTP hop.Regression
This has always been broken since we never tested
Activity.GetBaggageItem()with duplicate keys.Testing
We have a unit test verifying this is the desired behavior.
Risk
The result of
Activity.GetBaggageItem()will change in certain scenarios. Someone relying on the existing behavior could be impacted, however this is extremely unlikely.We don't yet expect folks to directly be consuming this API. It's better to fix this API before OpenTelemetry (in beta, tracking towards GA) adoption increases usage of this API.