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

@chargomechargome commented May 29, 2026

Copy link
Copy Markdown
Member

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

@chargomechargome self-assigned this May 29, 2026
Comment threadpackages/cloudflare/src/sdk.ts
@github-actions

github-actionsBot commented May 29, 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/browser27.17 kB--
@sentry/browser - with treeshaking flags25.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 flags74.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/react28.99 kB--
@sentry/react (incl. Tracing)47.51 kB--
@sentry/vue32.2 kB--
@sentry/vue (incl. Tracing)47.16 kB--
@sentry/svelte27.19 kB--
CDN Bundle29.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 - uncompressed87.59 kB--
CDN Bundle (incl. Tracing) - uncompressed144.09 kB--
CDN Bundle (incl. Logs, Metrics) - uncompressed92.08 kB--
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed147.85 kB--
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed216.81 kB--
CDN Bundle (incl. Tracing, Replay) - uncompressed262.87 kB--
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed266.61 kB--
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed276.57 kB--
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed280.3 kB--
@sentry/nextjs (client)50.03 kB--
@sentry/sveltekit (client)45.68 kB--
@sentry/core/server76.56 kB--
@sentry/core/browser63.09 kB--
@sentry/node-core61.69 kB--
@sentry/node130.51 kB--
@sentry/node - without tracing74.1 kB--
@sentry/aws-serverless86.29 kB-0.01%-1 B 🔽
@sentry/cloudflare (withSentry) - minified171.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
MemberAuthor

bugbot run

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

✅ 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 ownerJune 1, 2026 11:04
@chargome
chargome requested review from JPeer264, andreiborza and s1gr1d and removed request for a teamJune 1, 2026 11:04
Comment threadpackages/cloudflare/src/sdk.ts
@chargome
chargome merged commit 737f69f into developJun 1, 2026
74 of 75 checks passed
@chargome
chargome deleted the cg/cloudflare-datacollection branch June 1, 2026 13:49
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.

(cloudflare): Migrate cloudflare to dataCollection

3 participants

@chargome@JPeer264@s1gr1d