Skip to content

feat(angular): Set url attributes on pageload and navigation spans#21985

Merged
Lms24 merged 2 commits into
feat/pageload-url-attrs-basefrom
feat/pageload-url-attrs-angular
Jul 8, 2026
Merged

feat(angular): Set url attributes on pageload and navigation spans#21985
Lms24 merged 2 commits into
feat/pageload-url-attrs-basefrom
feat/pageload-url-attrs-angular

Conversation

@Lms24

@Lms24 Lms24 commented Jul 6, 2026

Copy link
Copy Markdown
Member

Adjusts the Angular routing instrumentation to set url.template and update url.full and url.path when resolving routes. We not only have to set template (which we can only do in the framework/router-specific instrumentation). We also have to ensure we set full and path again because in the default integration (#21952), we set it to early based on the window location path. So therefore, we update it again in the router instrumentation and re-set the raw URL (but the resolved one).

ref #21921

@Lms24 Lms24 self-assigned this Jul 6, 2026
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-base branch from 41cc9bd to 3831498 Compare July 6, 2026 13:25
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-angular branch from 9afa5d7 to 26d8b46 Compare July 6, 2026 13:25
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 27.59 kB - -
@sentry/browser - with treeshaking flags 26.03 kB - -
@sentry/browser (incl. Tracing) 46.34 kB +0.16% +70 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 48.13 kB +0.22% +104 B 🔺
@sentry/browser (incl. Tracing, Profiling) 51.12 kB +0.18% +87 B 🔺
@sentry/browser (incl. Tracing, Replay) 85.61 kB +0.07% +56 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.26 kB +0.12% +83 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 90.32 kB +0.07% +60 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 102.97 kB +0.06% +55 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.61 kB +0.17% +81 B 🔺
@sentry/vue 33.03 kB - -
@sentry/vue (incl. Tracing) 48.24 kB +0.18% +84 B 🔺
@sentry/svelte 27.61 kB - -
CDN Bundle 30 kB - -
CDN Bundle (incl. Tracing) 48.32 kB +0.17% +78 B 🔺
CDN Bundle (incl. Logs, Metrics) 31.57 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.64 kB +0.2% +97 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 70.81 kB - -
CDN Bundle (incl. Tracing, Replay) 85.84 kB +0.12% +96 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 87.14 kB +0.1% +83 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 91.64 kB +0.1% +86 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.92 kB +0.09% +82 B 🔺
CDN Bundle - uncompressed 89.35 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.1 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.75 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 265.27 kB +0.06% +135 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 269.23 kB +0.06% +135 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 278.97 kB +0.05% +135 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 282.92 kB +0.05% +135 B 🔺
@sentry/nextjs (client) 51.03 kB +0.18% +88 B 🔺
@sentry/sveltekit (client) 46.75 kB +0.16% +71 B 🔺
@sentry/core/server 78.42 kB - -
@sentry/core/browser 64.74 kB - -
@sentry/node-core 62.72 kB +0.01% +1 B 🔺
@sentry/node 124.6 kB +0.01% +1 B 🔺
@sentry/node (incl. diagnostics channel injection) 134.02 kB +0.01% +1 B 🔺
@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.05 kB - -
@sentry/aws-serverless 85.5 kB -0.01% -1 B 🔽
@sentry/cloudflare (withSentry) - minified 181.69 kB - -
@sentry/cloudflare (withSentry) 449.12 kB - -

View base workflow run

@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-angular branch from 26d8b46 to d7ce684 Compare July 6, 2026 13:46
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-base branch from 3831498 to 2ad4840 Compare July 6, 2026 13:46
@Lms24 Lms24 marked this pull request as ready for review July 6, 2026 14:09
@Lms24 Lms24 requested a review from a team as a code owner July 6, 2026 14:09
@Lms24 Lms24 requested review from chargome, mydea and s1gr1d and removed request for a team July 6, 2026 14:09
data: {
'sentry.origin': 'auto.pageload.angular',
'sentry.source': 'route',
'url.template': '/home/',

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.

q: We always want trailing slashes for this?

@Lms24 Lms24 Jul 6, 2026

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.

I think we generally don't want trailing slashes, but since url.template should ideally be 100% the same as the current span description (to avoid any filtering/grouping changes in the product) I'll take it for now. We're consistent because:

  • if we get a parameterized url, both url.template and span.description have a trailing slash
  • if we don't get a paramterized url, url.template isn't set, url.path has no trailing slash and neither does span.description.

Not great but I think it's fine. We could adjust our instrumentation in a major to no longer set trailing slashes for paramterized routes but I'd say it's logaf-l

Comment thread packages/angular/src/tracing.ts
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-base branch from 2ad4840 to 8832da5 Compare July 7, 2026 09:05
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-angular branch from d7ce684 to 76f14ee Compare July 7, 2026 09:05

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

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 76f14ee. Configure here.

@Lms24 Lms24 changed the title feat(angular): Set url attributes on pageload and navigation spans feat(angular): Set url attributes on pageload and navigation spans Jul 7, 2026
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-angular branch from 76f14ee to 212546b Compare July 7, 2026 13:51
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-base branch from 8832da5 to 67c4c14 Compare July 7, 2026 13:51
Comment thread packages/angular/src/tracing.ts
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-base branch from 67c4c14 to 64bc88c Compare July 7, 2026 15:50
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-angular branch from 212546b to c99fd2d Compare July 7, 2026 15:50
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-base branch from 64bc88c to 6a03681 Compare July 8, 2026 07:36
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-angular branch 2 times, most recently from ed91749 to b96995b Compare July 8, 2026 09:29
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-base branch 2 times, most recently from 00994ef to c7c516d Compare July 8, 2026 12:29
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-angular branch from b96995b to 5054905 Compare July 8, 2026 12:29
Add url.full, url.path, and url.template to Angular tracing spans,
resolve relative router URLs against the current origin, and extend
e2e performance tests to assert the new attributes.

Co-Authored-By: Cursor <cursoragent@cursor.com>
@Lms24 Lms24 force-pushed the feat/pageload-url-attrs-base branch from c7c516d to 975a966 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-angular branch from 5054905 to 9717e85 Compare July 8, 2026 13:11
@Lms24 Lms24 merged commit 3d3328e into develop Jul 8, 2026
53 checks passed
@Lms24 Lms24 deleted the feat/pageload-url-attrs-angular branch July 8, 2026 14:20
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