Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(angular): Set url attributes on pageload and navigation spans#21985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -17,6 +17,13 @@ test('sends a pageload transaction with a parameterized URL', async ({ page }) = | ||
| trace: { | ||
| op: 'pageload', | ||
| origin: 'auto.pageload.angular', | ||
| data: { | ||
| 'sentry.origin': 'auto.pageload.angular', | ||
| 'sentry.source': 'route', | ||
| 'url.template': '/home/', | ||
| 'url.path': '/home', | ||
| 'url.full': expect.stringMatching(/^https?:\/\/localhost:\d+\/home$/), | ||
| }, | ||
| }, | ||
| }, | ||
| transaction: '/home/', | ||
| @@ -46,6 +53,14 @@ test('sends a navigation transaction with a parameterized URL', async ({ page }) | ||
| contexts: { | ||
| trace: { | ||
| op: 'navigation', | ||
| origin: 'auto.navigation.angular', | ||
| data: { | ||
| 'sentry.origin': 'auto.navigation.angular', | ||
| 'sentry.source': 'route', | ||
| 'url.template': '/users/:id/', | ||
| 'url.path': '/users/123', | ||
| 'url.full': expect.stringMatching(/^https?:\/\/localhost:\d+\/users\/123$/), | ||
| }, | ||
| }, | ||
| }, | ||
| transaction: '/users/:id/', | ||
| @@ -78,6 +93,13 @@ test('sends a navigation transaction even if the pageload span is still active', | ||
| trace: { | ||
| op: 'pageload', | ||
| origin: 'auto.pageload.angular', | ||
| data: { | ||
| 'sentry.origin': 'auto.pageload.angular', | ||
| 'sentry.source': 'route', | ||
| 'url.template': '/home/', | ||
| 'url.path': '/home', | ||
| 'url.full': expect.stringMatching(/^https?:\/\/localhost:\d+\/home$/), | ||
| }, | ||
| }, | ||
| }, | ||
| transaction: '/home/', | ||
| @@ -91,6 +113,13 @@ test('sends a navigation transaction even if the pageload span is still active', | ||
| trace: { | ||
| op: 'navigation', | ||
| origin: 'auto.navigation.angular', | ||
| data: { | ||
| 'sentry.origin': 'auto.navigation.angular', | ||
| 'sentry.source': 'route', | ||
| 'url.template': '/users/:id/', | ||
| 'url.path': '/users/123', | ||
| 'url.full': expect.stringMatching(/^https?:\/\/localhost:\d+\/users\/123$/), | ||
| }, | ||
| }, | ||
| }, | ||
| transaction: '/users/:id/', | ||
| @@ -115,6 +144,13 @@ test('groups redirects within one navigation root span', async ({ page }) => { | ||
| trace: { | ||
| op: 'navigation', | ||
| origin: 'auto.navigation.angular', | ||
| data: { | ||
| 'sentry.origin': 'auto.navigation.angular', | ||
| 'sentry.source': 'route', | ||
| 'url.template': '/users/:id/', | ||
| 'url.path': '/users/456', | ||
| 'url.full': expect.stringMatching(/^https?:\/\/localhost:\d+\/users\/456$/), | ||
| }, | ||
| }, | ||
| }, | ||
| transaction: '/users/:id/', | ||
| @@ -145,6 +181,13 @@ test.describe('finish routing span', () => { | ||
| trace: { | ||
| op: 'navigation', | ||
| origin: 'auto.navigation.angular', | ||
| data: { | ||
| 'sentry.origin': 'auto.navigation.angular', | ||
| 'sentry.source': 'url', | ||
| 'url.path': '/cancel', | ||
| 'url.full': expect.stringMatching(/^https?:\/\/localhost:\d+\/cancel$/), | ||
| // url.template is not set because the navigation was cancelled before Angular fully resolved the route | ||
| }, | ||
cursor[bot] marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| }, | ||
| }, | ||
| transaction: '/cancel', | ||
| @@ -176,6 +219,13 @@ test.describe('finish routing span', () => { | ||
| trace: { | ||
| op: 'navigation', | ||
| origin: 'auto.navigation.angular', | ||
| data: { | ||
| 'sentry.origin': 'auto.navigation.angular', | ||
| 'sentry.source': 'url', | ||
| 'url.path': '/non-existent', | ||
| 'url.full': expect.stringMatching(/^https?:\/\/localhost:\d+\/non-existent$/), | ||
| // url.template is not set because the navigation failed before Angular fully resolved the route | ||
| }, | ||
| }, | ||
| }, | ||
| transaction: nonExistentRoute, | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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.templateshould 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:url.templateandspan.descriptionhave a trailing slashurl.templateisn't set,url.pathhas no trailing slash and neither doesspan.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