-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
React router integration should use route name instead of location #10196
Comments
Hi @ruudandriessen thanks we'll take a look! |
Hi @ruudandriessen, I could not reproduce the issue. Route lookup does not work correctly if |
I can confirm our
While I expected routes |
I believe I have found out what the exact issue is. It indeed works when the base contains just a regular string. However, it's a problem when a base URL is given with a I have a minimal reproduction case for you here: |
@onurtemizkan @Lms24 does the above reproduction case confirm this as a bug? Is there anything more I can do to help? |
Hi @ruudandriessen, thanks for the reproduction. So, we're including the given Test for reference: sentry-javascript/packages/react/test/reactrouterv6.4.test.tsx Lines 354 to 360 in 5f0b506
That said, we can add a flag for users wanting to opt-out from including What might be a bug is,
seeing cc: @Lms24 |
So to summarize (because I'm no React expert at all) we want to add an option to exclude the basename from the transaction/span name? Sounds good to me. |
Thanks! Having an option to include/exclude the basename sounds sensible. I can also confirm that
This is no longer happening. I think it may have been an older transaction. Our latest transactions only have the baseURL in them while we expected these to be stripped. |
Just checked out the latest release, can confirm the transactions that are being send now work as expected. We'll do a full end to end check, but I think that should turn out well now! Thanks for the quick turnaround time @onurtemizkan & @Lms24 🙏 |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/react
SDK Version
7.93.0
Framework Version
18.2.0
Link to Sentry event
No response
SDK Setup
Steps to Reproduce
Initialize sentry with react router v6.4 data API according to docs. E.g. above sentry init and:
When running this in our environment, we see transactions with the current
location
name show up. E.g.:baseurl/product/1234-hash-of-this-product-id
Expected Result
We expected transactions to by grouped by the route path as defined in react router, e.g:
As well as without their
baseurl
.The source of this seems to be:
sentry-javascript/packages/react/src/reactrouterv6.tsx
Line 293 in 56206f5
I believe a correct implementation would involve checking the matched routes and using the route path instead:
Actual Result
n/a
The text was updated successfully, but these errors were encountered: