Skip to content

feat(react-router): Drop low-quality transactions via ignoreSpans#20514

Open
nicohrubec wants to merge 7 commits intodevelopfrom
nh/span-streaming-reactrouter-lowqualitytransaction
Open

feat(react-router): Drop low-quality transactions via ignoreSpans#20514
nicohrubec wants to merge 7 commits intodevelopfrom
nh/span-streaming-reactrouter-lowqualitytransaction

Conversation

@nicohrubec
Copy link
Copy Markdown
Member

@nicohrubec nicohrubec commented Apr 25, 2026

Migrates the React Router low-quality transactions filter from a dedicated event-processor integration (lowQualityTransactionsFilterIntegration) to ignoreSpans so it also works in the streaming path. Adds some unit tests plus a new e2e test in react-router-7-framework that asserts no server transaction is sent for filtered /__manifest? requests during client-side navigation (no e2e covered this filter before).

Closes #20362

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 25, 2026

size-limit report 📦

Path Size % Change Change
@sentry/browser 26.13 kB - -
@sentry/browser - with treeshaking flags 24.6 kB - -
@sentry/browser (incl. Tracing) 44.07 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 46.06 kB - -
@sentry/browser (incl. Tracing, Profiling) 49.02 kB - -
@sentry/browser (incl. Tracing, Replay) 83.27 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 72.77 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 87.94 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 100.61 kB - -
@sentry/browser (incl. Feedback) 43.37 kB - -
@sentry/browser (incl. sendFeedback) 30.93 kB - -
@sentry/browser (incl. FeedbackAsync) 36.11 kB - -
@sentry/browser (incl. Metrics) 27.41 kB - -
@sentry/browser (incl. Logs) 27.56 kB - -
@sentry/browser (incl. Metrics & Logs) 28.24 kB - -
@sentry/react 27.86 kB - -
@sentry/react (incl. Tracing) 46.31 kB - -
@sentry/vue 31 kB - -
@sentry/vue (incl. Tracing) 45.91 kB - -
@sentry/svelte 26.15 kB - -
CDN Bundle 28.8 kB - -
CDN Bundle (incl. Tracing) 46.61 kB - -
CDN Bundle (incl. Logs, Metrics) 30.19 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 47.67 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 69.16 kB - -
CDN Bundle (incl. Tracing, Replay) 83.67 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 84.71 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 89.5 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 90.57 kB - -
CDN Bundle - uncompressed 84.45 kB - -
CDN Bundle (incl. Tracing) - uncompressed 139.45 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 88.59 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 142.86 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 212.17 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 256.89 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 260.29 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 270.59 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 273.98 kB - -
@sentry/nextjs (client) 48.8 kB - -
@sentry/sveltekit (client) 44.52 kB - -
@sentry/node-core 58.73 kB +0.02% +6 B 🔺
@sentry/node 169.84 kB +0.01% +8 B 🔺
@sentry/node - without tracing 97.57 kB +0.01% +4 B 🔺
@sentry/aws-serverless 114.31 kB +0.01% +6 B 🔺
@sentry/cloudflare (withSentry) - minified 163.22 kB - -
@sentry/cloudflare (withSentry) 412.55 kB - -

View base workflow run

@nicohrubec nicohrubec changed the title Nh/span streaming reactrouter lowqualitytransaction feat(react-router): Drop low-quality transactions via ignoreSpans Apr 25, 2026
Comment thread packages/core/src/types-hoist/options.ts
Comment thread packages/react-router/src/server/sdk.ts Outdated
return [...getNodeDefaultIntegrations(options), reactRouterServerIntegration()];
}

const LOW_QUALITY_TRANSACTIONS_REGEXES = [
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

m: Let's not delete the integration, but let's do this inside of the integration, in beforeAllSetup or something like this! This way, users can also opt-out of this behavior, for example. It is also technically breaking to remove an integration like this as users may import it (theoretically...)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

updated to keep the integration and set ignoreSpans in the beforeSetup hook

@nicohrubec nicohrubec force-pushed the nh/span-streaming-reactrouter-lowqualitytransaction branch 2 times, most recently from 2d26ee8 to d4e8438 Compare April 27, 2026 08:46
@nicohrubec nicohrubec force-pushed the nh/span-streaming-reactrouter-lowqualitytransaction branch from d4e8438 to 828583d Compare April 27, 2026 10:47
@nicohrubec nicohrubec marked this pull request as ready for review April 27, 2026 12:05
@nicohrubec nicohrubec requested review from chargome and mydea April 27, 2026 12:05
Copy link
Copy Markdown

@cursor cursor Bot left a comment

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 3cf652b. Configure here.

/GET \/node_modules\//,
/GET \/favicon\.ico/,
/GET \/@id\//,
/GET \/__manifest\?/,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The regex /GET \/__manifest\?/ will not match in the streaming path because query strings are stripped from the URL before matching, rendering the filter ineffective.
Severity: MEDIUM

Suggested Fix

Update the regular expression to not expect a query string. Change /GET \/__manifest\?/ to /GET \/__manifest/ to ensure it matches the span description after the query string has been removed.

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/react-router/src/server/integration/lowQualityTransactionsFilterIntegration.ts#L9

Potential issue: The regular expression `/GET \/__manifest\?/` is used to filter
low-quality transactions. This expression requires a literal `?` character to match.
However, the logic for the streaming path uses `inferSpanData()`, which strips query
strings and fragments from URLs before the regex is applied. For a request like `GET
/__manifest?p=...`, the description becomes `GET /__manifest`, which will not be matched
by the regex. This causes the filter to silently fail for all transactions processed via
the streaming path, defeating one of the primary goals of the change.

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

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.

Event processor migration: React Router lowQualityTransactionsFilterIntegration

2 participants