Skip to content

Conversation

@alexander-alderman-webb
Copy link
Contributor

@alexander-alderman-webb alexander-alderman-webb commented Dec 9, 2025

DESCRIBE YOUR PR

Add specification for trace propagation over the MCP protocol.

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

LEGAL BOILERPLATE

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

EXTRA RESOURCES

@vercel
Copy link

vercel bot commented Dec 9, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
develop-docs Ready Ready Preview Comment Dec 9, 2025 11:43am
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
sentry-docs Ignored Ignored Dec 9, 2025 11:43am

Copy link
Member

@betegon betegon left a comment

Choose a reason for hiding this comment

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

Looks good!

btw we don't support mcp clients, is something we're considering now?

Comment on lines +177 to +190
## Distributed Tracing

Traces should be continued when a client makes a tool call request to an MCP server and both the client and server are instrumented. To do so, we inject both the trace parent (sentry-trace) and baggage into the `_meta` field of the request, and pick these up on the server. The tracing metadata attached in the `_meta` field is the same as the metadata contained in HTTP headers in HTTP-based trace continuation.

The SDK must respect any existing metadata in `_meta`. If previously empty, the `_meta` field must have the form

```json
"_meta": {
"sentry-trace": "...",
"baggage": "...",
}
```

where "sentry-trace" is analogous to the [`sentry-trace` HTTP header](/sdk/telemetry/traces/#header-sentry-trace) and "baggage" is analogous to [`baggage` HTTP header](/sdk/telemetry/traces/dynamic-sampling-context/#baggage-header).
Copy link
Member

@cleptric cleptric Dec 10, 2025

Choose a reason for hiding this comment

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

Maybe we can already think about how we can support mixed OTLP/Sentry instrumentation here. As in, can we rely on the traceparent header instead of our sentry-tace header?
Also, which options should define if we perform propagation? tracePropagationTargets or something new?

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.

5 participants