Skip to content

fix(ember): Add route IDs to pageload and navigation spans - #24372

Open
ihsraham wants to merge 2 commits into
getsentry:developfrom
ihsraham:fix/ember-route-description-24284
Open

ihsraham wants to merge 2 commits into
getsentry:developfrom
ihsraham:fix/ember-route-description-24284

Conversation

@ihsraham

Copy link
Copy Markdown

Ember pageload and navigation spans lack the route ID used to infer their descriptions. Add router.navigation.route.id when the route becomes known, using the existing route: prefix. Omit it when the route is unknown so a later update preserves caller-provided metadata.

Fixes #24284.

ihsraham and others added 2 commits September 14, 2026 16:53
Co-Authored-By: GPT-6 <codex@openai.com>
@ihsraham

Copy link
Copy Markdown
Author

@msonnb I've opened the fix discussed in #24284. The workflows are waiting for maintainer approval. Could you approve the runs when you have a chance?

@ihsraham
ihsraham marked this pull request as ready for review September 15, 2026 04:01
@ihsraham
ihsraham requested a review from a team as a code owner September 15, 2026 04:01
@ihsraham
ihsraham requested review from mydea and s1gr1d and removed request for a team September 15, 2026 04:01

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

Thanks for your contribution! I added a few comments

attributes: {
[SENTRY_SEGMENT_NAME_SOURCE]: routeInfo ? 'route' : 'url',
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.ember',
...(routeInfo ? { [ROUTER_NAVIGATION_ROUTE_ID]: `route:${routeInfo.name}` } : {}),

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.

The attribute is defined as only assigned by the framework (see here). We should not add another prefix (route:) here but just the plain route name.

attributes: {
[SENTRY_SEGMENT_NAME_SOURCE]: 'route',
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.ember',
...(toRoute !== undefined ? { [ROUTER_NAVIGATION_ROUTE_ID]: `route:${toRoute}` } : {}),

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.

Instead of !== undefined you could check with && as we probably don't want to care about empty strings either.

// Only the `ember-strict-resolver (streamed)` variant builds the app with `traceLifecycle: 'stream'`.
test.skip(process.env.E2E_TEST_TRACE_LIFECYCLE !== 'stream', 'requires the app built with span streaming');

test('preserves the route name on a streamed pageload', async ({ page }) => {

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.

The test name(s) should be rather something like "adds the route ID to a streamed pageload"

@github-actions

Copy link
Copy Markdown
Contributor

👋 @mydea — Please review this PR when you get a chance!

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.

Ember pageload and navigation spans lack span description inference attributes

2 participants