Skip to content

fix(core): Record span client report outcomes if span streaming is disabled - #25006

Draft
Lms24 wants to merge 5 commits into
developfrom
lms/fix-core-span-outcomes
Draft

Lms24 wants to merge 5 commits into
developfrom
lms/fix-core-span-outcomes

Conversation

@Lms24

@Lms24 Lms24 commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

The client report spec calls for recording category span client outcomes, also if streaming is disabled. This PR makes the change to record outcomes for each span, including one for the transaction itself when a transaction is sampled negatively, as well as when it's dropped.

The transaction/event processing pipeline had a bunch of holes though for span counts, since any combination of ignoreSpans, event processors and beforeSendSpan could drop child spans in any of those callbacks. So for example, a transaction that originally had 10 child spans and drops

  • 2 spans in ignoreSpans
  • 1 span in an event processor
  • the whole transaction in beforeSendSpan

now all together reports 11 spans and 1 transaction outcome, with the correct reasons. No span drops are double-counted.

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.49 kB -0.08% -22 B 🔽
@sentry/browser - with treeshaking flags 27.64 kB -0.16% -44 B 🔽
@sentry/browser - with treeshaking flags tracing without tracing 27.53 kB -0.16% -42 B 🔽
@sentry/browser (incl. Tracing) 51.42 kB -0.07% -31 B 🔽
@sentry/browser (incl. Tracing + Span Streaming) 51.43 kB -0.07% -32 B 🔽
@sentry/browser (incl. Tracing, Profiling) 54.43 kB -0.06% -32 B 🔽
@sentry/browser (incl. Tracing, Replay) 91.01 kB -0.04% -30 B 🔽
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 79.99 kB -0.06% -41 B 🔽
@sentry/browser (incl. Tracing, Replay with Canvas) 95.71 kB -0.04% -29 B 🔽
@sentry/browser (incl. Tracing, Replay, Feedback) 108.68 kB -0.03% -27 B 🔽
@sentry/browser (incl. Feedback) 47.01 kB -0.07% -30 B 🔽
@sentry/browser (incl. sendFeedback) 34.55 kB -0.08% -25 B 🔽
@sentry/browser (incl. FeedbackAsync) 39.66 kB -0.07% -27 B 🔽
@sentry/browser (incl. Metrics) 30.51 kB -0.1% -30 B 🔽
@sentry/browser (incl. Logs) 30.79 kB -0.13% -40 B 🔽
@sentry/browser (incl. Metrics & Logs) 31.45 kB -0.12% -35 B 🔽
@sentry/react 31.34 kB -0.09% -27 B 🔽
@sentry/react (incl. Tracing) 53.78 kB -0.04% -20 B 🔽
@sentry/vue 37.48 kB -0.08% -28 B 🔽
@sentry/vue (incl. Tracing) 54.31 kB -0.04% -20 B 🔽
@sentry/svelte 29.52 kB -0.11% -30 B 🔽
@sentry/remix (Remix 3 client bundle) 55.76 kB -0.04% -21 B 🔽
CDN Bundle 31.18 kB -0.13% -39 B 🔽
CDN Bundle (incl. Tracing) 51.97 kB -0.04% -17 B 🔽
CDN Bundle (incl. Logs, Metrics) 33.43 kB -0.1% -33 B 🔽
CDN Bundle (incl. Tracing, Logs, Metrics) 53.9 kB -0.04% -18 B 🔽
CDN Bundle (incl. Replay, Logs, Metrics) 74.17 kB -0.05% -37 B 🔽
CDN Bundle (incl. Tracing, Replay) 89.53 kB -0.03% -26 B 🔽
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 91.5 kB -0.04% -29 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) 95.7 kB -0.03% -23 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 97.68 kB -0.04% -33 B 🔽
CDN Bundle - uncompressed 92 kB -0.16% -145 B 🔽
CDN Bundle (incl. Tracing) - uncompressed 154.36 kB -0.09% -138 B 🔽
CDN Bundle (incl. Logs, Metrics) - uncompressed 98.57 kB -0.15% -145 B 🔽
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 160.31 kB -0.09% -138 B 🔽
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 228.14 kB -0.07% -145 B 🔽
CDN Bundle (incl. Tracing, Replay) - uncompressed 274.09 kB -0.06% -138 B 🔽
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 280.02 kB -0.05% -138 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 287.79 kB -0.05% -138 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 293.72 kB -0.05% -138 B 🔽
@sentry/nextjs (client) 56.28 kB -0.07% -35 B 🔽
@sentry/sveltekit (client) 51.83 kB -0.08% -39 B 🔽
@sentry/core/server 40.56 kB -0.09% -33 B 🔽
@sentry/core/browser 13.63 kB +0.03% +4 B 🔺
@sentry/node 144.73 kB -0.02% -26 B 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection) 83.22 kB - -
@sentry/node - without tracing 93.28 kB -0.03% -27 B 🔽
@sentry/node - without channel injection 122.93 kB -0.03% -30 B 🔽
@sentry/aws-serverless 101.56 kB -0.03% -23 B 🔽
@sentry/cloudflare (withSentry) - minified 208.48 kB -0.07% -134 B 🔽
@sentry/cloudflare (withSentry) 517.21 kB -0.04% -192 B 🔽

View base workflow run

@Lms24

Lms24 commented Oct 2, 2026

Copy link
Copy Markdown
Member Author

bugbot review

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

Stale Bugbot comment from a previous run.

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

Comment thread packages/core/src/utils/prepareEvent.ts
Lms24 and others added 2 commits October 2, 2026 17:58
An unsampled standalone span (e.g. a late INP span) recorded a
`transaction` outcome when it started, although it never becomes a
transaction, and a second `span` outcome when it ended. Record a single
`span` outcome on start instead.

Derive the expected span count in the static sampling integration test
from the `GET /ok` transaction, so it also holds on Bun, which creates
no Express spans.

Co-Authored-By: Claude <noreply@anthropic.com>
@Lms24 Lms24 self-assigned this Oct 2, 2026
Run event processors, `ignoreSpans`, `beforeSendSpan` and
`beforeSendTransaction` on the same transaction and check that every
span is either sent or counted exactly once, both when the transaction
is sent and when `beforeSendTransaction` drops it.

Co-Authored-By: Claude <noreply@anthropic.com>

This branch has not been deployed

No deployments
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