Skip to content
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

feat(angular): Update scope transactionName when route is resolved #11043

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Mar 12, 2024

builds on top of #10992

This PR updates our Angular TraceService to update the current scope's transactionName when we resolve a route and obtain a parameterized route name. This happens:

  • during a navigation
  • on first pageload (+ subsequent redirects)

Added/adjusted e2e tests to check for the correct event.transaction value.

part of #10846

@Lms24 Lms24 changed the base branch from develop to lms/feat-browser-scope-setTransactionName March 12, 2024 10:51
Comment on lines +146 to +148
if (route) {
getCurrentScope().setTransactionName(route);
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Note, I'm deliberately not guarding this by the root span b/c we also want to update the scope's transactionName regardless of the presence or state of a (root) span.

@Lms24 Lms24 self-assigned this Mar 12, 2024
@Lms24 Lms24 requested review from mydea and s1gr1d March 12, 2024 10:57
const activeSpan = getActiveSpan();
const rootSpan = activeSpan && getRootSpan(activeSpan);

// TODO (v8 / #5416): revisit the source condition. Do we want to make the parameterized route the default?
Copy link
Member Author

Choose a reason for hiding this comment

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

I opted to remove this comment because it's very unlikely that we change the behaviour (now extracted to _updateSpanAttributesForParametrizedUrl) and even if, it'd be a global initiative across all span update occasions.

Base automatically changed from lms/feat-browser-scope-setTransactionName to develop March 12, 2024 14:52
@Lms24 Lms24 force-pushed the lms/feat-angular-auto-update-scope-transactionName branch from 95a5431 to 2f2d56e Compare March 12, 2024 15:08
@Lms24 Lms24 merged commit 2ee0c18 into develop Mar 12, 2024
57 checks passed
@Lms24 Lms24 deleted the lms/feat-angular-auto-update-scope-transactionName branch March 12, 2024 15:23
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