From 57750d4003487bf94ae7dbadeade8ff0e226b17d Mon Sep 17 00:00:00 2001 From: Daniil Dubrava Date: Mon, 17 Jul 2023 19:01:19 +0200 Subject: [PATCH] fix: move tracePropagationTargets to BrowserTracing options --- .../distributed-tracing/how-to-use/javascript.mdx | 12 ++++++++---- .../how-to-use/javascript.nextjs.mdx | 12 ++++++++---- .../how-to-use/javascript.remix.mdx | 12 ++++++++---- .../how-to-use/javascript.sveltekit.mdx | 12 ++++++++---- .../limiting-traces/javascript.mdx | 12 ++++++++---- .../getting-started-config/javascript.angular.mdx | 10 ++++------ .../getting-started-config/javascript.capacitor.mdx | 1 + .../getting-started-config/javascript.mdx | 11 +++++++---- .../getting-started-config/javascript.react.mdx | 5 ++--- .../getting-started-config/javascript.remix.mdx | 5 ++--- .../getting-started-config/javascript.svelte.mdx | 11 +++++++---- .../getting-started-config/javascript.vue.mdx | 10 ++++------ .../performance/configure-sample-rate/javascript.mdx | 10 ++++++---- .../configure-sample-rate/javascript.react.mdx | 5 ++--- .../configure-sample-rate/javascript.vue.mdx | 9 ++++++--- .../tracePropagationTargets-example/javascript.mdx | 10 ++++++---- .../tracePropagationTargets-example/react-native.mdx | 1 + src/platforms/javascript/common/install/loader.mdx | 8 ++++---- src/wizard/javascript/angular/index.md | 5 ++--- .../with-error-monitoring-performance-and-replay.md | 4 ++-- .../with-error-monitoring-performance-and-replay.md | 10 +++++++--- src/wizard/javascript/index.md | 10 ++++++---- .../nextjs/with-error-monitoring-and-performance.md | 9 ++++++--- .../with-error-monitoring-performance-and-replay.md | 10 +++++++--- .../performance-onboarding/react/2.configure.md | 7 ++++--- .../react/with-error-monitoring-and-performance.md | 7 ++++--- src/wizard/javascript/remix/index.md | 4 ++-- .../remix/with-error-monitoring-and-performance.md | 4 ++-- .../with-error-monitoring-performance-and-replay.md | 4 ++-- .../svelte/with-error-monitoring-and-performance.md | 9 ++++++--- src/wizard/javascript/vue/index.md | 8 ++++---- .../vue/with-error-monitoring-and-performance.md | 8 ++++---- .../with-error-monitoring-performance-and-replay.md | 4 ++-- .../with-error-monitoring-and-performance.md | 10 ++++++---- 34 files changed, 158 insertions(+), 111 deletions(-) diff --git a/src/platform-includes/distributed-tracing/how-to-use/javascript.mdx b/src/platform-includes/distributed-tracing/how-to-use/javascript.mdx index 9550040056e66..cbb951299b06a 100644 --- a/src/platform-includes/distributed-tracing/how-to-use/javascript.mdx +++ b/src/platform-includes/distributed-tracing/how-to-use/javascript.mdx @@ -3,10 +3,14 @@ If you're using the current version of our JavaScript SDK and have enabled the ` ```js Sentry.init({ dsn: "__DSN__", - integrations: [new Sentry.BrowserTracing()], - tracePropagationTargets: [ - "https://myproject.org", - "https://.*.otherservice.org/.*", + integrations: [ + new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: [ + "https://myproject.org", + "https://.*.otherservice.org/.*", + ], + }), ], }); ``` 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 index 87fd669055e3e..b688f86e5c893 100644 --- a/src/platform-includes/distributed-tracing/how-to-use/javascript.nextjs.mdx +++ b/src/platform-includes/distributed-tracing/how-to-use/javascript.nextjs.mdx @@ -6,10 +6,14 @@ For client-side you might have to define `tracePropagationTargets` to get around // sentry.client.config.js Sentry.init({ dsn: "__DSN__", - integrations: [new Sentry.BrowserTracing()], - tracePropagationTargets: [ - "https://myproject.org", - "https://.*.otherservice.org/.*", + integrations: [ + new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: [ + "https://myproject.org", + "https://.*.otherservice.org/.*", + ], + }), ], }); ``` 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 index 7aba7b449843d..e42e5dea68425 100644 --- a/src/platform-includes/distributed-tracing/how-to-use/javascript.remix.mdx +++ b/src/platform-includes/distributed-tracing/how-to-use/javascript.remix.mdx @@ -4,10 +4,14 @@ If you're using the current version of our Remix SDK, distributed tracing will w // entry.client.tsx Sentry.init({ dsn: "__DSN__", - integrations: [new Sentry.BrowserTracing()], - tracePropagationTargets: [ - "https://myproject.org", - "https://.*.otherservice.org/.*", + integrations: [ + new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: [ + "https://myproject.org", + "https://.*.otherservice.org/.*", + ], + }), ], }); ``` 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 index 29e72fc938ccc..2cc68821d4a82 100644 --- a/src/platform-includes/distributed-tracing/how-to-use/javascript.sveltekit.mdx +++ b/src/platform-includes/distributed-tracing/how-to-use/javascript.sveltekit.mdx @@ -4,10 +4,14 @@ If you're using the current version of our SvelteKit SDK, distributed tracing wi // hooks.client.js Sentry.init({ dsn: "__DSN__", - integrations: [new BrowserTracing()], - tracePropagationTargets: [ - "https://myproject.org", - "https://.*.otherservice.org/.*", + integrations: [ + new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: [ + "https://myproject.org", + "https://.*.otherservice.org/.*", + ], + }), ], }); ``` diff --git a/src/platform-includes/distributed-tracing/limiting-traces/javascript.mdx b/src/platform-includes/distributed-tracing/limiting-traces/javascript.mdx index 200567823746b..c8d612d5b5d4d 100644 --- a/src/platform-includes/distributed-tracing/limiting-traces/javascript.mdx +++ b/src/platform-includes/distributed-tracing/limiting-traces/javascript.mdx @@ -1,10 +1,14 @@ ```javascript Sentry.init({ dsn: "___PUBLIC_DSN___", - integrations: [new Sentry.BrowserTracing()], - tracePropagationTargets: [ - "https://myproject.org", - "https://.*.otherservice.org/.*", + integrations: [ + new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled“ + tracePropagationTargets: [ + "https://myproject.org", + "https://.*.otherservice.org/.*", + ], + }), ], }); ``` diff --git a/src/platform-includes/getting-started-config/javascript.angular.mdx b/src/platform-includes/getting-started-config/javascript.angular.mdx index 39685305682f0..d7da8473dcbb6 100644 --- a/src/platform-includes/getting-started-config/javascript.angular.mdx +++ b/src/platform-includes/getting-started-config/javascript.angular.mdx @@ -13,6 +13,8 @@ Sentry.init({ // which automatically instruments your application to monitor its // performance, including custom Angular routing instrumentation new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], routingInstrumentation: Sentry.routingInstrumentation, }), // Registers the Replay integration, @@ -25,9 +27,6 @@ Sentry.init({ // We recommend adjusting this value in production tracesSampleRate: 1.0, - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], - // Capture Replay for 10% of all sessions, // plus for 100% of sessions with an error replaysSessionSampleRate: 0.1, @@ -53,6 +52,8 @@ Sentry.init({ // which automatically instruments your application to monitor its // performance, including custom Angular routing instrumentation new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], routingInstrumentation: Sentry.routingInstrumentation, }), ], @@ -61,9 +62,6 @@ Sentry.init({ // of transactions for performance monitoring. // We recommend adjusting this value in production tracesSampleRate: 1.0, - - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], }); platformBrowserDynamic() diff --git a/src/platform-includes/getting-started-config/javascript.capacitor.mdx b/src/platform-includes/getting-started-config/javascript.capacitor.mdx index db0bf337b11b6..0d8cd8822e1bc 100644 --- a/src/platform-includes/getting-started-config/javascript.capacitor.mdx +++ b/src/platform-includes/getting-started-config/javascript.capacitor.mdx @@ -18,6 +18,7 @@ Sentry.init( // which automatically instruments your application to monitor its // performance, including custom Angular routing instrumentation new SentryAngular.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled tracePropagationTargets: ["localhost", "https://yourserver.io/api"], routingInstrumentation: SentryAngular.routingInstrumentation, }), diff --git a/src/platform-includes/getting-started-config/javascript.mdx b/src/platform-includes/getting-started-config/javascript.mdx index 0703796a5dbe1..a51a2a85e47d9 100644 --- a/src/platform-includes/getting-started-config/javascript.mdx +++ b/src/platform-includes/getting-started-config/javascript.mdx @@ -9,16 +9,19 @@ Sentry.init({ // Alternatively, use `process.env.npm_package_version` for a dynamic release version // if your build tool supports it. release: "my-project-name@2.3.12", - integrations: [new Sentry.BrowserTracing(), new Sentry.Replay()], + integrations: [ + new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], + }), + new Sentry.Replay(), + ], // Set tracesSampleRate to 1.0 to capture 100% // of transactions for performance monitoring. // We recommend adjusting this value in production tracesSampleRate: 1.0, - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], - // Capture Replay for 10% of all sessions, // plus for 100% of sessions with an error replaysSessionSampleRate: 0.1, diff --git a/src/platform-includes/getting-started-config/javascript.react.mdx b/src/platform-includes/getting-started-config/javascript.react.mdx index ace0287cb8e93..bd915a1d52056 100644 --- a/src/platform-includes/getting-started-config/javascript.react.mdx +++ b/src/platform-includes/getting-started-config/javascript.react.mdx @@ -9,6 +9,8 @@ Sentry.init({ dsn: "___PUBLIC_DSN___", integrations: [ new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], // See docs for support of different versions of variation of react router // https://docs.sentry.io/platforms/javascript/guides/react/configuration/integrations/react-router/ routingInstrumentation: Sentry.reactRouterV6Instrumentation( @@ -26,9 +28,6 @@ Sentry.init({ // of transactions for performance monitoring. tracesSampleRate: 1.0, - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], - // Capture Replay for 10% of all sessions, // plus for 100% of sessions with an error replaysSessionSampleRate: 0.1, diff --git a/src/platform-includes/getting-started-config/javascript.remix.mdx b/src/platform-includes/getting-started-config/javascript.remix.mdx index a0d3351647b56..0177efcd85609 100644 --- a/src/platform-includes/getting-started-config/javascript.remix.mdx +++ b/src/platform-includes/getting-started-config/javascript.remix.mdx @@ -13,6 +13,8 @@ Sentry.init({ dsn: "___PUBLIC_DSN___", integrations: [ new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], routingInstrumentation: Sentry.remixRouterInstrumentation( useEffect, useLocation, @@ -28,9 +30,6 @@ Sentry.init({ // We recommend adjusting this value in production tracesSampleRate: 1.0, - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], - // Capture Replay for 10% of all sessions, // plus for 100% of sessions with an error replaysSessionSampleRate: 0.1, diff --git a/src/platform-includes/getting-started-config/javascript.svelte.mdx b/src/platform-includes/getting-started-config/javascript.svelte.mdx index 06ef46a7c8668..8c49b09948592 100644 --- a/src/platform-includes/getting-started-config/javascript.svelte.mdx +++ b/src/platform-includes/getting-started-config/javascript.svelte.mdx @@ -9,16 +9,19 @@ import * as Sentry from "@sentry/svelte"; // Initialize the Sentry SDK here Sentry.init({ dsn: "___PUBLIC_DSN___", - integrations: [new Sentry.BrowserTracing(), new Sentry.Replay()], + integrations: [ + new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], + }), + new Sentry.Replay(), + ], // Set tracesSampleRate to 1.0 to capture 100% // of transactions for performance monitoring. // We recommend adjusting this value in production tracesSampleRate: 1.0, - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], - // Capture Replay for 10% of all sessions, // plus for 100% of sessions with an error replaysSessionSampleRate: 0.1, diff --git a/src/platform-includes/getting-started-config/javascript.vue.mdx b/src/platform-includes/getting-started-config/javascript.vue.mdx index e7c92a5261eec..28438764d8c59 100644 --- a/src/platform-includes/getting-started-config/javascript.vue.mdx +++ b/src/platform-includes/getting-started-config/javascript.vue.mdx @@ -19,6 +19,8 @@ Sentry.init({ dsn: "___PUBLIC_DSN___", integrations: [ new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], routingInstrumentation: Sentry.vueRouterInstrumentation(router), }), new Sentry.Replay(), @@ -29,9 +31,6 @@ Sentry.init({ // We recommend adjusting this value in production tracesSampleRate: 1.0, - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], - // Capture Replay for 10% of all sessions, // plus for 100% of sessions with an error replaysSessionSampleRate: 0.1, @@ -60,6 +59,8 @@ Sentry.init({ dsn: "___PUBLIC_DSN___", integrations: [ new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], routingInstrumentation: Sentry.vueRouterInstrumentation(router), }), new Sentry.Replay(), @@ -70,9 +71,6 @@ Sentry.init({ // We recommend adjusting this value in production tracesSampleRate: 1.0, - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], - // Capture Replay for 10% of all sessions, // plus for 100% of sessions with an error replaysSessionSampleRate: 0.1, diff --git a/src/platform-includes/performance/configure-sample-rate/javascript.mdx b/src/platform-includes/performance/configure-sample-rate/javascript.mdx index 2b2753af19c36..d37d9eea6ddd2 100644 --- a/src/platform-includes/performance/configure-sample-rate/javascript.mdx +++ b/src/platform-includes/performance/configure-sample-rate/javascript.mdx @@ -11,13 +11,15 @@ Sentry.init({ // If you only want to use custom instrumentation: // * Remove the `BrowserTracing` integration // * add `Sentry.addTracingExtensions()` above your Sentry.init() call - integrations: [new Sentry.BrowserTracing()], + integrations: [ + new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], + }), + ], // We recommend adjusting this value in production, or using tracesSampler // for finer control tracesSampleRate: 1.0, - - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], }); ``` diff --git a/src/platform-includes/performance/configure-sample-rate/javascript.react.mdx b/src/platform-includes/performance/configure-sample-rate/javascript.react.mdx index 8496e0b7537d4..7cede1adae3a4 100644 --- a/src/platform-includes/performance/configure-sample-rate/javascript.react.mdx +++ b/src/platform-includes/performance/configure-sample-rate/javascript.react.mdx @@ -11,6 +11,8 @@ Sentry.init({ // * add `Sentry.addTracingExtensions()` above your Sentry.init() call integrations: [ new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], // See docs for support of different versions of variation of react router // https://docs.sentry.io/platforms/javascript/guides/react/configuration/integrations/react-router/ routingInstrumentation: Sentry.reactRouterV6Instrumentation( @@ -26,8 +28,5 @@ Sentry.init({ // For finer control of sent transactions you can adjust this value, or // use tracesSampler tracesSampleRate: 1.0, - - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], }); ``` diff --git a/src/platform-includes/performance/configure-sample-rate/javascript.vue.mdx b/src/platform-includes/performance/configure-sample-rate/javascript.vue.mdx index f286fb8566d70..18be5b12fb114 100644 --- a/src/platform-includes/performance/configure-sample-rate/javascript.vue.mdx +++ b/src/platform-includes/performance/configure-sample-rate/javascript.vue.mdx @@ -12,13 +12,16 @@ Sentry.init({ // If you only want to use custom instrumentation: // * Remove the `BrowserTracing` integration // * add `Sentry.addTracingExtensions()` above your Sentry.init() call - integrations: [new Sentry.BrowserTracing()], + integrations: [ + new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], + }), + ], // We recommend adjusting this value in production, or using tracesSampler // for finer control tracesSampleRate: 1.0, - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], }); ``` diff --git a/src/platform-includes/performance/tracePropagationTargets-example/javascript.mdx b/src/platform-includes/performance/tracePropagationTargets-example/javascript.mdx index 6db411b0ed74d..98e31b5163b44 100644 --- a/src/platform-includes/performance/tracePropagationTargets-example/javascript.mdx +++ b/src/platform-includes/performance/tracePropagationTargets-example/javascript.mdx @@ -10,9 +10,11 @@ For example: ```javascript Sentry.init({ // ... - integrations: [new Sentry.BrowserTracing()], - - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], + integrations: [ + new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], + }), + ], }); ``` diff --git a/src/platform-includes/performance/tracePropagationTargets-example/react-native.mdx b/src/platform-includes/performance/tracePropagationTargets-example/react-native.mdx index d43514d023716..69ede22de456a 100644 --- a/src/platform-includes/performance/tracePropagationTargets-example/react-native.mdx +++ b/src/platform-includes/performance/tracePropagationTargets-example/react-native.mdx @@ -11,6 +11,7 @@ Sentry.init({ dsn: "___PUBLIC_DSN___", integrations: [ new Sentry.ReactNativeTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled tracePropagationTargets: ["localhost", "my-site-url.com"], }), ], diff --git a/src/platforms/javascript/common/install/loader.mdx b/src/platforms/javascript/common/install/loader.mdx index d2746f70650e1..565ecca308ff0 100644 --- a/src/platforms/javascript/common/install/loader.mdx +++ b/src/platforms/javascript/common/install/loader.mdx @@ -186,7 +186,10 @@ Sentry.init({ release: "my-project-name@" + process.env.npm_package_version, integrations: [ // If you use a bundle with performance monitoring enabled, add the BrowserTracing integration - new Sentry.BrowserTracing(), + new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], + }), // If you use a bundle with session replay enabled, add the SessionReplay integration new Sentry.Replay(), ], @@ -194,9 +197,6 @@ Sentry.init({ // We recommend adjusting this value in production, or using tracesSampler // for finer control tracesSampleRate: 1.0, - - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], }); ``` diff --git a/src/wizard/javascript/angular/index.md b/src/wizard/javascript/angular/index.md index f084649047c66..f59cdf583b80a 100644 --- a/src/wizard/javascript/angular/index.md +++ b/src/wizard/javascript/angular/index.md @@ -38,6 +38,8 @@ Sentry.init({ dsn: "___PUBLIC_DSN___", integrations: [ new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], routingInstrumentation: Sentry.routingInstrumentation, }), ], @@ -46,9 +48,6 @@ Sentry.init({ // of transactions for performance monitoring. // We recommend adjusting this value in production tracesSampleRate: 1.0, - - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], }); enableProdMode(); diff --git a/src/wizard/javascript/angular/with-error-monitoring-performance-and-replay.md b/src/wizard/javascript/angular/with-error-monitoring-performance-and-replay.md index e1cb36576bb23..52d9d351fa7c4 100644 --- a/src/wizard/javascript/angular/with-error-monitoring-performance-and-replay.md +++ b/src/wizard/javascript/angular/with-error-monitoring-performance-and-replay.md @@ -42,6 +42,8 @@ Sentry.init({ dsn: "___PUBLIC_DSN___", integrations: [ new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], routingInstrumentation: Sentry.routingInstrumentation, }), new Sentry.Replay(), @@ -49,8 +51,6 @@ Sentry.init({ // Performance Monitoring tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], // Session Replay replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production. diff --git a/src/wizard/javascript/gatsby/with-error-monitoring-performance-and-replay.md b/src/wizard/javascript/gatsby/with-error-monitoring-performance-and-replay.md index d53468aed5dcd..173e45f887457 100644 --- a/src/wizard/javascript/gatsby/with-error-monitoring-performance-and-replay.md +++ b/src/wizard/javascript/gatsby/with-error-monitoring-performance-and-replay.md @@ -38,12 +38,16 @@ import * as Sentry from "@sentry/gatsby"; Sentry.init({ dsn: "___PUBLIC_DSN___", - integrations: [new Sentry.BrowserTracing(), new Sentry.Replay()], + integrations: [ + new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], + }), + new Sentry.Replay(), + ], // Performance Monitoring tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], // Session Replay replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production. diff --git a/src/wizard/javascript/index.md b/src/wizard/javascript/index.md index dfce34ecd9859..c105ad5fd8dc2 100644 --- a/src/wizard/javascript/index.md +++ b/src/wizard/javascript/index.md @@ -23,15 +23,17 @@ import * as Sentry from "@sentry/browser"; Sentry.init({ dsn: "___PUBLIC_DSN___", - integrations: [new Sentry.BrowserTracing()], + integrations: [ + new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], + }), + ], // Set tracesSampleRate to 1.0 to capture 100% // of transactions for performance monitoring. // We recommend adjusting this value in production tracesSampleRate: 1.0, - - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], }); ``` diff --git a/src/wizard/javascript/nextjs/with-error-monitoring-and-performance.md b/src/wizard/javascript/nextjs/with-error-monitoring-and-performance.md index 9b77641682ff1..a70d21bd2e9bf 100644 --- a/src/wizard/javascript/nextjs/with-error-monitoring-and-performance.md +++ b/src/wizard/javascript/nextjs/with-error-monitoring-and-performance.md @@ -36,12 +36,15 @@ npm install --save @sentry/nextjs ```javascript Sentry.init({ dsn: "___PUBLIC_DSN___", - integrations: [new Sentry.BrowserTracing()], + integrations: [ + new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], + }), + ], // Performance Monitoring tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], }); ``` diff --git a/src/wizard/javascript/nextjs/with-error-monitoring-performance-and-replay.md b/src/wizard/javascript/nextjs/with-error-monitoring-performance-and-replay.md index a5146674b9c2a..4ba16b93bffeb 100644 --- a/src/wizard/javascript/nextjs/with-error-monitoring-performance-and-replay.md +++ b/src/wizard/javascript/nextjs/with-error-monitoring-performance-and-replay.md @@ -36,12 +36,16 @@ npm install --save @sentry/nextjs ```javascript Sentry.init({ dsn: "___PUBLIC_DSN___", - integrations: [new Sentry.BrowserTracing(), new Sentry.Replay()], + integrations: [ + new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], + }), + new Sentry.Replay(), + ], // Performance Monitoring tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], // Session Replay replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production. diff --git a/src/wizard/javascript/performance-onboarding/react/2.configure.md b/src/wizard/javascript/performance-onboarding/react/2.configure.md index 187788b373317..7cc67cab794d8 100644 --- a/src/wizard/javascript/performance-onboarding/react/2.configure.md +++ b/src/wizard/javascript/performance-onboarding/react/2.configure.md @@ -17,14 +17,15 @@ import App from "./App"; Sentry.init({ dsn: "___PUBLIC_DSN___", - integrations: [new Sentry.BrowserTracing()], + integrations: [new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], + })], // Set tracesSampleRate to 1.0 to capture 100% // of transactions for performance monitoring. // We recommend adjusting this value in production tracesSampleRate: 1.0, - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], }); ReactDOM.render(, document.getElementById("root")); diff --git a/src/wizard/javascript/react/with-error-monitoring-and-performance.md b/src/wizard/javascript/react/with-error-monitoring-and-performance.md index 31e2451cc948f..ad581cbaf24bd 100644 --- a/src/wizard/javascript/react/with-error-monitoring-and-performance.md +++ b/src/wizard/javascript/react/with-error-monitoring-and-performance.md @@ -30,13 +30,14 @@ import App from "./App"; Sentry.init({ dsn: "___PUBLIC_DSN___", integrations: [ - new Sentry.BrowserTracing(), + new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], + }), ], // Performance Monitoring tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], }); const container = document.getElementById(“app”); diff --git a/src/wizard/javascript/remix/index.md b/src/wizard/javascript/remix/index.md index a59377886a4c6..437d2d2973977 100644 --- a/src/wizard/javascript/remix/index.md +++ b/src/wizard/javascript/remix/index.md @@ -26,6 +26,8 @@ Sentry.init({ dsn: "___PUBLIC_DSN___", integrations: [ new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], routingInstrumentation: Sentry.remixRouterInstrumentation( useEffect, useLocation, @@ -35,8 +37,6 @@ Sentry.init({ ], // Performance Monitoring tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], }); ``` diff --git a/src/wizard/javascript/remix/with-error-monitoring-and-performance.md b/src/wizard/javascript/remix/with-error-monitoring-and-performance.md index 66347e432a4e3..e35fe21e093b8 100644 --- a/src/wizard/javascript/remix/with-error-monitoring-and-performance.md +++ b/src/wizard/javascript/remix/with-error-monitoring-and-performance.md @@ -30,6 +30,8 @@ Sentry.init({ dsn: "___PUBLIC_DSN___", integrations: [ new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], routingInstrumentation: Sentry.remixRouterInstrumentation( useEffect, useLocation, @@ -40,8 +42,6 @@ Sentry.init({ // Performance Monitoring tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], }); ``` diff --git a/src/wizard/javascript/remix/with-error-monitoring-performance-and-replay.md b/src/wizard/javascript/remix/with-error-monitoring-performance-and-replay.md index c1c52a9d0e514..6025a9383ffec 100644 --- a/src/wizard/javascript/remix/with-error-monitoring-performance-and-replay.md +++ b/src/wizard/javascript/remix/with-error-monitoring-performance-and-replay.md @@ -30,6 +30,8 @@ Sentry.init({ dsn: "___PUBLIC_DSN___", integrations: [ new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], routingInstrumentation: Sentry.remixRouterInstrumentation( useEffect, useLocation, @@ -41,8 +43,6 @@ Sentry.init({ // Performance Monitoring tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], // Session Replay replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production. replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur. diff --git a/src/wizard/javascript/svelte/with-error-monitoring-and-performance.md b/src/wizard/javascript/svelte/with-error-monitoring-and-performance.md index 06056346567c7..dad560d61095d 100644 --- a/src/wizard/javascript/svelte/with-error-monitoring-and-performance.md +++ b/src/wizard/javascript/svelte/with-error-monitoring-and-performance.md @@ -29,12 +29,15 @@ import * as Sentry from "@sentry/svelte"; Sentry.init({ dsn: "___PUBLIC_DSN___", - integrations: [new Sentry.BrowserTracing()], + integrations: [ + new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], + }), + ], // Performance Monitoring tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], }); const app = new App({ diff --git a/src/wizard/javascript/vue/index.md b/src/wizard/javascript/vue/index.md index 9d198264b95d3..f6bb35fd04766 100644 --- a/src/wizard/javascript/vue/index.md +++ b/src/wizard/javascript/vue/index.md @@ -42,6 +42,8 @@ Sentry.init({ dsn: "___PUBLIC_DSN___", integrations: [ new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], routingInstrumentation: Sentry.vueRouterInstrumentation(router), }), ], @@ -50,8 +52,6 @@ Sentry.init({ // of transactions for performance monitoring. // We recommend adjusting this value in production tracesSampleRate: 1.0, - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], }); app.use(router); @@ -76,6 +76,8 @@ Sentry.init({ dsn: "___PUBLIC_DSN___", integrations: [ new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], routingInstrumentation: Sentry.vueRouterInstrumentation(router), }), ], @@ -83,8 +85,6 @@ Sentry.init({ // of transactions for performance monitoring. // We recommend adjusting this value in production tracesSampleRate: 1.0, - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], }); // ... diff --git a/src/wizard/javascript/vue/with-error-monitoring-and-performance.md b/src/wizard/javascript/vue/with-error-monitoring-and-performance.md index 4d3035f81eb3c..2d555961dd140 100644 --- a/src/wizard/javascript/vue/with-error-monitoring-and-performance.md +++ b/src/wizard/javascript/vue/with-error-monitoring-and-performance.md @@ -40,14 +40,14 @@ Sentry.init({ dsn: "___PUBLIC_DSN___", integrations: [ new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], routingInstrumentation: Sentry.vueRouterInstrumentation(router), }), ], // Performance Monitoring tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], }); app.use(router); @@ -72,13 +72,13 @@ Sentry.init({ dsn: "___PUBLIC_DSN___", integrations: [ new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], routingInstrumentation: Sentry.vueRouterInstrumentation(router), }), ], // Performance Monitoring tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], }); // ... diff --git a/src/wizard/javascript/vue/with-error-monitoring-performance-and-replay.md b/src/wizard/javascript/vue/with-error-monitoring-performance-and-replay.md index a757abfa3fd33..6266533ea1f5c 100644 --- a/src/wizard/javascript/vue/with-error-monitoring-performance-and-replay.md +++ b/src/wizard/javascript/vue/with-error-monitoring-performance-and-replay.md @@ -75,14 +75,14 @@ Sentry.init({ dsn: "___PUBLIC_DSN___", integrations: [ new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], routingInstrumentation: Sentry.vueRouterInstrumentation(router), }), new Sentry.Replay(), ], // Performance Monitoring tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], // Session Replay replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production. replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur. diff --git a/src/wizard/javascript/with-error-monitoring-and-performance.md b/src/wizard/javascript/with-error-monitoring-and-performance.md index 9ce2a45cd57a5..00852d0ac1acb 100644 --- a/src/wizard/javascript/with-error-monitoring-and-performance.md +++ b/src/wizard/javascript/with-error-monitoring-and-performance.md @@ -25,13 +25,15 @@ import * as Sentry from "@sentry/browser"; Sentry.init({ dsn: "___PUBLIC_DSN___", - integrations: [new Sentry.BrowserTracing()], + integrations: [ + new Sentry.BrowserTracing({ + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], + }), + ], // Performance Monitoring tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production! - - // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], }); ```