Skip to content

fix(v10/core): Don't instrument the SDK's own envelope requests - #24276

Open
logaretm wants to merge 2 commits into
v10from
awad/fix-client-report-exit-loop
Open

fix(v10/core): Don't instrument the SDK's own envelope requests#24276
logaretm wants to merge 2 commits into
v10from
awad/fix-client-report-exit-loop

Conversation

@logaretm

@logaretm logaretm commented Sep 10, 2026

Copy link
Copy Markdown
Member

Stops the outgoing-http instrumentation from instrumenting Sentry's own envelope sends.

It recognized them only via suppressTracing(), which is unreadable when the SDK doesn't own the OTel setup, since no context manager propagates it. Each send then started a span that got dropped as no_parent_span, and since 10.72 the session sent on beforeExit seeds the first outcome, so the client report flush feeds itself and the process never exits. Matching the ingest URL instead doesn't depend on context propagation.

closes #24262

The outgoing-http subscription skipped Sentry's own transport requests by checking
the scope for an active `suppressTracing()`. That check is unreadable when the SDK
does not own the OpenTelemetry setup (`skipOpenTelemetrySetup: true`, or any other
setup that leaves the OTel API without a registered context manager): the
suppression is written to a context that nothing propagates.

Each envelope send then started an outgoing-request span, and with tracing off that
span was dropped with a `no_parent_span` outcome. Since 10.72 a healthy process also
sends its session on `beforeExit`, which seeded the first outcome, and from there the
client report flush on `beforeExit` fed itself: flush -> instrumented request ->
new outcome -> `beforeExit` again. The process never exited and hammered the DSN
with client reports.

Requests to the ingest endpoint are now recognized by URL, which does not depend on
context propagation.

Fixes #24262
@logaretm
logaretm marked this pull request as ready for review September 10, 2026 03:09
@logaretm
logaretm requested a review from a team as a code owner September 10, 2026 03:09
@logaretm
logaretm requested review from JPeer264, andreiborza and isaacs and removed request for a team September 10, 2026 03:09

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

Reviewed by Cursor Bugbot for commit 06819f1. Configure here.

Comment thread dev-packages/node-integration-tests/suites/client-reports/exit-flush-loop/test.ts Outdated
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 27.77 kB added added
@sentry/browser - with treeshaking flags 26.21 kB added added
@sentry/browser (incl. Tracing) 46.62 kB added added
@sentry/browser (incl. Tracing + Span Streaming) 48.42 kB added added
@sentry/browser (incl. Tracing, Profiling) 51.38 kB added added
@sentry/browser (incl. Tracing, Replay) 85.89 kB added added
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.51 kB added added
@sentry/browser (incl. Tracing, Replay with Canvas) 90.61 kB added added
@sentry/browser (incl. Tracing, Replay, Feedback) 103.24 kB added added
@sentry/browser (incl. Feedback) 44.94 kB added added
@sentry/browser (incl. sendFeedback) 32.56 kB added added
@sentry/browser (incl. FeedbackAsync) 37.71 kB added added
@sentry/browser (incl. Metrics) 28.86 kB added added
@sentry/browser (incl. Logs) 29.09 kB added added
@sentry/browser (incl. Metrics & Logs) 29.79 kB added added
@sentry/react 29.58 kB added added
@sentry/react (incl. Tracing) 48.89 kB added added
@sentry/vue 33.2 kB added added
@sentry/vue (incl. Tracing) 48.61 kB added added
@sentry/svelte 27.8 kB added added
CDN Bundle 30.17 kB added added
CDN Bundle (incl. Tracing) 48.59 kB added added
CDN Bundle (incl. Logs, Metrics) 31.75 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) 49.92 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) 71.03 kB added added
CDN Bundle (incl. Tracing, Replay) 86.13 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 87.43 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) 91.9 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 93.2 kB added added
CDN Bundle - uncompressed 89.9 kB added added
CDN Bundle (incl. Tracing) - uncompressed 146.7 kB added added
CDN Bundle (incl. Logs, Metrics) - uncompressed 94.61 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 150.68 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 219.44 kB added added
CDN Bundle (incl. Tracing, Replay) - uncompressed 266.01 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 269.97 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.71 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 283.67 kB added added
@sentry/nextjs (client) 51.47 kB added added
@sentry/sveltekit (client) 47.06 kB added added
@sentry/core/server 80.81 kB added added
@sentry/core/browser 66.95 kB added added
@sentry/node-core 63.46 kB added added
@sentry/node 126.16 kB added added
@sentry/node (incl. diagnostics channel injection) 170.28 kB added added
@sentry/node/import (ESM hook with diagnostics-channel injection) 166 B added added
@sentry/node/light 51.6 kB added added
@sentry/node - without tracing 75.19 kB added added
@sentry/aws-serverless 84.41 kB added added
@sentry/cloudflare (withSentry) - minified 202.76 kB added added
@sentry/cloudflare (withSentry) 499.38 kB added added

The watchdog marker meant a scenario that died on startup looked the same as a clean
exit, so the test passed with and without the fix when the worktree's node_modules
were broken. Polling for the child's exit with `ensureNoErrorOutput` separates the
two, and it keeps the passing run under a second instead of always sleeping 5s.
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.

1 participant