Skip to content

Fix tracestate key grammar tests#584

Merged
SergeyKanzhelev merged 3 commits into
w3c:mainfrom
Kielek:fix-at-vendor
Jun 29, 2026
Merged

Fix tracestate key grammar tests#584
SergeyKanzhelev merged 3 commits into
w3c:mainfrom
Kielek:fix-at-vendor

Conversation

@Kielek

@Kielek Kielek commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Fixes #583

@dyladan dyladan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change was introduced in #386 and tests were never updated. Change is good

@zacharycmontoya zacharycmontoya left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SergeyKanzhelev SergeyKanzhelev merged commit acab820 into w3c:main Jun 29, 2026
6 checks passed
@Kielek Kielek deleted the fix-at-vendor branch June 30, 2026 04:45
bryannaegele pushed a commit to open-telemetry/opentelemetry-erlang that referenced this pull request Jul 7, 2026
)

The tracestate key regex in otel_tracestate implemented the obsolete
Level 1 grammar with a separate tenant@vendor form. Trace Context
Level 2 (w3c/trace-context#386) unified the grammar:

  key = ( lcalpha / DIGIT ) 0*255 ( keychar )
  keychar = lcalpha / DIGIT / "_" / "-" / "*" / "/" / "@"

so "@" is an ordinary key character, keys may start with a digit,
and the only length limit is 256 characters total. The old regex
rejected keys such as foo@, foo@@bar and foo@bar@baz, causing the
whole tracestate header to be discarded.

Verified against the W3C trace-context interop suite at HEAD
(includes w3c/trace-context#584): all 41 tests pass.
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.

Strict tracestate key tests still enforce obsolete tenant/vendor @ grammar

4 participants