Skip to content
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 tracestate implementation #1267

Merged
merged 7 commits into from
Apr 1, 2024
Merged

Conversation

Nevay
Copy link
Contributor

@Nevay Nevay commented Mar 31, 2024

Found some issues while running the TraceState implementation against my old test cases:

  • member limit of 32 was only applied on ::parse(), was not applied in ::with()
  • ::parse() discarded tracestates with length > 512; W3C spec specifies this as lower limit, not upper limit:

    Vendors SHOULD propagate at least 512 characters of a combined header.

  • ::parse() did not allow empty / whitespace-only members, W3C spec:

    Empty and whitespace-only list members are allowed. Vendors MUST accept empty tracestate headers but SHOULD avoid sending them. Empty list members are allowed in tracestate because it is difficult for a vendor to recognize the empty value when multiple tracestate headers are sent.

This PR also changes the behavior for duplicate keys in ::parse(); previously the last value was used, now the first (=newer) value is used; we might consider discarding the tracestate instead. key=value,key2=value2,key=value3 resulted previously in key=value3,key2=value2, now results in key=value,key2=value2.

@Nevay Nevay requested a review from a team March 31, 2024 17:05
Copy link

codecov bot commented Mar 31, 2024

Codecov Report

Attention: Patch coverage is 98.33333% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 83.91%. Comparing base (a1489d3) to head (cb4e37f).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1267      +/-   ##
============================================
+ Coverage     83.87%   83.91%   +0.03%     
- Complexity     2136     2144       +8     
============================================
  Files           296      296              
  Lines          6104     6125      +21     
============================================
+ Hits           5120     5140      +20     
- Misses          984      985       +1     
Flag Coverage Δ
8.1 83.91% <98.33%> (+0.03%) ⬆️
8.2 83.91% <98.33%> (+0.03%) ⬆️
8.3 83.91% <98.33%> (+0.03%) ⬆️
8.4 83.91% <98.33%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/API/Trace/TraceState.php 98.57% <98.33%> (-1.43%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a1489d3...cb4e37f. Read the comment docs.

@brettmc brettmc merged commit 6dd255d into open-telemetry:main Apr 1, 2024
9 checks passed
@Nevay Nevay deleted the fix/tracestate branch April 1, 2024 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants