Skip to content

ref: Remove redundant forceTransaction: true usages - #23756

Merged
andreiborza merged 1 commit into
developfrom
ab/investigate-remove-force-transaction
Aug 31, 2026
Merged

andreiborza merged 1 commit into
developfrom
ab/investigate-remove-force-transaction

Conversation

@andreiborza

@andreiborza andreiborza commented Aug 31, 2026

Copy link
Copy Markdown
Member

What

Removes forceTransaction: true from four spans that are already root spans, so the option had no effect.

  • aws-serverless: the function.aws invocation span
  • browser: the navigation span, which already passes parentSpan: null
  • nestjs: the BullMQ process span, since queue jobs run outside a request
  • react-router: the server request span, on the branch that only runs when there is no root span

The remaining usages are:

  • MCP server spans: without the flag every MCP request nests under the HTTP transaction (POST /messages and / GET /sse, and the mcp.server transaction that the Insights views read is gone.
  • Next.js server actions: withServerActionInstrumentation forks an isolation scope and sets the transaction name, the extra data and the request headers on it. With no transaction in that scope, all of it is dropped.
  • nestjs event spans: the transaction still arrives, promoted through sentry.parent_span_already_sent, but only because the handler outlives the request. A synchronous handler would nest instead.

Why

Less to read, and the flag now marks only the spans that truly need it.

@andreiborza
andreiborza force-pushed the ab/investigate-remove-force-transaction branch from 0e14ea4 to 8bfd701 Compare August 31, 2026 09:03
@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.56 kB - -
@sentry/browser - with treeshaking flags 26.92 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.82 kB - -
@sentry/browser (incl. Tracing) 48.75 kB -0.03% -12 B 🔽
@sentry/browser (incl. Tracing + Span Streaming) 48.76 kB -0.03% -12 B 🔽
@sentry/browser (incl. Tracing, Profiling) 51.68 kB -0.03% -11 B 🔽
@sentry/browser (incl. Tracing, Replay) 88.23 kB -0.01% -8 B 🔽
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.63 kB -0.01% -5 B 🔽
@sentry/browser (incl. Tracing, Replay with Canvas) 92.93 kB -0.01% -9 B 🔽
@sentry/browser (incl. Tracing, Replay, Feedback) 105.85 kB -0.02% -11 B 🔽
@sentry/browser (incl. Feedback) 46.05 kB - -
@sentry/browser (incl. sendFeedback) 33.62 kB - -
@sentry/browser (incl. FeedbackAsync) 38.73 kB - -
@sentry/browser (incl. Metrics) 29.51 kB - -
@sentry/browser (incl. Logs) 29.8 kB - -
@sentry/browser (incl. Metrics & Logs) 30.43 kB - -
@sentry/react 30.3 kB - -
@sentry/react (incl. Tracing) 50.94 kB -0.02% -10 B 🔽
@sentry/vue 35.73 kB - -
@sentry/vue (incl. Tracing) 51.02 kB -0.02% -10 B 🔽
@sentry/svelte 28.59 kB - -
CDN Bundle 30.35 kB - -
CDN Bundle (incl. Tracing) 49.38 kB -0.02% -8 B 🔽
CDN Bundle (incl. Logs, Metrics) 32.58 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 51.25 kB -0.01% -5 B 🔽
CDN Bundle (incl. Replay, Logs, Metrics) 73.17 kB - -
CDN Bundle (incl. Tracing, Replay) 86.86 kB -0.01% -6 B 🔽
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.73 kB -0.01% -6 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) 92.8 kB -0.01% -5 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.64 kB -0.01% -5 B 🔽
CDN Bundle - uncompressed 89.95 kB - -
CDN Bundle (incl. Tracing) - uncompressed 147.2 kB -0.02% -20 B 🔽
CDN Bundle (incl. Logs, Metrics) - uncompressed 96.24 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.89 kB -0.02% -20 B 🔽
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.41 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 266.69 kB -0.01% -20 B 🔽
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 272.37 kB -0.01% -20 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 280.4 kB -0.01% -20 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 286.06 kB -0.01% -20 B 🔽
@sentry/nextjs (client) 53.51 kB -0.02% -10 B 🔽
@sentry/sveltekit (client) 49.19 kB -0.03% -10 B 🔽
@sentry/core/server 65.47 kB - -
@sentry/core/browser 51.86 kB - -
@sentry/node 123.47 kB +0.02% +21 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 85.23 kB - -
@sentry/node - without tracing 87.76 kB +0.03% +23 B 🔺
@sentry/node - without channel injection 103.13 kB +0.03% +22 B 🔺
@sentry/aws-serverless 96.07 kB +0.03% +24 B 🔺
@sentry/cloudflare (withSentry) - minified 200.72 kB - -
@sentry/cloudflare (withSentry) 499.25 kB - -

View base workflow run

@andreiborza
andreiborza force-pushed the ab/investigate-remove-force-transaction branch from 8bfd701 to 564cc92 Compare August 31, 2026 09:45
@andreiborza andreiborza changed the title ref: Remove internal forceTransaction: true usages ref: Remove redundant forceTransaction: true usages Aug 31, 2026
Removes `forceTransaction: true` where the span is already a root span, so the
option had no effect:

- `aws-serverless`: the `function.aws` invocation span
- `browser`: the navigation span, which already passes `parentSpan: null`
- `nestjs`: the BullMQ process span, since queue jobs run outside a request
- `react-router`: the server request span, on the branch that only runs when
  there is no root span

Co-Authored-By: Opus 5 <noreply@anthropic.com>
@andreiborza
andreiborza force-pushed the ab/investigate-remove-force-transaction branch from 564cc92 to c665424 Compare August 31, 2026 09:46
@andreiborza
andreiborza marked this pull request as ready for review August 31, 2026 11:26
@andreiborza
andreiborza requested review from a team as code owners August 31, 2026 11:26
@andreiborza
andreiborza requested review from isaacs, msonnb, mydea, nicohrubec and s1gr1d and removed request for a team August 31, 2026 11:26
@andreiborza
andreiborza merged commit 6b41b4f into develop Aug 31, 2026
229 checks passed
@andreiborza
andreiborza deleted the ab/investigate-remove-force-transaction branch August 31, 2026 11:53
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.

2 participants