-
-
Notifications
You must be signed in to change notification settings - Fork 239
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: Allow routeNameExtractor
to set transaction names
#1005
feat: Allow routeNameExtractor
to set transaction names
#1005
Conversation
@JaspervanRiet thanks for doing this. |
Yes, sounds reasonable to me, too. |
@JaspervanRiet please add a changelog entry and we are ready to go :) |
@marandaneto Should be done! |
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.
Thanks @JaspervanRiet
Codecov ReportBase: 89.66% // Head: 89.66% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## main #1005 +/- ##
=======================================
Coverage 89.66% 89.66%
=======================================
Files 106 106
Lines 3329 3329
=======================================
Hits 2985 2985
Misses 344 344 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Thanks for quick handling of this PR :) |
📜 Description
This PR adds the functionality to have the routeNameExtractor override the route names logged in Sentry, which I personally think makes more sense. It does not make sense to me that this extractor would only affect breadcrumbs, which is the current state, see Motivation.
Note that this is currently technically a breaking change. I'm open to changing the PR to avoid that, but I'd say the decision on how to proceed there is best left to the maintainers of this project. :)
💡 Motivation and Context
Setting the
routeNameExtractor
of theSentryNavigatorObserver
currently only affects breadcrumbs. For our app, this does not work. We use named routes with IDs to navigate to our pages, e.g./movies/1500
to navigate to the detail page of a movie. We want to measure the performance of this whole group of pages instead of the unique instance. We thought we would be able to use the extractor to do this, but sadly not.As for why I think this makes more sense:
routeNameExtractor
to me says that this functionality will allow you to mutate the route. Intuitively, that means this data will be used throughout theSentryNavigatorObserver
; nothing about this signifies that this would only affect breadcrumbs. I see no discussion about this in the introducing PR (#684), so hard to say if this was thought about.💚 How did you test it?
I used the current tests available for the observer, and added an extra test specific to this functionality since one was missing for the
routeNameExtractor
.📝 Checklist
🔮 Next steps