Skip to content

feat(core): consolidate fetch integrations - #24346

Open
isaacs wants to merge 2 commits into
developfrom
isaacschlueter/js-3667-consolidate-the-global-fetch-integrations-into-sentryserver
Open

feat(core): consolidate fetch integrations#24346
isaacs wants to merge 2 commits into
developfrom
isaacschlueter/js-3667-consolidate-the-global-fetch-integrations-into-sentryserver

Conversation

@isaacs

@isaacs isaacs commented Sep 11, 2026

Copy link
Copy Markdown
Member

Consolidate the nearly (but not exactly!) identical fetch integrations used by deno, bun, cloudflare, and vercel-edge.

The deno breadcrumbs integration is folded in, and the separate integration is deprecated.

The functionality is placed in @sentry/core rather than @sentry/server-utils in order to avoid leaking node internals where they don't belong.

Node and Browser fetch integrations are not touched, because they use completely different mechanisms.

closes JS-3667
closes #24344

Consolidate the nearly (but not exactly!) identical fetch integrations
used by deno, bun, cloudflare, and vercel-edge.

The functionality is placed in `@sentry/core` rather than
`@sentry/server-utils` in order to avoid leaking node internals where
they don't belong.

closes JS-3667
closes #24344
@isaacs
isaacs requested a review from a team as a code owner September 11, 2026 17:36
@isaacs
isaacs requested review from JPeer264 and mydea and removed request for a team September 11, 2026 17:36
@linear-code

linear-code Bot commented Sep 11, 2026

Copy link
Copy Markdown

JS-3667

@isaacs isaacs changed the title feat(core): consolidate 4 fetch integrations feat(core): consolidate fetch integrations Sep 11, 2026
@isaacs

isaacs commented Sep 11, 2026

Copy link
Copy Markdown
Member Author

Added a second commit to bound the number of spans that can potentially be hanging. It's a preexisting hazard that all 4 implementations had, but noticed in the refactor. If others feel like it'd be better to put off, that can be a separate issue for discussion (or ditched entirely if it's not a relevant concern), but it seemed convenient to just fix it while in the area.

Comment on lines +46 to +50
// oxlint-disable-next-line typescript/no-deprecated
if (!_options.fetch) {
debug.warn(
'breadcrumbsIntegration({ fetch: false }) no longer has any effect. Fetch breadcrumbs are recorded by fetchIntegration; disable them with fetchIntegration({ breadcrumbs: false }).',
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: The deprecated fetch: false option in breadcrumbsIntegration no longer suppresses fetch breadcrumbs, causing them to be generated by the new default fetchIntegration.
Severity: MEDIUM

Suggested Fix

To avoid this breaking change for existing users, consider respecting the fetch: false option for a deprecation period. Alternatively, elevate the notification from a debug log to a console.warn to ensure users are aware that they need to update their configuration to fetchIntegration({ breadcrumbs: false }) to restore the previous behavior.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: packages/deno/src/integrations/breadcrumbs.ts#L46-L50

Potential issue: A breaking change was introduced for users of the Deno SDK. Previously,
fetch-related breadcrumbs could be disabled by initializing the SDK with
`breadcrumbsIntegration({ fetch: false })`. After this change, this option no longer
prevents fetch breadcrumbs from being generated. Instead, the new `fetchIntegration`,
which is enabled by default, will create them. The old option now only logs a
debug-level warning, which may not be visible to users, causing fetch breadcrumbs to be
unexpectedly recorded for those who had explicitly opted out.

Did we get this right? 👍 / 👎 to inform future reviews.

@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 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b931e56. Configure here.

export type { DenoServeIntegrationOptions } from './integrations/deno-serve';
export { fetchIntegration } from './integrations/fetch';
export type { FetchOptions } from './integrations/fetch';
export type { FetchIntegrationOptions } from '@sentry/core';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Public FetchOptions type removed

Medium Severity

@sentry/deno no longer exports the public FetchOptions type and now exports FetchIntegrationOptions instead, with no deprecated alias. Existing type-only imports will fail typecheck. Flagged because the review rules call out public type removals without a deprecation path.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit b931e56. Configure here.

if (!_options.fetch) {
debug.warn(
'breadcrumbsIntegration({ fetch: false }) no longer has any effect. Fetch breadcrumbs are recorded by fetchIntegration; disable them with fetchIntegration({ breadcrumbs: false }).',
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Deprecation warning hidden from users

Low Severity

The breadcrumbsIntegration({ fetch: false }) deprecation notice uses debug.warn, so it only appears when Sentry debug logging is on. Users who disabled fetch breadcrumbs this way will keep getting them with no visible warning. Flagged because the review rules reserve consoleSandbox for user-facing init warnings.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit b931e56. Configure here.

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.96 kB - -
@sentry/browser - with treeshaking flags 27.26 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.15 kB - -
@sentry/browser (incl. Tracing) 50.48 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 50.48 kB - -
@sentry/browser (incl. Tracing, Profiling) 53.47 kB - -
@sentry/browser (incl. Tracing, Replay) 90.02 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 79.11 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 94.72 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 107.69 kB - -
@sentry/browser (incl. Feedback) 46.46 kB - -
@sentry/browser (incl. sendFeedback) 34.01 kB - -
@sentry/browser (incl. FeedbackAsync) 39.12 kB - -
@sentry/browser (incl. Metrics) 29.98 kB - -
@sentry/browser (incl. Logs) 30.24 kB - -
@sentry/browser (incl. Metrics & Logs) 30.91 kB - -
@sentry/react 30.72 kB - -
@sentry/react (incl. Tracing) 52.78 kB - -
@sentry/vue 36.2 kB - -
@sentry/vue (incl. Tracing) 52.71 kB - -
@sentry/svelte 28.98 kB - -
CDN Bundle 30.7 kB -0.01% -2 B 🔽
CDN Bundle (incl. Tracing) 50.96 kB -0.01% -2 B 🔽
CDN Bundle (incl. Logs, Metrics) 32.98 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 52.99 kB +0.07% +37 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 73.66 kB -0.01% -4 B 🔽
CDN Bundle (incl. Tracing, Replay) 88.51 kB +0.01% +2 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 90.48 kB -0.01% -2 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) 94.58 kB -0.01% -4 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 96.64 kB +0.08% +72 B 🔺
CDN Bundle - uncompressed 90.83 kB - -
CDN Bundle (incl. Tracing) - uncompressed 152.26 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.41 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 158.22 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 226.82 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 271.83 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 277.78 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 285.53 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 291.47 kB - -
@sentry/nextjs (client) 55.09 kB - -
@sentry/sveltekit (client) 50.9 kB - -
@sentry/core/server 37.13 kB - -
@sentry/core/browser 13.66 kB - -
@sentry/node 129.82 kB +0.02% +22 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.83 kB - -
@sentry/node - without tracing 89.62 kB +0.04% +31 B 🔺
@sentry/node - without channel injection 108.7 kB +0.03% +22 B 🔺
@sentry/aws-serverless 97.83 kB +0.02% +18 B 🔺
@sentry/cloudflare (withSentry) - minified 203.68 kB +0.16% +316 B 🔺
@sentry/cloudflare (withSentry) 507.1 kB +0.14% +659 B 🔺

View base workflow run

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.

Consolidate the global-fetch integrations into @sentry/server-utils

1 participant