diff --git a/src/platform-includes/distributed-tracing/how-to-use/javascript.mdx b/src/platform-includes/distributed-tracing/how-to-use/javascript.mdx new file mode 100644 index 0000000000000..aa40f12669b1e --- /dev/null +++ b/src/platform-includes/distributed-tracing/how-to-use/javascript.mdx @@ -0,0 +1,14 @@ +If you're using the current version of our JavaScript SDK and have enabled the `BrowserTracing` integration, distributed tracing will work out of the box. To get around possible [Browser CORs](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) issues, define your `tracePropagationTargets`. + +```js +Sentry.init({ + dsn: "__DSN__", + integrations: [new Sentry.BrowserTracing()], + tracePropagationTargets: [ + "https://myproject.org", + "https://.*.otherservice.org/.*", + ], +}); +``` + +If you're using version `7.57.x` or below, you'll need to have our performance monitoring feature enabled in order for distributed tracing to work. diff --git a/src/platform-includes/distributed-tracing/how-to-use/javascript.nextjs.mdx b/src/platform-includes/distributed-tracing/how-to-use/javascript.nextjs.mdx new file mode 100644 index 0000000000000..36d4aa3467b15 --- /dev/null +++ b/src/platform-includes/distributed-tracing/how-to-use/javascript.nextjs.mdx @@ -0,0 +1,17 @@ +If you're using the current version of our Next.js SDK, distributed tracing will work out of the box for the client, server, and edge runtimes. + +For client-side you might have to define `tracePropagationTargets` to get around possible [Browser CORs](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) issues. + +```js +// sentry.client.config.js +Sentry.init({ + dsn: "__DSN__", + integrations: [new Sentry.BrowserTracing()], + tracePropagationTargets: [ + "https://myproject.org", + "https://.*.otherservice.org/.*", + ], +}); +``` + +If you're using version `7.57.x` or below, you'll need to have our performance monitoring feature enabled in order for distributed tracing to work. diff --git a/src/platform-includes/distributed-tracing/how-to-use/javascript.remix.mdx b/src/platform-includes/distributed-tracing/how-to-use/javascript.remix.mdx new file mode 100644 index 0000000000000..787c7a83b9da8 --- /dev/null +++ b/src/platform-includes/distributed-tracing/how-to-use/javascript.remix.mdx @@ -0,0 +1,15 @@ +If you're using the current version of our Remix SDK, distributed tracing will work out of the box for the client and server. To get around possible [Browser CORs](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) issues, you should define `tracePropagationTargets` for client-side. + +```tsx +// entry.client.tsx +Sentry.init({ + dsn: "__DSN__", + integrations: [new Sentry.BrowserTracing()], + tracePropagationTargets: [ + "https://myproject.org", + "https://.*.otherservice.org/.*", + ], +}); +``` + +If you're using version `7.57.x` or below, you'll need to have our performance monitoring feature enabled in order for distributed tracing to work. diff --git a/src/platform-includes/distributed-tracing/how-to-use/javascript.sveltekit.mdx b/src/platform-includes/distributed-tracing/how-to-use/javascript.sveltekit.mdx new file mode 100644 index 0000000000000..8ebc6c0449430 --- /dev/null +++ b/src/platform-includes/distributed-tracing/how-to-use/javascript.sveltekit.mdx @@ -0,0 +1,15 @@ +If you're using the current version of our SvelteKit SDK, distributed tracing will work out of the box for the client and server runtimes. To get around possible [Browser CORs](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) issues, you should define `tracePropagationTargets` for client-side. + +```js +// hooks.client.js +Sentry.init({ + dsn: "__DSN__", + integrations: [new BrowserTracing()], + tracePropagationTargets: [ + "https://myproject.org", + "https://.*.otherservice.org/.*", + ], +}); +``` + +If you're using version `7.57.x` or below, you'll need to have our performance monitoring feature enabled for distributed tracing to work. diff --git a/src/platform-includes/distributed-tracing/how-to-use/node.mdx b/src/platform-includes/distributed-tracing/how-to-use/node.mdx new file mode 100644 index 0000000000000..26d1e1979caf0 --- /dev/null +++ b/src/platform-includes/distributed-tracing/how-to-use/node.mdx @@ -0,0 +1,22 @@ +If you're using version `7.58.0` or above of our Node SDK and have the HTTP integration set up, distributed tracing will work out of the box. + +```js +Sentry.init({ + dsn: "___PUBLIC_DSN___", + integrations: [new Sentry.Integrations.Http({ tracing: true })], +}); +``` + +If you're using express or an express-compatible framework, you'll also need to use Sentry middleware: + +```js +const app = express(); + +// RequestHandler creates a separate execution context, so that all +// transactions/spans/breadcrumbs/tags are isolated across requests +app.use(Sentry.Handlers.requestHandler()); +// TracingHandler creates a trace for every incoming request +app.use(Sentry.Handlers.tracingHandler()); +``` + +If you're using version `7.57.x` or below, you'll need to have our performance monitoring feature enabled in order for distributed tracing to work. diff --git a/src/platform-includes/distributed-tracing/limiting-traces/javascript.mdx b/src/platform-includes/distributed-tracing/limiting-traces/javascript.mdx new file mode 100644 index 0000000000000..200567823746b --- /dev/null +++ b/src/platform-includes/distributed-tracing/limiting-traces/javascript.mdx @@ -0,0 +1,10 @@ +```javascript +Sentry.init({ + dsn: "___PUBLIC_DSN___", + integrations: [new Sentry.BrowserTracing()], + tracePropagationTargets: [ + "https://myproject.org", + "https://.*.otherservice.org/.*", + ], +}); +``` diff --git a/src/platform-includes/distributed-tracing/limiting-traces/node.mdx b/src/platform-includes/distributed-tracing/limiting-traces/node.mdx new file mode 100644 index 0000000000000..8098abfc10ccf --- /dev/null +++ b/src/platform-includes/distributed-tracing/limiting-traces/node.mdx @@ -0,0 +1,9 @@ +```javascript +Sentry.init({ + dsn: "___PUBLIC_DSN___", + tracePropagationTargets: [ + "https://myproject.org", + "https://.*.otherservice.org/.*", + ], +}); +```