-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Fix trace state key parsing in W3C propagator to support digits #119778
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
Fix trace state key parsing in W3C propagator to support digits #119778
Conversation
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.
Pull Request Overview
This PR fixes the W3C propagator trace state key parsing to support digits according to the W3C specification. The implementation was previously only accepting lowercase letters at the start of keys, but the spec allows both lowercase letters and digits.
Key changes:
- Updated trace state key validation to accept digits (0-9) in addition to lowercase letters (a-z)
- Modified both .NET 6+ and legacy implementations to support the expanded character set
- Updated test cases to reflect that keys starting with digits are now valid
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
W3CPropagator.cs | Updated key validation logic to accept digits in trace state keys per W3C spec |
W3CPropagatorTests.cs | Modified test cases to validate digit support and updated comments |
src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/W3CPropagator.cs
Show resolved
Hide resolved
src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/W3CPropagator.cs
Show resolved
Hide resolved
CC @MihaZupan |
Tagging subscribers to this area: @dotnet/area-system-diagnostics-activity |
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.
Looks good to me and I support this getting backported to 10.0 RC2 (using Tactics Tell Mode since it clearly meets the bug fix bar).
src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/W3CPropagator.cs
Show resolved
Hide resolved
/backport to release/10.0 |
Started backporting to release/10.0: https://github.com/dotnet/runtime/actions/runs/17784264902 |
The W3C propagator is a new feature in .NET 10. We previously missed supporting digits when parsing trace state keys. According to the specification, digits are valid in keys. This change fixes that by adding support for digits in trace state keys. I am planning to back port this to 10 release.
#119767
#114583
#103174