Conversation
size-limit report 📦
|
ea8d457 to
59cc528
Compare
betegon
left a comment
There was a problem hiding this comment.
great one!
could we keep the existing legacy coverage and add a no-wrapper HTTP scenario pinned to protocol 2026-07-28, using createMcpHandler?
The current SDK 2 scenario still uses the legacy initialization/session path (there's no initialization in v2), so it doesn't verify auto-instrumentation through the v2 entry point
|
👋 @nicohrubec, @s1gr1d — Please review this PR when you get a chance! |
59cc528 to
d4eaf18
Compare
| const server = wrapMcpServerWithSentry( | ||
| new McpServer({ | ||
| name: 'Echo-V2', | ||
| version: '2.0.0', | ||
| }), | ||
| ); | ||
| // Intentionally NOT wrapped with `wrapMcpServerWithSentry`: the `mcpServer` integration | ||
| // auto-instruments the `McpServer` constructor, so spans must be produced anyway. | ||
| const server = new McpServer({ | ||
| name: 'Echo-V2', | ||
| version: '2.0.0', | ||
| }); |
There was a problem hiding this comment.
Is this pr still just test, even though there are actual changes? I'll let you decide
There was a problem hiding this comment.
I think this is just changed based on the previous PR in the stack
Add two Express e2e apps that construct an `McpServer` WITHOUT calling `wrapMcpServerWithSentry`, exercising the `mcpServer` integration's auto-wrapping over a real streamable-HTTP transport: - `node-express-mcp-v1-auto` (`@modelcontextprotocol/sdk` v1) - `node-express-mcp-v2-auto` (`@modelcontextprotocol/server` v2) Both assert the expected `mcp.server` spans (initialize, tool call, resource read, error status) still appear without a manual wrap. Bun/Deno/Cloudflare variants are intentionally left as a follow-up. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop the `-auto` suffix now that auto-instrumentation is the default path: - `node-express-mcp-v1-auto` -> `node-express-mcp-v1` - `node-express-mcp-v2-auto` -> `node-express-mcp-v2`, replacing the previous manual-wrap app of that name (same assertions, now exercising the default auto path). Manual-wrap coverage remains via the cloudflare-mcp apps and the v1 `node-express*` apps. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
d4eaf18 to
c029964
Compare
| // Intentionally NOT wrapped with `wrapMcpServerWithSentry`: the `mcpServer` integration | ||
| // auto-instruments the `McpServer` constructor, so spans must be produced anyway. | ||
| const server = new McpServer({ | ||
| name: 'Echo-V2', | ||
| version: '2.0.0', | ||
| }); |
There was a problem hiding this comment.
Bug: The E2E test's custom instrumentation script (instrument.mjs) calls Sentry.init() but fails to register the orchestrion runtime hook, preventing auto-instrumentation and causing the test to fail.
Severity: MEDIUM
Suggested Fix
Modify the test application's startup command to correctly register the orchestrion runtime hook. Instead of using a custom instrument.mjs file, the package.json should be updated to use --import @sentry/node/import. This ensures the hook is active before the application code runs, allowing mcpServerIntegration to function as expected.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: dev-packages/e2e-tests/test-applications/node-express-mcp-v2/src/mcp.ts#L9-L14
Potential issue: The E2E test application `node-express-mcp-v2` is configured to run
with a custom entry point (`--import ./instrument.mjs`) that calls `Sentry.init()`.
However, calling `Sentry.init()` alone does not register the orchestrion runtime hook,
which is required for the `mcpServerIntegration` to perform auto-instrumentation. The
hook is typically registered by using `--import @sentry/node/import`. Without the hook,
the `@modelcontextprotocol/server` module will not be instrumented, no spans will be
produced, and the test will fail because it explicitly waits for and asserts the
presence of these spans.
Did we get this right? 👍 / 👎 to inform future reviews.
The MCP server suites were restructured into `mcp-server/manual-instrumentation`, `mcp-server/v1`, and `mcp-server/v2`, where v1/v2 rely on orchestrion auto-instrumentation. `bun run` cannot inject the diagnostics channels, so those suites produce no spans and fail. Replace the stale `mcp-server-streamed` exclude with a `mcp-server/**` glob covering all three. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…egration The default `mcpServer` integration pushed the main `@sentry/node` entry to 141.21 KB, over its 139 KB limit. Bump to 142 KB. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Stacked on #24529.
Adds two Express e2e apps that construct an
McpServerwithout callingwrapMcpServerWithSentry, so themcpServerintegration from #24529 is the only thing producing spans — over a real streamable-HTTP transport rather than the in-memory one used by the node-integration-tests:node-express-mcp-v1—@modelcontextprotocol/sdk(v1)node-express-mcp-v2—@modelcontextprotocol/server(v2)Each asserts the expected
mcp.serverspans (initialize, tool call, resource read, error status) still appear with no manual wrap. Express is the existing convention for the sibling MCP e2e apps; MCP itself doesn't require it.node-express-mcp-v2replaces the previous manual-wrap app of that name — now that auto-instrumentation is the default path, these apps drop the interim-autosuffix and exercise the default. Manual-wrap e2e coverage remains viacloudflare-mcp(v2),cloudflare-mcp-agent(v1), and the v1node-express*apps.Bun/Deno/Cloudflare variants (hono-4 multi-entry style) are intentionally deferred to a follow-up — this PR keeps the auto-instrumentation e2e coverage node-only.
🤖 Generated with Claude Code