Skip to content

docs(cloudflare): Recommend span streaming for MCP - #19057

Open
betegon wants to merge 2 commits into
masterfrom
docs/cloudflare-mcp-span-streaming
Open

docs(cloudflare): Recommend span streaming for MCP#19057
betegon wants to merge 2 commits into
masterfrom
docs/cloudflare-mcp-span-streaming

Conversation

@betegon

@betegon betegon commented Aug 14, 2026

Copy link
Copy Markdown
Member

DESCRIBE YOUR PR

Cloudflare MCP work can finish after the Worker returns its HTTP response. In the static trace lifecycle, those late spans depend on a transaction snapshot that may already have been sent.

We verified this with two deployed Cloudflare Workers running byte-identical MCP 2026-07-28 bundles against the published JavaScript SDK. traceLifecycle: "static" lost the late child, while traceLifecycle: "stream" recorded it exactly once with the MCP operation as its parent.

This promotes MCP Monitoring to a top-level platform feature alongside Agent Tracing across supported JavaScript guides. Each framework page now shows the required wrapMcpServerWithSentry setup directly, including the runtime-specific imports for Hono. The Cloudflare page makes clear that wrapping the MCP server enables MCP instrumentation, while traceLifecycle: "stream" controls how the resulting spans are delivered. The Agent Tracing overview keeps its contextual MCP link, and the previous Tracing → Instrumentation → Instrument MCP Servers URL redirects to the new feature route.

The general Cloudflare waitUntil() limitation now recommends stream mode first. forceTransaction remains documented as the fallback for applications that need to keep the static lifecycle.

Related to getsentry/sentry-javascript#23427.

IS YOUR CHANGE URGENT?

  • 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

  • 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

Cloudflare MCP work can outlive the HTTP response. Document stream mode as the supported way to retain those spans, while keeping forceTransaction as the static-lifecycle fallback.

Co-Authored-By: OpenAI Codex <codex@openai.com>
@vercel

vercel Bot commented Aug 14, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
develop-docs Ready Ready Preview Aug 14, 2026 5:20pm
sentry-docs Ready Ready Preview Aug 14, 2026 5:20pm

Request Review

@betegon
betegon force-pushed the docs/cloudflare-mcp-span-streaming branch from c549a0a to 6c74833 Compare August 14, 2026 14:38
@betegon
betegon force-pushed the docs/cloudflare-mcp-span-streaming branch from 6c74833 to 83fb57c Compare August 14, 2026 15:03
@betegon
betegon force-pushed the docs/cloudflare-mcp-span-streaming branch from 83fb57c to f7e2413 Compare August 14, 2026 15:35
@betegon
betegon force-pushed the docs/cloudflare-mcp-span-streaming branch from f7e2413 to ea01e43 Compare August 14, 2026 15:47
@betegon
betegon force-pushed the docs/cloudflare-mcp-span-streaming branch from ea01e43 to 736ed33 Compare August 14, 2026 16:30
@betegon
betegon marked this pull request as ready for review August 14, 2026 16:51
@betegon
betegon requested a review from sergical August 14, 2026 17:10
Place MCP Monitoring alongside Agent Tracing across supported JavaScript guides and document the explicit server wrapper required for instrumentation. Keep Cloudflare span streaming as a separate delivery setting.

Co-Authored-By: OpenAI Codex <codex@openai.com>
@sergical
sergical requested a review from sfanahata August 14, 2026 18:06
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.

2 participants