Skip to content

feat(v10/cloudflare): Auto-instrument WorkerEntrypoint classes#22543

Draft
andreiborza wants to merge 1 commit into
ab/backport-22442-autoinstrument-workflowfrom
ab/backport-22493-autoinstrument-workerentrypoint
Draft

feat(v10/cloudflare): Auto-instrument WorkerEntrypoint classes#22543
andreiborza wants to merge 1 commit into
ab/backport-22442-autoinstrument-workflowfrom
ab/backport-22493-autoinstrument-workerentrypoint

Conversation

@andreiborza

Copy link
Copy Markdown
Member

Backport of: #22493

@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 ef96f7a. Configure here.

const classId = classDecl.id;
const kind = classId ? ctx.classWrappers.get(classId.name) : undefined;
// Inline export: the exported name and the local class name are the same.
const kind = classId ? resolveWrapperKind(classId.name, classId.name, state) : undefined;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Exported base breaks subclass wrap

High Severity

Structural detection wraps every exported class in a WorkerEntrypoint chain, but the rewrite only renames the declaration and rebinds that name to a withSentry Proxy. Same-file subclasses still extends the old name, so they inherit the Proxy. instrumentWorkerEntrypoint does not forward newTarget, so subclass methods are lost and construction double-instruments.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ef96f7a. Configure here.

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 27.76 kB added added
@sentry/browser - with treeshaking flags 26.2 kB added added
@sentry/browser (incl. Tracing) 46.6 kB added added
@sentry/browser (incl. Tracing + Span Streaming) 48.39 kB added added
@sentry/browser (incl. Tracing, Profiling) 51.36 kB added added
@sentry/browser (incl. Tracing, Replay) 85.85 kB added added
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.48 kB added added
@sentry/browser (incl. Tracing, Replay with Canvas) 90.56 kB added added
@sentry/browser (incl. Tracing, Replay, Feedback) 103.21 kB added added
@sentry/browser (incl. Feedback) 44.93 kB added added
@sentry/browser (incl. sendFeedback) 32.55 kB added added
@sentry/browser (incl. FeedbackAsync) 37.69 kB added added
@sentry/browser (incl. Metrics) 28.85 kB added added
@sentry/browser (incl. Logs) 29.07 kB added added
@sentry/browser (incl. Metrics & Logs) 29.77 kB added added
@sentry/react 29.56 kB added added
@sentry/react (incl. Tracing) 48.87 kB added added
@sentry/vue 33.19 kB added added
@sentry/vue (incl. Tracing) 48.56 kB added added
@sentry/svelte 27.79 kB added added
CDN Bundle 30.16 kB added added
CDN Bundle (incl. Tracing) 48.56 kB added added
CDN Bundle (incl. Logs, Metrics) 31.73 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) 49.86 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) 71 kB added added
CDN Bundle (incl. Tracing, Replay) 86.06 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 87.37 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) 91.86 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 93.13 kB added added
CDN Bundle - uncompressed 89.91 kB added added
CDN Bundle (incl. Tracing) - uncompressed 146.79 kB added added
CDN Bundle (incl. Logs, Metrics) - uncompressed 94.62 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 150.77 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 219.38 kB added added
CDN Bundle (incl. Tracing, Replay) - uncompressed 266.02 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 269.99 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.73 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 283.68 kB added added
@sentry/nextjs (client) 51.41 kB added added
@sentry/sveltekit (client) 47.02 kB added added
@sentry/core/server 80.3 kB added added
@sentry/core/browser 66.72 kB added added
@sentry/node-core 63.23 kB added added
@sentry/node 125.82 kB added added
@sentry/node (incl. diagnostics channel injection) 151.28 kB added added
@sentry/node/import (ESM hook with diagnostics-channel injection) 70.03 kB added added
@sentry/node/light 51.37 kB added added
@sentry/node - without tracing 74.95 kB added added
@sentry/aws-serverless 84.19 kB added added
@sentry/cloudflare (withSentry) - minified 197.74 kB added added
@sentry/cloudflare (withSentry) 486.69 kB added added

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