feat(ember): Set url.template, url.path and url.full on router spans#22095
feat(ember): Set url.template, url.path and url.full on router spans#22095Lms24 wants to merge 1 commit into
Conversation
size-limit report 📦
|
ff5adcc to
be1c420
Compare
aa52df6 to
45fa82b
Compare
be1c420 to
ff5adcc
Compare
45fa82b to
659f478
Compare
ff5adcc to
be1c420
Compare
659f478 to
45fa82b
Compare
be1c420 to
ff5adcc
Compare
45fa82b to
659f478
Compare
ff5adcc to
a40f18b
Compare
659f478 to
610bc80
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 610bc80. Configure here.
610bc80 to
cfee70c
Compare
6265a7c to
ffde4cb
Compare
6a4e140 to
afa64b0
Compare
ffde4cb to
c2ee1fa
Compare
afa64b0 to
b3c7a17
Compare
Emit standard URL attributes on Ember pageload and navigation root spans, updating navigation attributes at routeDidChange once the destination URL is finalized. Co-Authored-By: Cursor <cursoragent@cursor.com>
b3c7a17 to
219838a
Compare
c2ee1fa to
a020c02
Compare
| attributes: { | ||
| [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'route', | ||
| [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.ember', | ||
| ..._getRouteUrlAttributes(url, routeInfo.params), |
There was a problem hiding this comment.
Bug: The result of routerService.recognize(url) can be null, but its properties are accessed without a null check, which could cause a TypeError during instrumentation.
Severity: MEDIUM
Suggested Fix
Add a null check for the routeInfo object after calling routerService.recognize(url). If routeInfo is null, provide a fallback or default value for the route name and parameters to prevent a TypeError when starting the span.
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/ember/addon/utils/instrumentEmberAppInstanceForPerformance.ts#L154
Potential issue: The `routerService.recognize(url)` method can return `null` if the
provided URL does not match any known routes, which can occur in misconfigured
applications or with unusual URL formats. The code accesses `routeInfo.name` and the
newly added `routeInfo.params` without first checking if the `routeInfo` object is null.
This will lead to a `TypeError` and crash the page load instrumentation when an
unrecognized URL is encountered.
Also affects:
packages/ember/addon/utils/instrumentEmberAppInstanceForPerformance.ts:217

Emit
url.template,url.path, andurl.fullon Ember pageload and navigation root spans so Ember aligns with the other framework router instrumentations in this stack.Navigation spans set URL attributes at
routeDidChangeviarouterService.currentURL, once the destination route is finalized. Dynamic path segments are parameterized intourl.template(e.g./users/123→/users/:user_id).E2E coverage was added for both
ember-classicandember-embroider, plus unit tests for the URL attribute helpers.Stacked on #22091.