Skip to content

feat(browser): Set url.path and url.full on pageload and navigation spans#21952

Open
Lms24 wants to merge 6 commits into
developfrom
feat/pageload-url-attrs-base
Open

feat(browser): Set url.path and url.full on pageload and navigation spans#21952
Lms24 wants to merge 6 commits into
developfrom
feat/pageload-url-attrs-base

Conversation

@Lms24

@Lms24 Lms24 commented Jul 3, 2026

Copy link
Copy Markdown
Member

Adds high-cardinality url.path and url.full attributes to pageload and navigation spans. We need them for span description inference in Relay: https://getsentry.github.io/sentry-conventions/descriptions/#browser-pageload

More specific router instrumentations who can set a parameterized route will also set url.template which is the preferred attribute.

ref #21921

@Lms24 Lms24 requested a review from a team as a code owner July 3, 2026 10:08
@Lms24 Lms24 requested review from logaretm and mydea and removed request for a team July 3, 2026 10:08
Comment thread packages/browser/src/tracing/browserTracingIntegration.ts Outdated
Comment thread packages/browser/src/tracing/browserTracingIntegration.ts
@Lms24 Lms24 marked this pull request as draft July 3, 2026 10:15
@github-actions

github-actions Bot commented Jul 3, 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.32 kB +0.17% +74 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 48.12 kB +0.22% +102 B 🔺
@sentry/browser (incl. Tracing, Profiling) 51.08 kB +0.14% +71 B 🔺
@sentry/browser (incl. Tracing, Replay) 85.57 kB +0.1% +80 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.19 kB +0.12% +89 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 90.27 kB +0.1% +85 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 102.92 kB +0.08% +77 B 🔺
@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.59 kB +0.17% +82 B 🔺
@sentry/vue 33.03 kB - -
@sentry/vue (incl. Tracing) 48.22 kB +0.23% +109 B 🔺
@sentry/svelte 27.61 kB - -
CDN Bundle 30 kB - -
CDN Bundle (incl. Tracing) 48.32 kB +0.17% +79 B 🔺
CDN Bundle (incl. Logs, Metrics) 31.57 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.63 kB +0.19% +92 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 70.77 kB - -
CDN Bundle (incl. Tracing, Replay) 85.76 kB +0.07% +59 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 87.07 kB +0.09% +70 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 91.58 kB +0.09% +82 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.84 kB +0.08% +66 B 🔺
CDN Bundle - uncompressed 89.35 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.09 kB +0.1% +135 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 94.05 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 150.07 kB +0.1% +135 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 218.59 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 265.11 kB +0.06% +135 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 269.07 kB +0.06% +135 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 278.81 kB +0.05% +135 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 282.76 kB +0.05% +135 B 🔺
@sentry/nextjs (client) 51 kB +0.12% +57 B 🔺
@sentry/sveltekit (client) 46.73 kB +0.17% +77 B 🔺
@sentry/core/server 78.38 kB - -
@sentry/core/browser 64.73 kB - -
@sentry/node-core 63.2 kB -0.01% -1 B 🔽
@sentry/node 123.2 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.24 kB - -
@sentry/aws-serverless 85.02 kB - -
@sentry/cloudflare (withSentry) - minified 181.68 kB - -
@sentry/cloudflare (withSentry) 449.39 kB - -

View base workflow run

@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-base branch 2 times, most recently from 088a93e to 7c4bfcb Compare July 3, 2026 13:05

@logaretm logaretm left a comment

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.

I assume since we added the sentry conventions we can now replace all the constants in the browser SDK? I can do that.

@Lms24 Lms24 marked this pull request as ready for review July 6, 2026 08:06
@Lms24

Lms24 commented Jul 6, 2026

Copy link
Copy Markdown
Member Author

I assume since we added the sentry conventions we can now replace all the constants in the browser SDK? I can do that.

Yes, we can now use conventions instead of hard-coded strings or the exports from @sentry/core. There's no need to rush this though, so no need to drop anything else in favour of it.

@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-base branch from d20b04f to c20fc4a Compare July 6, 2026 08:20

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

[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'custom',
[URL_FULL]: 'https://example.com/',
[URL_PATH]: '/',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hook test missing url option

Low Severity

startBrowserTracingNavigationSpan now emits beforeStartNavigationSpan with { isRedirect, url }, but the listener test still expects only { isRedirect: undefined }. The assertion no longer matches the hook payload and the test should fail until it includes the url field.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c20fc4a. Configure here.

@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-base branch from c20fc4a to 41cc9bd Compare July 6, 2026 13:13
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-base branch from 41cc9bd to 3831498 Compare July 6, 2026 13:25
@Lms24 Lms24 self-assigned this Jul 6, 2026
Lms24 and others added 6 commits July 6, 2026 15:46
…pans

Set the `url.path` (raw, unparameterized pathname without query, fragment or
domain) and `url.full` (the entire URL) attributes on pageload and navigation
root spans. This is done centrally in `_createRouteSpan`, which every pageload
and navigation span funnels through, so all downstream framework SDKs inherit
these attributes without additional wiring.

Co-Authored-By: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-base branch from 3831498 to 2ad4840 Compare July 6, 2026 13:46
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