For example:
- A frontend application is served from
example.com
. - A backend service is served from
api.example.com
. - The frontend application makes API calls to the backend.
- Set the
tracePropagationTargets
option to['api.example.com']
. - Now outgoing XHR/fetch requests to
api.example.com
will get thesentry-trace
header attached.
Sentry.init({
// ...
integrations: [
new Sentry.BrowserTracing({
tracePropagationTargets: ["api.example.com"],
}),
],
});