Skip to content

Commit c989348

Browse files
authored
fix: Make sure tracePropagationTargets is top level everywhere (#7623)
1 parent 4c47212 commit c989348

File tree

16 files changed

+47
-74
lines changed

16 files changed

+47
-74
lines changed

src/docs/product/sentry-basics/integrate-frontend/initialize-sentry-sdk.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Sentry captures data by using a platform-specific SDK that you add to your appli
4949

5050
Sentry.init({
5151
dsn: "<your_DSN_key>",
52-
integrations: [new Sentry.BrowserTracing({}), new Sentry.Replay()],
52+
integrations: [new Sentry.BrowserTracing(), new Sentry.Replay()],
5353

5454
// Set tracesSampleRate to 1.0 to capture 100%
5555
// of transactions for performance monitoring.

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,12 @@ Sentry.init({
1212

1313
// This enables automatic instrumentation (highly recommended), but is not
1414
// necessary for purely manual usage
15-
integrations: [
16-
new Sentry.BrowserTracing({
17-
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
18-
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
19-
}),
20-
],
15+
integrations: [new Sentry.BrowserTracing()],
2116

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

src/platform-includes/performance/enable-automatic-instrumentation/javascript.electron.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,7 @@ Sentry.init({
1616
// We recommend adjusting this value in production, or using tracesSampler
1717
// for finer control
1818
tracesSampleRate: 1.0,
19+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
20+
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
1921
});
2022
```

src/platforms/javascript/common/performance/instrumentation/automatic-instrumentation.mdx

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,15 @@ import * as Sentry from "@sentry/nextjs";
3838
Sentry.init({
3939
dsn: "___PUBLIC_DSN___",
4040

41-
integrations: [
42-
new Sentry.BrowserTracing({
43-
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
44-
tracePropagationTargets: [
45-
"localhost",
46-
/^\//,
47-
/^https:\/\/yourserver\.io\/api/,
48-
],
49-
// Add additional custom options here
50-
}),
51-
],
41+
integrations: [new Sentry.BrowserTracing()],
5242

5343
tracesSampleRate: 1.0,
44+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
45+
tracePropagationTargets: [
46+
"localhost",
47+
/^\//,
48+
/^https:\/\/yourserver\.io\/api/,
49+
],
5450
});
5551
```
5652

src/platforms/javascript/common/profiling/index.mdx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,15 @@ Sentry.init({
5959
integrations: [
6060
// Add browser profiling integration to the list of integrations
6161
new Sentry.BrowserProfilingIntegration(),
62-
new Sentry.BrowserTracing({
63-
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
64-
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
65-
}),
62+
new Sentry.BrowserTracing(),
6663
],
6764

6865
// Set tracesSampleRate to 1.0 to capture 100%
6966
// of transactions for performance monitoring.
7067
// We recommend adjusting this value in production
7168
tracesSampleRate: 1.0,
69+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
70+
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
7271

7372
// Set profilesSampleRate to 1.0 to profile every transaction.
7473
// Since profilesSampleRate is relative to tracesSampleRate,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ Sentry.init({
5757
dsn: "___PUBLIC_DSN___",
5858
integrations: [
5959
new Sentry.BrowserTracing({
60-
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
61-
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
6260
routingInstrumentation: Sentry.routingInstrumentation,
6361
}),
6462
],
6563
// Performance Monitoring
6664
tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!
65+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
66+
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
6767
});
6868

6969
enableProdMode();

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,11 @@ import * as Sentry from "@sentry/gatsby";
5353

5454
Sentry.init({
5555
dsn: "___PUBLIC_DSN___",
56-
integrations: [
57-
new Sentry.BrowserTracing({
58-
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
59-
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
60-
}),
61-
],
56+
integrations: [new Sentry.BrowserTracing()],
6257
// Performance Monitoring
6358
tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!
59+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
60+
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
6461
});
6562
```
6663

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,14 @@ import * as Sentry from "@sentry/browser";
1616

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

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

src/wizard/javascript/profiling-onboarding/javascript/3.configure.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,15 @@ Sentry.init({
1717
integrations: [
1818
// Add browser profiling integration to the list of integrations
1919
new Sentry.BrowserProfilingIntegration(),
20-
new Sentry.BrowserTracing({
21-
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
22-
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
23-
}),
20+
new Sentry.BrowserTracing(),
2421
],
2522

2623
// Set tracesSampleRate to 1.0 to capture 100%
2724
// of transactions for performance monitoring.
2825
// We recommend adjusting this value in production
2926
tracesSampleRate: 1.0,
27+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
28+
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
3029

3130
// Set profilesSampleRate to 1.0 to profile every transaction.
3231
// Since profilesSampleRate is relative to tracesSampleRate,

src/wizard/javascript/profiling-onboarding/react/3.configure.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,15 @@ Sentry.init({
1717
integrations: [
1818
// Add browser profiling integration to the list of integrations
1919
new Sentry.BrowserProfilingIntegration(),
20-
new Sentry.BrowserTracing({
21-
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
22-
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
23-
}),
20+
new Sentry.BrowserTracing(),
2421
],
2522

2623
// Set tracesSampleRate to 1.0 to capture 100%
2724
// of transactions for performance monitoring.
2825
// We recommend adjusting this value in production
2926
tracesSampleRate: 1.0,
27+
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
28+
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
3029

3130
// Set profilesSampleRate to 1.0 to profile every transaction.
3231
// Since profilesSampleRate is relative to tracesSampleRate,

0 commit comments

Comments
 (0)