Skip to content

Added known HTTP header field names from W3C Trace Context - #124

Merged
guoye-zhang merged 2 commits into
apple:mainfrom
ayush-that:feature/add-w3c-trace-context-headers
Jun 1, 2026
Merged

Added known HTTP header field names from W3C Trace Context#124
guoye-zhang merged 2 commits into
apple:mainfrom
ayush-that:feature/add-w3c-trace-context-headers

Conversation

@ayush-that

@ayush-that ayush-that commented May 27, 2026

Copy link
Copy Markdown
Contributor

these headers are defined by W3C Trace Context and are used by OpenTelemetry and other distributed tracing systems.

resolves #101.

These headers are defined by W3C Trace Context (https://www.w3.org/TR/trace-context/) and are used by OpenTelemetry and other distributed tracing systems.

Resolves apple#101.
Copilot AI review requested due to automatic review settings May 27, 2026 06:37

Copilot AI 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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds W3C Trace Context HTTP header field-name conveniences to HTTPField.Name to support distributed tracing interoperability.

Changes:

  • Introduces HTTPField.Name.traceparent constant.
  • Introduces HTTPField.Name.tracestate constant.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

/// Traceparent
///
/// https://www.w3.org/TR/trace-context/
public static var traceparent: Self { .init(rawName: "Traceparent", canonicalName: "traceparent") }
/// Tracestate
///
/// https://www.w3.org/TR/trace-context/
public static var tracestate: Self { .init(rawName: "Tracestate", canonicalName: "tracestate") }

@FranzBusch FranzBusch 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.

@guoye-zhang What do you think of adding those headers?

@guoye-zhang

Copy link
Copy Markdown
Contributor

Looks fine, let’s add it if it’s useful to open telemetry

@guoye-zhang guoye-zhang added the 🆕 semver/minor Adds new public API. label Jun 1, 2026
@guoye-zhang
guoye-zhang enabled auto-merge (squash) June 1, 2026 19:00
@guoye-zhang
guoye-zhang merged commit b8fbf41 into apple:main Jun 1, 2026
57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🆕 semver/minor Adds new public API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add built-in named headers for TraceParent and TraceState

4 participants