Skip to content

feat(cloudflare): Support basic WorkerEntrypoint - #19884

Merged
JPeer264 merged 7 commits into
developfrom
jp/cf-workers-entrypoint
Apr 7, 2026
Merged

feat(cloudflare): Support basic WorkerEntrypoint#19884
JPeer264 merged 7 commits into
developfrom
jp/cf-workers-entrypoint

Conversation

@JPeer264

@JPeer264JPeer264 commented Mar 19, 2026

Copy link
Copy Markdown
Member

part of #15942

This is a basic instrumentation for WorkerEntrypoint. There is no extra instrumentWorkerEntrypoint exported, and should work directly with withSentry OOTB:

classMyWorkerextendsWorkerEntrypoint{}exportdefaultSentry.withSentry(()=>({}),MyWorker)

To support the full WorkerEntrypoint there is the need to instrument RPC methods. Without that we can't fully support WorkerEntrypoints but just the basics of it. This can be added once #19991 lands (it is safe to review now and instrument the env in a separate PR)


If you look at the instrumentations themselves, there is no isInstrumented or markAsInstrumented. The reason is that on the one hand this is not required, as every request is spawning a new instance of the WorkerEntrypoint and on the other hand it wouldn't work as it would mark it as instrumented, but on the request the fetch is overridden and not instrumented.

@github-actions

github-actionsBot commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Core

  • Support registerTool/registerResource/registerPrompt in MCP integration by betegon in #20071
  • Support embeddings in langchain by nicohrubec in #20017

Deps

  • Bump lodash.template from 4.5.0 to 4.18.1 by dependabot in #20085
  • Bump @xmldom/xmldom from 0.8.3 to 0.8.12 by dependabot in #20066

Other

  • (cloudflare) Support basic WorkerEntrypoint by JPeer264 in #19884
  • (core, node) Portable Express integration by isaacs in #19928
  • (deno) Add denoRuntimeMetricsIntegration by chargome in #20023
  • (node, bun) Enforce minimum collection interval in runtime metrics integrations by chargome in #20068

Bug Fixes 🐛

  • (aws-serverless) Add timeout to _endSpan forceFlush to prevent Lambda hanging by logaretm in #20064
  • (cloudflare) Ensure every request instruments functions by JPeer264 in #20044
  • (core) Set span.status to error when MCP tool returns JSON-RPC error response by betegon in #20082
  • (gatsby) Fix errorHandler signature to match bundler-plugin-core API by JPeer264 in #20048

Internal Changes 🔧

Core

  • Do not emit spans for chats.create in google-genai by nicohrubec in #19990
  • Unify .do* span ops to gen_ai.generate_content by nicohrubec in #20074
  • Simplify addResponseAttributes in openai integration by nicohrubec in #20013
  • Extract shared endStreamSpan for AI integrations by nicohrubec in #20021
  • Remove provider-specific AI span attributes in favor of gen_ai attributes in sentry conventions by nicohrubec in #20011

Deps

  • Bump mshick/add-pr-comment from dd126dd8c253650d181ad9538d8b4fa218fc31e8 to e7516d74559b5514092f5b096ed29a629a1237c6 by dependabot in #20078
  • Bump getsentry/craft/.github/workflows/changelog-preview.yml from 2.24.1 to 2.25.2 by dependabot in #20081

Other

  • (node) Add node integration tests for Vercel ToolLoopAgent by nicohrubec in #20087
  • (nuxt) Make Nuxt 5 (nightly) E2E optional by s1gr1d in #20113
  • Update validate-pr workflow by stephanie-anderson in #20072
  • Remove unused tsconfig-template folder by mydea in #20067

🤖 This preview updates automatically when you update the PR.

@JPeer264
JPeer264force-pushed the jp/cf-workers-entrypoint branch from 3a7024f to f82649eCompareMarch 19, 2026 14:21
@github-actions

github-actionsBot commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

PathSize% ChangeChange
@sentry/browser25.65 kB+0.02%+5 B 🔺
@sentry/browser - with treeshaking flags24.14 kB+0.03%+5 B 🔺
@sentry/browser (incl. Tracing)42.16 kB+0.02%+7 B 🔺
@sentry/browser (incl. Tracing, Profiling)46.77 kB+0.02%+9 B 🔺
@sentry/browser (incl. Tracing, Replay)80.94 kB+0.01%+5 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags70.56 kB+0.01%+5 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas)85.66 kB+0.01%+8 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback)97.92 kB+0.01%+5 B 🔺
@sentry/browser (incl. Feedback)42.42 kB+0.02%+6 B 🔺
@sentry/browser (incl. sendFeedback)30.31 kB+0.02%+6 B 🔺
@sentry/browser (incl. FeedbackAsync)35.3 kB+0.05%+17 B 🔺
@sentry/browser (incl. Metrics)26.96 kB+0.03%+7 B 🔺
@sentry/browser (incl. Logs)27.11 kB+0.03%+7 B 🔺
@sentry/browser (incl. Metrics & Logs)27.78 kB+0.03%+7 B 🔺
@sentry/react27.41 kB+0.03%+6 B 🔺
@sentry/react (incl. Tracing)44.48 kB+0.02%+5 B 🔺
@sentry/vue30.08 kB+0.02%+5 B 🔺
@sentry/vue (incl. Tracing)44.05 kB+0.02%+8 B 🔺
@sentry/svelte25.67 kB+0.02%+5 B 🔺
CDN Bundle28.33 kB+0.05%+14 B 🔺
CDN Bundle (incl. Tracing)43.13 kB+0.06%+25 B 🔺
CDN Bundle (incl. Logs, Metrics)29.7 kB+0.05%+14 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics)44.17 kB+0.05%+19 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics)68.5 kB+0.03%+17 B 🔺
CDN Bundle (incl. Tracing, Replay)80.02 kB+0.03%+19 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics)81.06 kB+0.03%+18 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback)85.56 kB+0.02%+15 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics)86.59 kB+0.02%+16 B 🔺
CDN Bundle - uncompressed82.72 kB+0.07%+54 B 🔺
CDN Bundle (incl. Tracing) - uncompressed127.86 kB+0.05%+54 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed86.86 kB+0.07%+54 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed131.27 kB+0.05%+54 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed209.84 kB+0.03%+54 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed244.74 kB+0.03%+54 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed248.13 kB+0.03%+54 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed257.65 kB+0.03%+54 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed261.04 kB+0.03%+54 B 🔺
@sentry/nextjs (client)46.9 kB+0.02%+7 B 🔺
@sentry/sveltekit (client)42.62 kB+0.02%+7 B 🔺
@sentry/node-core55.77 kB+0.04%+17 B 🔺
@sentry/node172.41 kB-0.2%-338 B 🔽
@sentry/node - without tracing96.05 kB+0.05%+40 B 🔺
@sentry/aws-serverless112.85 kB+0.07%+77 B 🔺

View base workflow run

@JPeer264
JPeer264force-pushed the jp/cf-workers-entrypoint branch from 71b3910 to 1ef2947CompareMarch 26, 2026 14:57
@JPeer264JPeer264 self-assigned this Mar 26, 2026
@JPeer264
JPeer264 marked this pull request as ready for review March 26, 2026 14:58

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

Comment threaddev-packages/e2e-tests/test-applications/cloudflare-mcp/src/env.d.ts Outdated
@github-actions

github-actionsBot commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.

ScenarioRequests/s% of BaselinePrev. Requests/sChange %
GET Baseline11,465-9,471+21%
GET With Sentry1,88916%1,653+14%
GET With Sentry (error only)7,58766%5,960+27%
POST Baseline1,146-1,198-4%
POST With Sentry57350%583-2%
POST With Sentry (error only)1,00287%1,047-4%
MYSQL Baseline3,964-3,251+22%
MYSQL With Sentry48812%468+4%
MYSQL With Sentry (error only)3,23682%2,633+23%

View base workflow run

@JPeer264
JPeer264force-pushed the jp/cf-workers-entrypoint branch from a49aca8 to 1e01b75CompareApril 7, 2026 06:35
@JPeer264
JPeer264force-pushed the jp/cf-workers-entrypoint branch from 03728d5 to 20e5311CompareApril 7, 2026 12:11
@JPeer264
JPeer264 merged commit 8804c4e into developApr 7, 2026
63 checks passed
@JPeer264
JPeer264 deleted the jp/cf-workers-entrypoint branch April 7, 2026 14:15
Sign up for freeto 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

@JPeer264@timfish@logaretm