Skip to content

Conversation

leedh2004
Copy link
Contributor

@leedh2004 leedh2004 commented Aug 27, 2025

Hi maintainers,
I've updated the B3 propagator to use lowercase header names as recommended by the B3 specification.

The problem

The B3 specification states: When encoding in case-sensitive transports, prefer lowercase keys or the single header encoding which is explicitly lowercase.

Currently, Swift uses uppercase format (X-B3-TraceId, X-B3-SpanId, X-B3-Sampled) while several other language implementations (JavaScript, Rust, Python, etc.) already use lowercase.

What I changed

Updated B3 multi-header format to use lowercase:

  • X-B3-TraceIdx-b3-traceid
  • X-B3-SpanIdx-b3-spanid
  • X-B3-Sampledx-b3-sampled

Compatibility

  • The B3 specification requires case-insensitive extraction, so this change maintains backward compatibility
  • Other language implementations handle both cases during extraction
  • This aligns Swift with the specification's preference for lowercase

Reference

Let me know if you need any changes. Thanks!

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Aug 27, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@leedh2004 leedh2004 force-pushed the change-b3-multi-header-format branch 2 times, most recently from 9baadf5 to 46e9784 Compare August 27, 2025 16:18
@leedh2004 leedh2004 changed the title Change B3 Multi Header Key Use lowercase B3 multi-header format per specification Aug 27, 2025
@leedh2004 leedh2004 changed the title Use lowercase B3 multi-header format per specification Update B3 headers to lowercase format following spec recommendation Aug 27, 2025
@leedh2004 leedh2004 closed this Sep 2, 2025
@leedh2004 leedh2004 force-pushed the change-b3-multi-header-format branch from ed79db0 to 5721c12 Compare September 2, 2025 20:54
@leedh2004
Copy link
Contributor Author

I’ll move this PR to https://github.com/open-telemetry/opentelemetry-swift-core

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.

1 participant