I’m having trouble fully understanding how Performance Monitoring works. I’ve read https://docs.sentry.io/product/performance/distributed-tracing a few times and near the end there is a section called “Consistency Within a Trace”
Here it talks about how Sentry uses headers to tell the backend that tracing should be enabled.
However my setup is as follows
- SPA (React)
- Backend (GraphQL)
The SPA and Backend are disconnected. When a user does something in the frontend then react triggers graphql to ‘load’ that portion of the data. So during a single SPA session there can be multiple requests to the backend.
The sentry documentation states:
When each browser makes requests to your backend, it includes in those requests the “yes, please collect transactions” or the “no, don’t collect transactions this time” decision in the headers.
However whenever the SPA requests data from the backend there is no such header set. I don’t expect there to be either because the header would have to be added to the client library servicing the GraphQL requests from the frontend to the backend.
Perhaps there is something I am missing here? The only way I can think to do it is how transaction_ids works (https://docs.sentry.io/product/sentry-basics/guides/error-tracing/#generate-a-unique-transaction-id)
Transaction IDs work pretty well and in this case I set the header manually on my client library. Do I need to do the same for tracing? EG Set the header manually on the front end and then detect it on the backend (during sample_tracing callbacks)