Skip to content

feat(core): Emit low cardinality mcp.server span names - #23569

Merged
andreiborza merged 3 commits into
developfrom
ab/mcp-server-low-cardinality-span-names
Aug 26, 2026
Merged

feat(core): Emit low cardinality mcp.server span names#23569
andreiborza merged 3 commits into
developfrom
ab/mcp-server-low-cardinality-span-names

Conversation

@andreiborza

@andreiborza andreiborza commented Aug 25, 2026

Copy link
Copy Markdown
Member

What

With span streaming enabled, mcp.server spans for resource methods are named after the method alone (resources/read), instead of appending the resource URI. Tool and prompt names are unchanged, since those come from a bounded registry.

Why

Span names must be low cardinality when span streaming is enabled, and a resource URI is supplied by the client. The URI remains available on the mcp.resource.uri attribute.

Closes: #23529

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.57 kB - -
@sentry/browser - with treeshaking flags 26.92 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.82 kB - -
@sentry/browser (incl. Tracing) 48.58 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.6 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.51 kB - -
@sentry/browser (incl. Tracing, Replay) 88.04 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.44 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 92.75 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 105.44 kB - -
@sentry/browser (incl. Feedback) 45.81 kB - -
@sentry/browser (incl. sendFeedback) 33.36 kB - -
@sentry/browser (incl. FeedbackAsync) 38.46 kB - -
@sentry/browser (incl. Metrics) 29.51 kB - -
@sentry/browser (incl. Logs) 29.8 kB - -
@sentry/browser (incl. Metrics & Logs) 30.43 kB - -
@sentry/react 30.31 kB - -
@sentry/react (incl. Tracing) 50.79 kB - -
@sentry/vue 35.69 kB - -
@sentry/vue (incl. Tracing) 50.82 kB - -
@sentry/svelte 28.59 kB - -
CDN Bundle 30.36 kB - -
CDN Bundle (incl. Tracing) 49.07 kB - -
CDN Bundle (incl. Logs, Metrics) 32.56 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 50.95 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 72.98 kB - -
CDN Bundle (incl. Tracing, Replay) 86.56 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.44 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 92.33 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.25 kB - -
CDN Bundle - uncompressed 89.97 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.69 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 96.26 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.38 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.36 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 266.12 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 271.79 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.81 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 285.48 kB - -
@sentry/nextjs (client) 53.33 kB - -
@sentry/sveltekit (client) 49.03 kB - -
@sentry/core/server 65.16 kB +0.13% +82 B 🔺
@sentry/core/browser 52.38 kB - -
@sentry/node 121.51 kB +0.02% +23 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 85.19 kB - -
@sentry/node - without tracing 87.62 kB +0.03% +19 B 🔺
@sentry/aws-serverless 95.77 kB +0.03% +24 B 🔺
@sentry/cloudflare (withSentry) - minified 199.5 kB - -
@sentry/cloudflare (withSentry) 495.46 kB - -

View base workflow run

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e5e58e4. Configure here.

@andreiborza
andreiborza force-pushed the ab/mcp-server-low-cardinality-span-names branch 2 times, most recently from b2153ff to e847530 Compare August 26, 2026 07:34
@andreiborza
andreiborza changed the base branch from develop to ab/mcp-notification-span-names August 26, 2026 07:34
Base automatically changed from ab/mcp-notification-span-names to develop August 26, 2026 07:51
@andreiborza
andreiborza force-pushed the ab/mcp-server-low-cardinality-span-names branch from e847530 to 9ab0be3 Compare August 26, 2026 07:53
andreiborza and others added 3 commits August 26, 2026 11:13
With span streaming enabled, resource methods are named after the method
alone, so the client-supplied resource URI stays out of the span name.
Tool and prompt names are unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013bjBXkGkJo8eL8hkz48byi
@andreiborza
andreiborza force-pushed the ab/mcp-server-low-cardinality-span-names branch from 9ab0be3 to 42074e9 Compare August 26, 2026 09:13

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

LGTM! Since we briefly talked yesterday that this "breaks" the MCP dashboard, I stand corrected: The dashboard I had in mind groups by span description which still has a rule ton infer the URI based on the mcp.resource.uri which we send. So, name changes are not affecting this.

And even if we'd not be consistent with the description, it's probably not the end of the world. So good to merge from my PoV!

@andreiborza
andreiborza marked this pull request as ready for review August 26, 2026 10:52
@andreiborza
andreiborza requested a review from a team as a code owner August 26, 2026 10:52
@andreiborza
andreiborza requested review from JPeer264 and isaacs and removed request for a team August 26, 2026 10:52

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

Just one q.

"@langchain/core": "^0.3.80",
"@langchain/openai": "^0.5.0",
"@langchain/langgraph": "^0.2.32",
"@modelcontextprotocol/client": "2.0.0",

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.

q: Is this pinned on purpose?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This matches our other mcp apps, I just followed suite tbh. We could loosen it.

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.

Makes sense. Loosening it wouldn't be a bad idea though.- not a PR blocker

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Will do in a follow-up.

@andreiborza
andreiborza merged commit e921631 into develop Aug 26, 2026
272 of 273 checks passed
@andreiborza
andreiborza deleted the ab/mcp-server-low-cardinality-span-names branch August 26, 2026 11:15
andreiborza added a commit that referenced this pull request Aug 26, 2026
## What

The MCP v2 test dependencies (`@modelcontextprotocol/client`,
`@modelcontextprotocol/node`, `@modelcontextprotocol/server`) now use
`^2.0.0` instead of an exact `2.0.0`, across the node integration tests
and the `node-express-mcp-v2` and `cloudflare-mcp` e2e apps.
`cloudflare-mcp-agent` keeps its exact `@modelcontextprotocol/sdk` pin,
because `agents` depends on that specific version.

## Why

The exact pins were copied from app to app rather than chosen, and
nothing here needs a frozen version. Follow-up to #23569.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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.

Emit low cardinality mcp server span names

3 participants