Repository navigation
feat(core): Continue MCP server traces from params._meta - #26308
Open
sentry-junior[bot] wants to merge 4 commits into
Open
sentry-junior[bot] wants to merge 4 commits into
sentry-junior[bot] wants to merge 4 commits into
Conversation
Contributor
size-limit report 📦Compared: d90ea11 (PR test merge using develop at c9e61e3) Against: c9e61e3 (develop) · base run #65906 ✅ Baseline matches: this diff contains only this PR's changes.
|
Contributor
Optional E2E testsSome optional checks were not successful. They do not block the merge. 4 not successful, 55 successful. See the run.
Successful checks
|
mydea
reviewed
Nov 12, 2026
mydea
reviewed
Nov 12, 2026
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 799d383. Configure here.
sentry-junior
Bot
force-pushed
the
feat/mcp-server-meta-trace-propagation
branch
from
November 12, 2026 09:30
b415593 to
23ac367
Compare
Fixes #17152 Co-Authored-By: Francesco Gringl-Novy <francesco.novy@sentry.io>
sentry-junior
Bot
force-pushed
the
feat/mcp-server-meta-trace-propagation
branch
from
November 13, 2026 06:49
23ac367 to
97c2f00
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Why: MCP clients propagate trace context per message in
params._meta(SEP-414, OTel MCP semconv), but our server instrumentation ignored it, so MCP server spans never connected to the calling agent's trace. Over stdio there was no other way to connect them at all. Incoming requests and notifications now continue the trace from_meta. The span that was active when the message arrived (e.g. thehttp.serverspan on Streamable HTTP) is added as a span link, which is what the semconv asks for, since MCP and transport contexts are independent.sentry-trace+baggagein_metaalways continue the trace. W3Ctraceparentis only read whenpropagateTraceparentis enabled, matching how the SDK treats W3C elsewhere: opt-in, and with no default continuation from incomingtraceparent. Malformed values fall back to today's behavior instead of starting a fresh trace. The W3C →sentry-traceconverter moved from the Flue integration into core so both can share it.How to review: Start with
packages/core/src/integrations/mcp-server/tracePropagation.ts. The transport and span changes just pass its result through. The node integration test uses the real@modelcontextprotocol/clientto make sure_metasurvives end to end.Unsure about:
_meta, the MCP span moves out of the HTTP request's trace into the caller's trace, and the HTTP span is only reachable via the link. That's spec behavior but a visible change, so it probably deserves a changelog line.traceparentwon't connect until users setpropagateTraceparent: true.sentry.link.type, because none of the defined values fit a transport relationship.Closes #17152
via Francesco Gringl-Novy.
--
View Session [Sentry]