-
I am adding Sentry to a NextJS app that is being used like a SPA (no next backend code, instead all apis are on a different url and being called using Axios). I also have Sentry configured in the API this NextJS SPA is calling. I would like to see the full transaction (both frontend to backend) for all requests in performance. Right now I only see this on navigation events on create/update/delete events I don't see anything unless there is an exception/error. Once there is an issue it will show up on the Performance view but only on the "Most Related Issues", not in the search all transactions. Why is this happening? Also this event is only the API side, I see nothing from the client NextJS app side. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
For requests to be traced there needs to be an active transaction. Out of the box, transactions are only created on page load and on page navigations. These transactions finish automatically after some time. If you want requests to be traced. You need to manually start a transaction with There is currently no way of automatically creating transactions for all requests. |
Beta Was this translation helpful? Give feedback.
For requests to be traced there needs to be an active transaction. Out of the box, transactions are only created on page load and on page navigations. These transactions finish automatically after some time.
If you want requests to be traced. You need to manually start a transaction with
const t = Sentry.startTransaction()
and put it on the scope viaSentry.getCurrentHub().getScope()?.setSpan(t)
. After you're done with the request you can callt.finish()
to send the transaction to Sentry.There is currently no way of automatically creating transactions for all requests.