Skip to content

Commit 3defbac

Browse files
committed
feat: Update JS docs to use top level tracePropagationTargets
1 parent 2008a78 commit 3defbac

26 files changed

+106
-112
lines changed

src/platform-includes/getting-started-config/javascript.angular.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ Sentry.init({
1313
// which automatically instruments your application to monitor its
1414
// performance, including custom Angular routing instrumentation
1515
new Sentry.BrowserTracing({
16-
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
17-
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
1816
routingInstrumentation: Sentry.routingInstrumentation,
1917
}),
2018
// Registers the Replay integration,
@@ -27,6 +25,9 @@ Sentry.init({
2725
// We recommend adjusting this value in production
2826
tracesSampleRate: 1.0,
2927
28+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
29+
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
30+
3031
// Capture Replay for 10% of all sessions,
3132
// plus for 100% of sessions with an error
3233
replaysSessionSampleRate: 0.1,
@@ -52,8 +53,6 @@ Sentry.init({
5253
// which automatically instruments your application to monitor its
5354
// performance, including custom Angular routing instrumentation
5455
new Sentry.BrowserTracing({
55-
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
56-
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
5756
routingInstrumentation: Sentry.routingInstrumentation,
5857
}),
5958
],
@@ -62,6 +61,9 @@ Sentry.init({
6261
// of transactions for performance monitoring.
6362
// We recommend adjusting this value in production
6463
tracesSampleRate: 1.0,
64+
65+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
66+
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
6567
});
6668
6769
platformBrowserDynamic()

src/platform-includes/getting-started-config/javascript.mdx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,16 @@ Sentry.init({
99
// Alternatively, use `process.env.npm_package_version` for a dynamic release version
1010
// if your build tool supports it.
1111
release: "[email protected]",
12-
integrations: [
13-
new Sentry.BrowserTracing({
14-
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
15-
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
16-
}),
17-
new Sentry.Replay(),
18-
],
12+
integrations: [new Sentry.BrowserTracing(), new Sentry.Replay()],
1913

2014
// Set tracesSampleRate to 1.0 to capture 100%
2115
// of transactions for performance monitoring.
2216
// We recommend adjusting this value in production
2317
tracesSampleRate: 1.0,
2418

19+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
20+
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
21+
2522
// Capture Replay for 10% of all sessions,
2623
// plus for 100% of sessions with an error
2724
replaysSessionSampleRate: 0.1,

src/platform-includes/getting-started-config/javascript.react.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ Sentry.init({
99
dsn: "___PUBLIC_DSN___",
1010
integrations: [
1111
new Sentry.BrowserTracing({
12-
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
13-
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
1412
// See docs for support of different versions of variation of react router
1513
// https://docs.sentry.io/platforms/javascript/guides/react/configuration/integrations/react-router/
1614
routingInstrumentation: Sentry.reactRouterV6Instrumentation(
@@ -28,6 +26,9 @@ Sentry.init({
2826
// of transactions for performance monitoring.
2927
tracesSampleRate: 1.0,
3028

29+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
30+
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
31+
3132
// Capture Replay for 10% of all sessions,
3233
// plus for 100% of sessions with an error
3334
replaysSessionSampleRate: 0.1,

src/platform-includes/getting-started-config/javascript.remix.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ Sentry.init({
1313
dsn: "___DSN___",
1414
integrations: [
1515
new Sentry.BrowserTracing({
16-
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
17-
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
1816
routingInstrumentation: Sentry.remixRouterInstrumentation(
1917
useEffect,
2018
useLocation,
@@ -30,6 +28,9 @@ Sentry.init({
3028
// We recommend adjusting this value in production
3129
tracesSampleRate: 1.0,
3230

31+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
32+
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
33+
3334
// Capture Replay for 10% of all sessions,
3435
// plus for 100% of sessions with an error
3536
replaysSessionSampleRate: 0.1,

src/platform-includes/getting-started-config/javascript.svelte.mdx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,16 @@ import * as Sentry from "@sentry/svelte";
99
// Initialize the Sentry SDK here
1010
Sentry.init({
1111
dsn: "___PUBLIC_DSN___",
12-
integrations: [
13-
new Sentry.BrowserTracing({
14-
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
15-
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
16-
}),
17-
new Sentry.Replay(),
18-
],
12+
integrations: [new Sentry.BrowserTracing(), new Sentry.Replay()],
1913

2014
// Set tracesSampleRate to 1.0 to capture 100%
2115
// of transactions for performance monitoring.
2216
// We recommend adjusting this value in production
2317
tracesSampleRate: 1.0,
2418

19+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
20+
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
21+
2522
// Capture Replay for 10% of all sessions,
2623
// plus for 100% of sessions with an error
2724
replaysSessionSampleRate: 0.1,

src/platform-includes/getting-started-config/javascript.vue.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ Sentry.init({
1919
dsn: "___PUBLIC_DSN___",
2020
integrations: [
2121
new Sentry.BrowserTracing({
22-
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
23-
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
2422
routingInstrumentation: Sentry.vueRouterInstrumentation(router),
2523
}),
2624
new Sentry.Replay(),
@@ -31,6 +29,9 @@ Sentry.init({
3129
// We recommend adjusting this value in production
3230
tracesSampleRate: 1.0,
3331

32+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
33+
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
34+
3435
// Capture Replay for 10% of all sessions,
3536
// plus for 100% of sessions with an error
3637
replaysSessionSampleRate: 0.1,
@@ -59,8 +60,6 @@ Sentry.init({
5960
dsn: "___PUBLIC_DSN___",
6061
integrations: [
6162
new Sentry.BrowserTracing({
62-
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
63-
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
6463
routingInstrumentation: Sentry.vueRouterInstrumentation(router),
6564
}),
6665
new Sentry.Replay(),
@@ -71,6 +70,9 @@ Sentry.init({
7170
// We recommend adjusting this value in production
7271
tracesSampleRate: 1.0,
7372

73+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
74+
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
75+
7476
// Capture Replay for 10% of all sessions,
7577
// plus for 100% of sessions with an error
7678
replaysSessionSampleRate: 0.1,

src/platform-includes/performance/configure-sample-rate/javascript.mdx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@ Sentry.init({
1111
// If you only want to use custom instrumentation:
1212
// * Remove the `BrowserTracing` integration
1313
// * add `Sentry.addTracingExtensions()` above your Sentry.init() call
14-
integrations: [
15-
new Sentry.BrowserTracing({
16-
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
17-
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
18-
}),
19-
],
14+
integrations: [new Sentry.BrowserTracing()],
2015

2116
// We recommend adjusting this value in production, or using tracesSampler
2217
// for finer control
2318
tracesSampleRate: 1.0,
19+
20+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
21+
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
2422
});
2523
```

src/platform-includes/performance/configure-sample-rate/javascript.react.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ Sentry.init({
1111
// * add `Sentry.addTracingExtensions()` above your Sentry.init() call
1212
integrations: [
1313
new Sentry.BrowserTracing({
14-
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
15-
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
1614
// See docs for support of different versions of variation of react router
1715
// https://docs.sentry.io/platforms/javascript/guides/react/configuration/integrations/react-router/
1816
routingInstrumentation: Sentry.reactRouterV6Instrumentation(
@@ -28,5 +26,8 @@ Sentry.init({
2826
// For finer control of sent transactions you can adjust this value, or
2927
// use tracesSampler
3028
tracesSampleRate: 1.0,
29+
30+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
31+
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
3132
});
3233
```

src/platform-includes/performance/tracePropagationTargets-example/javascript.mdx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ For example:
1010
```javascript
1111
Sentry.init({
1212
// ...
13-
integrations: [
14-
new Sentry.BrowserTracing({
15-
tracePropagationTargets: ["localhost", /^https:\/\/api\.example\.com/],
16-
}),
17-
],
13+
integrations: [new Sentry.BrowserTracing()],
14+
15+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
16+
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
1817
});
1918
```

src/platforms/javascript/common/install/loader.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,17 +186,17 @@ Sentry.init({
186186
release: "my-project-name@" + process.env.npm_package_version,
187187
integrations: [
188188
// If you use a bundle with performance monitoring enabled, add the BrowserTracing integration
189-
new Sentry.BrowserTracing({
190-
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
191-
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
192-
}),
189+
new Sentry.BrowserTracing(),
193190
// If you use a bundle with session replay enabled, add the SessionReplay integration
194191
new Sentry.Replay(),
195192
],
196193

197194
// We recommend adjusting this value in production, or using tracesSampler
198195
// for finer control
199196
tracesSampleRate: 1.0,
197+
198+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
199+
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
200200
});
201201
```
202202

src/wizard/javascript/angular/index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ Sentry.init({
3838
dsn: "___PUBLIC_DSN___",
3939
integrations: [
4040
new Sentry.BrowserTracing({
41-
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
42-
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
4341
routingInstrumentation: Sentry.routingInstrumentation,
4442
}),
4543
],
@@ -48,6 +46,9 @@ Sentry.init({
4846
// of transactions for performance monitoring.
4947
// We recommend adjusting this value in production
5048
tracesSampleRate: 1.0,
49+
50+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
51+
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
5152
});
5253

5354
enableProdMode();

src/wizard/javascript/angular/with-error-monitoring-performance-and-replay.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,16 @@ Sentry.init({
4242
dsn: "___PUBLIC_DSN___",
4343
integrations: [
4444
new Sentry.BrowserTracing({
45-
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
46-
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
4745
routingInstrumentation: Sentry.routingInstrumentation,
4846
}),
4947
new Sentry.Replay(),
5048
],
49+
5150
// Performance Monitoring
5251
tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!
52+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
53+
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
54+
5355
// Session Replay
5456
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.
5557
replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.

src/wizard/javascript/gatsby/with-error-monitoring-performance-and-replay.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,13 @@ import * as Sentry from "@sentry/gatsby";
3838

3939
Sentry.init({
4040
dsn: "___PUBLIC_DSN___",
41-
integrations: [
42-
new Sentry.BrowserTracing({
43-
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
44-
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
45-
}),
46-
new Sentry.Replay(),
47-
],
41+
integrations: [new Sentry.BrowserTracing(), new Sentry.Replay()],
42+
4843
// Performance Monitoring
4944
tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!
45+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
46+
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
47+
5048
// Session Replay
5149
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.
5250
replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.

src/wizard/javascript/index.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,15 @@ import * as Sentry from "@sentry/browser";
2323

2424
Sentry.init({
2525
dsn: "___PUBLIC_DSN___",
26-
integrations: [
27-
new Sentry.BrowserTracing({
28-
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
29-
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
30-
}),
31-
],
26+
integrations: [new Sentry.BrowserTracing()],
3227

3328
// Set tracesSampleRate to 1.0 to capture 100%
3429
// of transactions for performance monitoring.
3530
// We recommend adjusting this value in production
3631
tracesSampleRate: 1.0,
32+
33+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
34+
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
3735
});
3836
```
3937

src/wizard/javascript/nextjs/with-error-monitoring-and-performance.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,12 @@ npm install --save @sentry/nextjs
3636
```javascript
3737
Sentry.init({
3838
dsn: "___PUBLIC_DSN___",
39-
integrations: [
40-
new Sentry.BrowserTracing({
41-
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
42-
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
43-
}),
44-
],
39+
integrations: [new Sentry.BrowserTracing()],
40+
4541
// Performance Monitoring
4642
tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!
43+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
44+
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
4745
});
4846
```
4947

src/wizard/javascript/nextjs/with-error-monitoring-performance-and-replay.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,13 @@ npm install --save @sentry/nextjs
3636
```javascript
3737
Sentry.init({
3838
dsn: "___PUBLIC_DSN___",
39-
integrations: [
40-
new Sentry.BrowserTracing({
41-
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
42-
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
43-
}),
44-
new Sentry.Replay(),
45-
],
39+
integrations: [new Sentry.BrowserTracing(), new Sentry.Replay()],
40+
4641
// Performance Monitoring
4742
tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!
43+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
44+
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
45+
4846
// Session Replay
4947
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.
5048
replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.

src/wizard/javascript/performance-onboarding/react/2.configure.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,14 @@ import App from "./App";
1717

1818
Sentry.init({
1919
dsn: "___PUBLIC_DSN___",
20-
integrations: [
21-
new Sentry.BrowserTracing({
22-
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
23-
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
24-
}),
25-
],
20+
integrations: [new Sentry.BrowserTracing()],
2621

2722
// Set tracesSampleRate to 1.0 to capture 100%
2823
// of transactions for performance monitoring.
2924
// We recommend adjusting this value in production
3025
tracesSampleRate: 1.0,
26+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
27+
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
3128
});
3229

3330
ReactDOM.render(<App />, document.getElementById("root"));

src/wizard/javascript/react/with-error-monitoring-and-performance.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ import App from "./App";
3030
Sentry.init({
3131
dsn: "___PUBLIC_DSN___",
3232
integrations: [
33-
new Sentry.BrowserTracing({
34-
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
35-
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
36-
}),
33+
new Sentry.BrowserTracing(),
3734
],
35+
3836
// Performance Monitoring
3937
tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!
38+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
39+
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
4040
});
4141

4242
const container = document.getElementById(“app”);

0 commit comments

Comments
 (0)