You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the nextjs SDK, when a user hits the _error page, the original transaction name gets overwritten with _error. This causes two problems:
It makes it so a user would not be able to tell that they have a particularly buggy route, since every time it errored, it would show up in the Sentry UI filed under _error rather than the real route name.
The DSC can get propagated with the original transaction name, but that then doesn't match up with the eventual transaction name.
We should prevent the original name from getting overwritten.
(This is current as of 7.13.0.)
The text was updated successfully, but these errors were encountered:
lobsterkatie
changed the title
[nextjs] Transaction name issues when hitting _error page
[nextjs] Fix transaction name getting lost when hitting _error page
Sep 27, 2022
We should rephrase this issue so that it's clear that this only affects frontend pageload transactions (which get named _error in the case an error occurs in the backend). The backend transaction is still named and parameterized fine.
I believe we even had this behavior before we made any recent Next.js SDK changes.
The DSC can get propagated with the original transaction name, but that then doesn't match up with the eventual transaction name.
That is correct behaviour. The frontend must pick up the transaction name from the backend and put it into DSC no matter what. If there is no backend transaction (and inherently no backend DSC) the SDK currently propagates _error which behavior-wise is probably even fine because all the requests that we wanna trace are kicked off by the _error page and not by the page that is in window.location.pathname.
I actually think the todo I left is wrong. It doesn't matter that DSC and transaction name are different. This only matters in the head SDK which is the Next.js data fetcher instrumentation in our case and that works fine:
In the nextjs SDK, when a user hits the
_error
page, the original transaction name gets overwritten with_error
. This causes two problems:It makes it so a user would not be able to tell that they have a particularly buggy route, since every time it errored, it would show up in the Sentry UI filed under
_error
rather than the real route name.The DSC can get propagated with the original transaction name, but that then doesn't match up with the eventual transaction name.
We should prevent the original name from getting overwritten.
(This is current as of 7.13.0.)
The text was updated successfully, but these errors were encountered: