Skip to content

feat(core): Add dataCollection.mcp option - #25553

Open
sentry-junior[bot] wants to merge 2 commits into
developfrom
feat/data-collection-mcp
Open

sentry-junior[bot] wants to merge 2 commits into
developfrom
feat/data-collection-mcp

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Adds dataCollection.mcp: { inputs, outputs } (both default true), as defined in data collection spec 0.14.0. The MCP server instrumentation now uses dataCollection.mcp when recordInputs / recordOutputs aren't set on wrapMcpServerWithSentry.

The spec makes mcp independent of genAI. Dropping the genAI path would be breaking, though: users who set genAI: false to silence MCP payloads would start recording them again. So until v12, the MCP server falls back to genAI per field when the matching mcp field isn't set. The precedence is: wrapper option > dataCollection.mcp > dataCollection.genAI > true. The resolved mcp always has defaults applied, so the instrumentation reads the raw dataCollection.mcp option to tell whether the user set it. A TODO(v12) marks the fallback for removal.

Unit tests cover both paths: mcp alone, genAI fallback, mcp winning over genAI in both directions, and per-field fallback. The node-express e2e app uses mcp, and node-express-static keeps genAI to cover the fallback.

Ref #24604

via Jan Peer Stöcklmair.

--

View Junior Session [Sentry]

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.91 kB +0.1% +28 B 🔺
@sentry/browser - with treeshaking flags 28.04 kB +0.1% +27 B 🔺
@sentry/browser - with treeshaking flags tracing without tracing 27.95 kB +0.11% +29 B 🔺
@sentry/browser (incl. Tracing) 52.1 kB +0.06% +29 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 52.1 kB +0.05% +26 B 🔺
@sentry/browser (incl. Tracing, Profiling) 55.04 kB +0.05% +26 B 🔺
@sentry/browser (incl. Tracing, Replay) 91.85 kB +0.04% +28 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 80.72 kB +0.05% +34 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 96.58 kB +0.03% +28 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 109.52 kB +0.03% +28 B 🔺
@sentry/browser (incl. Feedback) 47.42 kB +0.06% +25 B 🔺
@sentry/browser (incl. sendFeedback) 34.97 kB +0.09% +28 B 🔺
@sentry/browser (incl. FeedbackAsync) 40.07 kB +0.07% +26 B 🔺
@sentry/browser (incl. Metrics) 30.93 kB +0.1% +28 B 🔺
@sentry/browser (incl. Logs) 31.21 kB +0.09% +27 B 🔺
@sentry/browser (incl. Metrics & Logs) 31.84 kB +0.09% +27 B 🔺
@sentry/react 31.73 kB +0.1% +29 B 🔺
@sentry/react (incl. Tracing) 54.41 kB +0.05% +27 B 🔺
@sentry/vue 38.06 kB +0.08% +28 B 🔺
@sentry/vue (incl. Tracing) 55.03 kB +0.05% +26 B 🔺
@sentry/svelte 29.93 kB +0.1% +28 B 🔺
@sentry/remix (Remix 3 client bundle) 57.11 kB +0.05% +27 B 🔺
CDN Bundle 31.67 kB +0.08% +25 B 🔺
CDN Bundle (incl. Tracing) 52.61 kB +0.06% +27 B 🔺
CDN Bundle (incl. Logs, Metrics) 33.87 kB +0.11% +37 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 54.55 kB +0.06% +29 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 74.79 kB +0.04% +23 B 🔺
CDN Bundle (incl. Tracing, Replay) 90.28 kB +0.04% +28 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 92.21 kB +0.04% +28 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 96.42 kB +0.03% +25 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 98.37 kB +0.03% +28 B 🔺
CDN Bundle - uncompressed 93.29 kB +0.12% +108 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 156.14 kB +0.07% +108 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 99.83 kB +0.11% +108 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 162.1 kB +0.07% +108 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 229.87 kB +0.05% +108 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 276.31 kB +0.04% +108 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 282.25 kB +0.04% +108 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 290.01 kB +0.04% +108 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 295.94 kB +0.04% +108 B 🔺
@sentry/nextjs (client) 56.91 kB +0.06% +30 B 🔺
@sentry/sveltekit (client) 52.48 kB +0.05% +26 B 🔺
@sentry/core/server 41.22 kB +0.11% +45 B 🔺
@sentry/core/browser 13.81 kB - -
@sentry/node 155.19 kB +0.04% +49 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 84.06 kB - -
@sentry/node - without tracing 96.84 kB +0.03% +27 B 🔺
@sentry/node - without channel injection 133.22 kB +0.04% +49 B 🔺
@sentry/aws-serverless 105.05 kB +0.03% +28 B 🔺
@sentry/cloudflare (withSentry) - minified 210.99 kB +0.05% +102 B 🔺
@sentry/cloudflare (withSentry) 523.33 kB +0.04% +166 B 🔺
@sentry/nextjs/cloudflare (withSentry) - minified 229.32 kB +0.05% +108 B 🔺

View base workflow run

sentry-junior Bot and others added 2 commits October 20, 2026 15:09
Gate MCP request and response content on `dataCollection.mcp` instead of
`dataCollection.genAI`, as defined in the data collection spec (0.14.0).

Co-Authored-By: Jan Peer Stöcklmair <jan.peer@sentry.io>
Keeps the MCP server instrumentation non-breaking: `dataCollection.mcp` takes
precedence per field, and unset fields fall back to `dataCollection.genAI`
until v12.

Co-Authored-By: Jan Peer Stöcklmair <jan.peer@sentry.io>
@JPeer264
JPeer264 force-pushed the feat/data-collection-mcp branch from 4816208 to 582d9f9 Compare October 20, 2026 13:09
@JPeer264
JPeer264 marked this pull request as ready for review October 20, 2026 13:16
@JPeer264
JPeer264 requested a review from a team as a code owner October 20, 2026 13:16
@JPeer264
JPeer264 requested review from chargome and s1gr1d and removed request for a team October 20, 2026 13:16
@JPeer264 JPeer264 self-assigned this Oct 20, 2026
@JPeer264
JPeer264 requested review from logaretm and nicohrubec and removed request for chargome and s1gr1d October 20, 2026 13:17
@sentry-junior
sentry-junior Bot force-pushed the feat/data-collection-mcp branch from 582d9f9 to 974f4cf Compare October 20, 2026 13:33

This branch has not been deployed

No deployments
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.

3 participants