Skip to content

Support upstream traceparent headers#4

Merged
adagradschool merged 1 commit into
masterfrom
feat/traceparent
Mar 16, 2026
Merged

Support upstream traceparent headers#4
adagradschool merged 1 commit into
masterfrom
feat/traceparent

Conversation

@adagradschool
Copy link
Copy Markdown
Contributor

Product context

This lets external callers stitch Claude Code runs into an existing trace by passing a W3C traceparent. That makes it possible to group multiple Claude Code sessions under one orchestrated trace instead of always starting a new root trace in the plugin.

Introduced changes

  • Added PROMPTLAYER_TRACEPARENT support in the trace plugin
  • Reused the upstream trace ID when provided
  • Emitted the Claude Code session span as a child of the upstream parent span ID
  • Preserved existing behavior when no upstream context is passed
  • Added a spec reference doc for the W3C Trace Context sections this change follows

Edge cases covered

  • Missing traceparent falls back to a generated trace
  • Invalid traceparent falls back to a generated trace
  • Valid 00 headers are accepted
  • Non-00 headers are accepted for forward compatibility
  • Non-00 headers with an extra suffix do not break parsing

Verification

  • make test passed

@adagradschool adagradschool merged commit 9a4c9bd into master Mar 16, 2026
2 checks passed
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.

2 participants