Skip to content

feat(cloudflare): Migrate to dataCollection#21237

Merged
chargome merged 4 commits into
developfrom
cg/cloudflare-datacollection
Jun 1, 2026
Merged

feat(cloudflare): Migrate to dataCollection#21237
chargome merged 4 commits into
developfrom
cg/cloudflare-datacollection

Conversation

@chargome
Copy link
Copy Markdown
Member

@chargome chargome commented May 29, 2026

Migrates the Cloudflare SDK from sendDefaultPii to the new dataCollection spec, without changing default behavior (the breaking default flips are deferred to v11).

  • request.ts: Pass client.getDataCollectionOptions() to httpHeadersToSpanAttributes instead of the sendDefaultPii boolean. Header/cookie filtering is now driven by the resolved dataCollection.

  • sdk.ts: requestDataIntegration is configured from dataCollection, but cookies are kept off by default (Cloudflare's historical behavior) unless the user opts in via sendDefaultPii or
    dataCollection.cookies. Marked TODO(v11) to drop this gate and let cookies default on (denylist-filtered) per spec ([v11] Migrate cookie / requestData gating to dataCollection #21260).

  • httpServer.ts: maxRequestBodySize continues to default to 'medium' (bodies captured by default, matching the Node SDK and pre-migration behavior). Marked TODO(v11) to gate body capture on
    dataCollection.httpBodies ([v11] Gate incoming HTTP body capture on dataCollection.httpBodies #21258).

Fixes #20934

@chargome chargome self-assigned this May 29, 2026
Comment thread packages/cloudflare/src/sdk.ts
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 29, 2026

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.

Path Size % Change Change
@sentry/browser 27.17 kB - -
@sentry/browser - with treeshaking flags 25.62 kB - -
@sentry/browser (incl. Tracing) 45.25 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 47.47 kB - -
@sentry/browser (incl. Tracing, Profiling) 50.22 kB - -
@sentry/browser (incl. Tracing, Replay) 84.83 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 74.39 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 89.53 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 102.15 kB - -
@sentry/browser (incl. Feedback) 44.34 kB - -
@sentry/browser (incl. sendFeedback) 31.98 kB - -
@sentry/browser (incl. FeedbackAsync) 37.08 kB - -
@sentry/browser (incl. Metrics) 28.25 kB - -
@sentry/browser (incl. Logs) 28.48 kB - -
@sentry/browser (incl. Metrics & Logs) 29.19 kB - -
@sentry/react 28.99 kB - -
@sentry/react (incl. Tracing) 47.51 kB - -
@sentry/vue 32.2 kB - -
@sentry/vue (incl. Tracing) 47.16 kB - -
@sentry/svelte 27.19 kB - -
CDN Bundle 29.55 kB - -
CDN Bundle (incl. Tracing) 47.81 kB - -
CDN Bundle (incl. Logs, Metrics) 31.05 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.04 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 70.31 kB - -
CDN Bundle (incl. Tracing, Replay) 85.18 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.35 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 91.05 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.21 kB - -
CDN Bundle - uncompressed 87.59 kB - -
CDN Bundle (incl. Tracing) - uncompressed 144.09 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 92.08 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 147.85 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 216.81 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 262.87 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 266.61 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 276.57 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 280.3 kB - -
@sentry/nextjs (client) 50.03 kB - -
@sentry/sveltekit (client) 45.68 kB - -
@sentry/core/server 76.56 kB - -
@sentry/core/browser 63.09 kB - -
@sentry/node-core 61.69 kB - -
@sentry/node 130.51 kB - -
@sentry/node - without tracing 74.1 kB - -
@sentry/aws-serverless 86.29 kB -0.01% -1 B 🔽
@sentry/cloudflare (withSentry) - minified 171.67 kB +0.02% +28 B 🔺
@sentry/cloudflare (withSentry) 429.62 kB -0.02% -78 B 🔽

View base workflow run

@chargome
Copy link
Copy Markdown
Member Author

chargome commented Jun 1, 2026

bugbot run

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 2a7233e. Configure here.

@chargome chargome marked this pull request as ready for review June 1, 2026 11:04
@chargome chargome requested a review from a team as a code owner June 1, 2026 11:04
@chargome chargome requested review from JPeer264, andreiborza and s1gr1d and removed request for a team June 1, 2026 11:04
Comment thread packages/cloudflare/src/sdk.ts
@chargome chargome merged commit 737f69f into develop Jun 1, 2026
74 of 75 checks passed
@chargome chargome deleted the cg/cloudflare-datacollection branch June 1, 2026 13:49
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.

(cloudflare): Migrate cloudflare to dataCollection

3 participants