Closed revmischa closed 2 years ago
https://docs.sentry.io/platforms/javascript/guides/react/performance/instrumentation/automatic-instrumentation does this. We had to make sure that the Sentry setup is imported before the Apollo setup though, due to https://github.com/getsentry/sentry-javascript/issues/2860#issuecomment-684514367
// The side effect of patching fetch() has to occur before configuring Apollo Client
// https://github.com/getsentry/sentry-javascript/issues/2860#issuecomment-684514367
import './sentry';
import { ApolloProvider } from '@apollo/client';
@spawnia sorry following up on this cause I noticed the instructions suggest adding:
new Sentry.BrowserTracing({ traceFetch: false }),
which would disable the sentry-trace
header.
I guess it's not obvious in the README section if 1 and 2 are alternatives or both are needed
But if the README says we should disable the fetch instrumentation for GraphQL, then we still don't get a trace ID, right, @spawnia?
Would it be possible to automatically add the
sentry-trace
header to all requests to correlate backend and frontend errors?https://docs.sentry.io/platforms/javascript/performance/connect-services/