Skip to content

[release/5.0] Preserve client order of activity baggage items (#26302)#26395

Merged
wtgodbe merged 1 commit into
release/5.0from
shirhatti/baggage-5.0
Oct 5, 2020
Merged

[release/5.0] Preserve client order of activity baggage items (#26302)#26395
wtgodbe merged 1 commit into
release/5.0from
shirhatti/baggage-5.0

Conversation

@shirhatti

@shirhatti shirhatti commented Sep 28, 2020

Copy link
Copy Markdown
Contributor

Backport #26302 from master to release/5.0

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 19:53
@ghost ghost added the area-hosting label Sep 28, 2020
@shirhatti shirhatti added the Servicing-consider Shiproom approval is required for the issue label Sep 28, 2020
@ghost

ghost commented Sep 28, 2020

Copy link
Copy Markdown

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.

@shirhatti

Copy link
Copy Markdown
Contributor Author

I assume the test failures are because dotnet/runtime#42712 hasn't yet propagated to the aspnetcore repo

@shirhatti shirhatti force-pushed the shirhatti/baggage-5.0 branch from 62cb3dc to 5aa8237 Compare September 30, 2020 19:20
@Tratcher

Tratcher commented Oct 1, 2020

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@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
@shirhatti

Copy link
Copy Markdown
Contributor Author

Will rebase to include #26404

@shirhatti shirhatti force-pushed the shirhatti/baggage-5.0 branch from 5aa8237 to 45958d0 Compare October 2, 2020 20:30
@wtgodbe wtgodbe merged commit fda7d1d into release/5.0 Oct 5, 2020
@wtgodbe wtgodbe deleted the shirhatti/baggage-5.0 branch October 5, 2020 21:29
@amcasey amcasey added the area-hosting Includes Hosting label Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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