Browse Source

feat: Update browser tracing integration usage (#64761)

This updates usage of browser tracing in our onboarding.

Couldn't try it yet as I failed to setup local env so far...
Francesco Novy 1 year ago
parent
commit
d66c885260

+ 6 - 8
static/app/gettingStartedDocs/ionic/ionic.tsx

@@ -23,14 +23,12 @@ Sentry.init(
     // We recommend adjusting this value in production.
     tracesSampleRate: 1.0,
     integrations: [
-      new SentrySibling.BrowserTracing({
-        // Set "tracePropagationTargets" to control for which URLs distributed tracing should be enabled
-        tracePropagationTargets: [
-          "localhost",
-          /^https:\/\/yourserver\.io\/api/,
-        ],
-        routingInstrumentation: SentrySibling.routingInstrumentation,
-      }),
+      SentrySibling.browserTracingIntegration(),
+    ],
+    // Set "tracePropagationTargets" to control for which URLs distributed tracing should be enabled
+    tracePropagationTargets: [
+      "localhost",
+      /^https:\/\/yourserver\.io\/api/,
     ],
   },
   // Forward the init method to the sibling Framework.

+ 4 - 5
static/app/gettingStartedDocs/javascript/angular.tsx

@@ -206,10 +206,7 @@ function getSdkSetupSnippet(params: Params) {
     integrations: [${
       params.isPerformanceSelected
         ? `
-          new Sentry.BrowserTracing({
-            // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
-            tracePropagationTargets: ["localhost", /^https:\\/\\/yourserver\\.io\\/api/],
-          }),`
+          Sentry.browserTracingIntegration(),`
         : ''
     }${
       params.isReplaySelected
@@ -221,7 +218,9 @@ function getSdkSetupSnippet(params: Params) {
     params.isPerformanceSelected
       ? `
         // Performance Monitoring
-        tracesSampleRate: 1.0, //  Capture 100% of the transactions`
+        tracesSampleRate: 1.0, //  Capture 100% of the transactions
+        // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
+        tracePropagationTargets: ["localhost", /^https:\\/\\/yourserver\\.io\\/api/],`
       : ''
   }${
     params.isReplaySelected

+ 3 - 9
static/app/gettingStartedDocs/javascript/ember.tsx

@@ -26,14 +26,6 @@ import * as Sentry from "@sentry/ember";
 Sentry.init({
   dsn: "${params.dsn}",
   integrations: [${
-    params.isPerformanceSelected
-      ? `
-        new Sentry.BrowserTracing({
-          // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
-          tracePropagationTargets: ["localhost", /^https:\\/\\/yourserver\\.io\\/api/],
-        }),`
-      : ''
-  }${
     params.isReplaySelected
       ? `
         Sentry.replayIntegration(${getReplayConfigOptions(params.replayOptions)}),`
@@ -43,7 +35,9 @@ Sentry.init({
   params.isPerformanceSelected
     ? `
       // Performance Monitoring
-      tracesSampleRate: 1.0, //  Capture 100% of the transactions`
+      tracesSampleRate: 1.0, //  Capture 100% of the transactions
+      // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
+      tracePropagationTargets: ["localhost", /^https:\\/\\/yourserver\\.io\\/api/],`
     : ''
 }${
   params.isReplaySelected

+ 4 - 5
static/app/gettingStartedDocs/javascript/gatsby.tsx

@@ -25,10 +25,7 @@ Sentry.init({
   integrations: [${
     params.isPerformanceSelected
       ? `
-        new Sentry.BrowserTracing({
-          // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
-          tracePropagationTargets: ["localhost", /^https:\\/\\/yourserver\\.io\\/api/],
-        }),`
+        Sentry.browserTracingIntegration(),`
       : ''
   }${
     params.isReplaySelected
@@ -40,7 +37,9 @@ Sentry.init({
   params.isPerformanceSelected
     ? `
       // Performance Monitoring
-      tracesSampleRate: 1.0, //  Capture 100% of the transactions`
+      tracesSampleRate: 1.0, //  Capture 100% of the transactions
+      // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
+      tracePropagationTargets: ["localhost", /^https:\\/\\/yourserver\\.io\\/api/],`
     : ''
 }${
   params.isReplaySelected

+ 4 - 5
static/app/gettingStartedDocs/javascript/javascript.tsx

@@ -24,10 +24,7 @@ Sentry.init({
   integrations: [${
     params.isPerformanceSelected
       ? `
-        new Sentry.BrowserTracing({
-          // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
-          tracePropagationTargets: ["localhost", /^https:\\/\\/yourserver\\.io\\/api/],
-        }),`
+        Sentry.browserTracingIntegration(),`
       : ''
   }${
     params.isReplaySelected
@@ -39,7 +36,9 @@ Sentry.init({
   params.isPerformanceSelected
     ? `
       // Performance Monitoring
-      tracesSampleRate: 1.0, //  Capture 100% of the transactions`
+      tracesSampleRate: 1.0, //  Capture 100% of the transactions
+      // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
+      tracePropagationTargets: ["localhost", /^https:\\/\\/yourserver\\.io\\/api/],`
     : ''
 }${
   params.isReplaySelected

+ 4 - 5
static/app/gettingStartedDocs/javascript/react.tsx

@@ -24,10 +24,7 @@ Sentry.init({
   integrations: [${
     params.isPerformanceSelected
       ? `
-        new Sentry.BrowserTracing({
-          // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
-          tracePropagationTargets: ["localhost", /^https:\\/\\/yourserver\\.io\\/api/],
-        }),`
+        Sentry.browserTracingIntegration(),`
       : ''
   }${
     params.isReplaySelected
@@ -39,7 +36,9 @@ Sentry.init({
   params.isPerformanceSelected
     ? `
       // Performance Monitoring
-      tracesSampleRate: 1.0, //  Capture 100% of the transactions`
+      tracesSampleRate: 1.0, //  Capture 100% of the transactions
+      // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
+      tracePropagationTargets: ["localhost", /^https:\\/\\/yourserver\\.io\\/api/],`
     : ''
 }${
   params.isReplaySelected

+ 4 - 5
static/app/gettingStartedDocs/javascript/svelte.tsx

@@ -26,10 +26,7 @@ Sentry.init({
   integrations: [${
     params.isPerformanceSelected
       ? `
-        new Sentry.BrowserTracing({
-          // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
-          tracePropagationTargets: ["localhost", /^https:\\/\\/yourserver\\.io\\/api/],
-        }),`
+        Sentry.browserTracingIntegration(),`
       : ''
   }${
     params.isReplaySelected
@@ -41,7 +38,9 @@ Sentry.init({
   params.isPerformanceSelected
     ? `
       // Performance Monitoring
-      tracesSampleRate: 1.0, //  Capture 100% of the transactions`
+      tracesSampleRate: 1.0, //  Capture 100% of the transactions
+      // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
+      tracePropagationTargets: ["localhost", /^https:\\/\\/yourserver\\.io\\/api/],`
     : ''
 }${
   params.isReplaySelected

+ 4 - 5
static/app/gettingStartedDocs/javascript/vue.tsx

@@ -47,10 +47,7 @@ const getSentryInitLayout = (params: Params, siblingOption: string): string => {
     integrations: [${
       params.isPerformanceSelected
         ? `
-          new Sentry.BrowserTracing({
-            // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
-            tracePropagationTargets: ["localhost", /^https:\\/\\/yourserver\\.io\\/api/],
-          }),`
+          Sentry.browserTracingIntergation(),`
         : ''
     }${
       params.isReplaySelected
@@ -62,7 +59,9 @@ const getSentryInitLayout = (params: Params, siblingOption: string): string => {
     params.isPerformanceSelected
       ? `
         // Performance Monitoring
-        tracesSampleRate: 1.0, //  Capture 100% of the transactions`
+        tracesSampleRate: 1.0, //  Capture 100% of the transactions
+        // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
+        tracePropagationTargets: ["localhost", /^https:\\/\\/yourserver\\.io\\/api/],`
       : ''
   }${
     params.isReplaySelected