Skip to content

feat(solid): Set url attributes on solid router and tanstack router spans#22090

Merged
Lms24 merged 3 commits into
developfrom
feat/pageload-url-attrs-solid
Jul 9, 2026
Merged

feat(solid): Set url attributes on solid router and tanstack router spans#22090
Lms24 merged 3 commits into
developfrom
feat/pageload-url-attrs-solid

Conversation

@Lms24

@Lms24 Lms24 commented Jul 8, 2026

Copy link
Copy Markdown
Member

Adds url.template, url.path, and url.full to pageload and navigation spans for Solid Router and TanStack Solid Router integrations, including redirect and back-button navigation cases.

Ports locationToSpanUrlAttributes from the React TanStack Router integration and updates Solid Router to pass the destination URL when starting navigation spans. Includes e2e test coverage for solidstart and solid-tanstack-router.

part of #21921

Made with Cursor

@Lms24 Lms24 requested a review from a team as a code owner July 8, 2026 12:50
@Lms24 Lms24 requested review from chargome, mydea and nicohrubec and removed request for a team July 8, 2026 12:50
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 27.59 kB - -
@sentry/browser - with treeshaking flags 26.03 kB - -
@sentry/browser (incl. Tracing) 46.34 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.13 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.12 kB - -
@sentry/browser (incl. Tracing, Replay) 85.62 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.26 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 90.32 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 102.97 kB - -
@sentry/browser (incl. Feedback) 44.76 kB - -
@sentry/browser (incl. sendFeedback) 32.38 kB - -
@sentry/browser (incl. FeedbackAsync) 37.51 kB - -
@sentry/browser (incl. Metrics) 28.67 kB - -
@sentry/browser (incl. Logs) 28.91 kB - -
@sentry/browser (incl. Metrics & Logs) 29.59 kB - -
@sentry/react 29.38 kB - -
@sentry/react (incl. Tracing) 48.61 kB - -
@sentry/vue 33.03 kB - -
@sentry/vue (incl. Tracing) 48.3 kB - -
@sentry/svelte 27.61 kB - -
CDN Bundle 30 kB - -
CDN Bundle (incl. Tracing) 48.32 kB - -
CDN Bundle (incl. Logs, Metrics) 31.57 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.64 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 70.81 kB - -
CDN Bundle (incl. Tracing, Replay) 85.84 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 87.14 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 91.64 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.92 kB - -
CDN Bundle - uncompressed 89.35 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.1 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 94.05 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 150.07 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 218.78 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 265.3 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 269.26 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 282.95 kB - -
@sentry/nextjs (client) 51.16 kB - -
@sentry/sveltekit (client) 46.78 kB - -
@sentry/core/server 78.42 kB - -
@sentry/core/browser 64.74 kB - -
@sentry/node-core 62.72 kB -0.01% -1 B 🔽
@sentry/node 125.37 kB -0.01% -2 B 🔽
@sentry/node (incl. diagnostics channel injection) 138.54 kB - -
@sentry/node/import (ESM hook with diagnostics-channel injection) 69.95 kB - -
@sentry/node/light 50.72 kB -0.01% -1 B 🔽
@sentry/node - without tracing 74.06 kB -0.01% -1 B 🔽
@sentry/aws-serverless 85.5 kB -0.01% -2 B 🔽
@sentry/cloudflare (withSentry) - minified 181.71 kB - -
@sentry/cloudflare (withSentry) 449.16 kB - -

View base workflow run

@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-react branch from e595d12 to d6abd79 Compare July 8, 2026 13:11
@Lms24 Lms24 requested a review from a team as a code owner July 8, 2026 13:11
@Lms24 Lms24 requested review from logaretm and removed request for a team July 8, 2026 13:11
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-solid branch from a518d21 to 1d77c34 Compare July 8, 2026 13:11
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-react branch from d6abd79 to ee4514c Compare July 8, 2026 14:22
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-solid branch from 1d77c34 to 6c98bbb Compare July 8, 2026 14:22
Comment thread packages/solid/src/solidrouter.ts
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-solid branch from 6c98bbb to 6190c45 Compare July 8, 2026 14:41
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-react branch from ee4514c to 0002c1f Compare July 8, 2026 14:41
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-solid branch from 6190c45 to 6c98bbb Compare July 8, 2026 14:42
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-react branch from 0002c1f to ee4514c Compare July 8, 2026 14:42
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-solid branch from 6c98bbb to 6190c45 Compare July 8, 2026 14:43
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-react branch from ee4514c to 0002c1f Compare July 8, 2026 14:43
Comment thread packages/solid/src/solidrouter.ts
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-react branch from 0002c1f to ee4514c Compare July 8, 2026 14:46
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-solid branch from 6190c45 to 6c98bbb Compare July 8, 2026 14:46
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-react branch from ee4514c to b276e49 Compare July 8, 2026 14:52
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-solid branch 2 times, most recently from 8d16900 to 3aea408 Compare July 8, 2026 14:57
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-react branch 2 times, most recently from a6eb9e5 to d262ae6 Compare July 8, 2026 15:00
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-solid branch from 3aea408 to 377e8a8 Compare July 8, 2026 15:00
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-react branch from d262ae6 to 1442f98 Compare July 8, 2026 16:08
Comment thread packages/solid/src/tanstackrouter.ts Outdated
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-react branch from 1442f98 to fe7157e Compare July 8, 2026 16:16
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-solid branch 2 times, most recently from cc1771f to c62961f Compare July 9, 2026 07:54
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-react branch from fe7157e to c49062d Compare July 9, 2026 07:54
Comment thread packages/solid/src/tanstackrouter.ts
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-react branch from c49062d to 189260b Compare July 9, 2026 10:29
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-solid branch from c62961f to f476dfc Compare July 9, 2026 10:30
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-react branch from 189260b to c80aa1c Compare July 9, 2026 10:30
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-solid branch from f476dfc to cfa4176 Compare July 9, 2026 10:30
@Lms24 Lms24 self-assigned this Jul 9, 2026
Comment thread packages/solid/src/tanstackrouter.ts
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-solid branch from cfa4176 to ef79aed Compare July 9, 2026 11:28
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-react branch from c80aa1c to 1139cf9 Compare July 9, 2026 11:28
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-solid branch 2 times, most recently from a8ecb5c to 92e0d28 Compare July 9, 2026 12:58
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-react branch from e843e31 to 1ccda07 Compare July 9, 2026 12:58

@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 92e0d28. Configure here.

Comment thread packages/solid/src/tanstackrouter.ts Outdated
Comment thread packages/solid/src/tanstackrouter.ts Outdated
Base automatically changed from feat/pageload-url-attrs-react to develop July 9, 2026 13:58
Lms24 and others added 2 commits July 9, 2026 15:59
…pans

Adds url.template, url.path, and url.full to pageload and navigation spans
for Solid Router and TanStack Solid Router, including redirect and back-button
navigation cases. Updates solidstart and solid-tanstack-router e2e tests.

part of #21921

Co-Authored-By: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-solid branch from 92e0d28 to cf15b60 Compare July 9, 2026 14:00
Comment thread packages/solid/src/tanstackrouter.ts Outdated
Guard the pageload `onResolved` handler so it only overwrites the span
when a redirect resolves to a real route match, and always write
`url.template` in `applyRouteMatch` so a stale parameterized template is
cleared once a redirect hop lands on an unmatched path. Previously a
redirect chain could downgrade a route-based span to `sentry.source: url`
while keeping a stale `url.template`, misgrouping performance data.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Comment on lines +154 to 156
applyRouteMatch(span, resolvedMatch, toLocation, WINDOW.location?.pathname || toLocation.pathname);
}
});

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 onResolved handler for navigation spans doesn't call applyRouteMatch for unmatched routes, preventing url.path and url.full attributes from being set on the span.
Severity: MEDIUM

Suggested Fix

Modify the onResolved handler for navigation spans. The applyRouteMatch function should be called even when resolvedMatch is undefined to ensure URL attributes are set correctly for unmatched routes. This could be done by moving the call outside the if (resolvedMatch) block or adjusting the logic to handle both matched and unmatched cases.

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/solid/src/tanstackrouter.ts#L154-L156

Potential issue: In the `onResolved` handler for navigation spans, a conditional check
`if (resolvedMatch)` prevents `applyRouteMatch` from executing when a navigation
resolves to a path without a matching route. While `applyRouteMatch` is designed to
handle this case by setting span attributes like `url.path` and `url.full`, the guard
prevents it from running. Consequently, navigation spans for unmatched routes (e.g., a
404 page) will be missing these important URL attributes, unlike pageload spans where
similar behavior is intentional.

@Lms24 Lms24 merged commit 24ef5c3 into develop Jul 9, 2026
596 of 599 checks passed
@Lms24 Lms24 deleted the feat/pageload-url-attrs-solid branch July 9, 2026 17:10
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.

3 participants