Skip to content

[release/3.1] Preserve client order of activity baggage items (#26302) #26398

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
Oct 13, 2020

Conversation

shirhatti
Copy link
Contributor

@shirhatti shirhatti commented Sep 28, 2020

Backport #26302 from master to release/3.1

Description

ASP.NET Core populates Activity.Baggage items based on the incoming Correlation-Context HTTP 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 in Activity.Baggage gets 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.

@shirhatti shirhatti requested a review from Tratcher as a code owner September 28, 2020 20:22
@ghost ghost added the area-hosting label Sep 28, 2020
@shirhatti
Copy link
Contributor Author

Incidentally this backport PR also addresses #18600

@shirhatti shirhatti added the Servicing-consider Shiproom approval is required for the issue label Sep 28, 2020
@ghost
Copy link

ghost commented Sep 28, 2020

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.

@Pilchie Pilchie added this to the 3.1.x milestone Sep 28, 2020
@leecow leecow added Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels Oct 1, 2020
@leecow leecow modified the milestones: 3.1.x, 3.1.11, 3.1.10 Oct 1, 2020
@wtgodbe wtgodbe merged commit 81008e5 into release/3.1 Oct 13, 2020
@wtgodbe wtgodbe deleted the shirhatti/baggage-3.1 branch October 13, 2020 20:05
@amcasey amcasey added the area-hosting Includes Hosting label Jun 1, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area-hosting Includes Hosting Servicing-approved Shiproom has approved the issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants