-
Notifications
You must be signed in to change notification settings - Fork 773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[api-baggage] fix encoding of space chars in baggage item value #5303
[api-baggage] fix encoding of space chars in baggage item value #5303
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5303 +/- ##
==========================================
+ Coverage 83.38% 85.58% +2.19%
==========================================
Files 297 289 -8
Lines 12531 12588 +57
==========================================
+ Hits 10449 10773 +324
+ Misses 2082 1815 -267
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - requires changelog. @alanwest Could you take a look as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would go with #5292, but this is also improvement.
@lachmatt I missed something earlier - I think this would cause an issue due to difference in versions. https://learn.microsoft.com/en-us/dotnet/api/system.uri.unescapedatastring?view=net-8.0#remarks Consider a service using old sdk injecting baggage and receiving side service(incoming request) updates to this change. it would cause issues with space decoding. |
need more clarity #5303 (comment)
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or Pushing will instruct the bot to automatically remove the label. This bot runs once per day. |
@vishweshbankwar That's a valid concern, but I don't see a good solution for it. |
True. This is just another reason that this should be fixed. Other (compliant with the specification e.g. from other languages) implementations will encode |
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or Pushing will instruct the bot to automatically remove the label. This bot runs once per day. |
@open-telemetry/dotnet-maintainers This bug makes the baggage propagation not working properly with other SDKs. |
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or Pushing will instruct the bot to automatically remove the label. This bot runs once per day. |
@open-telemetry/dotnet-approvers PTAL. We would like to have it fixed at least for 1.8.0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@pellared - Thanks for raising this w3c/baggage#134.
I have opened #5500 on our side to further expand the tests.
@lachmatt - please add the changelog as well. |
Yes I think we should mention this in CHANGELOG and note that is it potentially a breaking change. |
src/OpenTelemetry.Api/CHANGELOG.md
Outdated
@@ -2,6 +2,10 @@ | |||
|
|||
## Unreleased | |||
|
|||
* **Breaking change:** Fix space character encoding for baggage item values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest writing explicitly that space was encoded to +
and now it is encoded to %20
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed in 50ed920
Co-authored-by: Robert Pająk <pellared@hotmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #5260
Changes
Fixes encoding of
' '
char in baggage item values when injecting baggage.Spaces should be percent-encoded, instead of being converted to
'+'
character.Note
Some characters not required to be percent-encoded by the W3C baggage specification are percent-encoded, which results in longer representation.
This might be important considering baggage limits.
Alternative:
Custom encoder, which escapes only characters required by the W3C baggage specification.
Draft in #5292
Merge requirement checklist
CHANGELOG.md
files updated for non-trivial changes