Skip to content

fix: move tracePropagationTargets to BrowserTracing options #7449

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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/.*",
],
}),
],
});
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/.*",
],
}),
],
});
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/.*",
],
}),
],
});
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/.*",
],
}),
],
});
```
Expand Down
Original file line number Diff line number Diff line change
@@ -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/.*",
],
}),
],
});
```
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
}),
],
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}),
Expand Down
11 changes: 7 additions & 4 deletions src/platform-includes/getting-started-config/javascript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 4 additions & 6 deletions src/platform-includes/getting-started-config/javascript.vue.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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,
Expand Down Expand Up @@ -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(),
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/],
});
```
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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/],
});
```
Original file line number Diff line number Diff line change
Expand Up @@ -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/],
});
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/],
}),
],
});
```
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
}),
],
Expand Down
8 changes: 4 additions & 4 deletions src/platforms/javascript/common/install/loader.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -186,17 +186,17 @@ 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(),
],

// 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/],
});
```

Expand Down
5 changes: 2 additions & 3 deletions src/wizard/javascript/angular/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}),
],
Expand All @@ -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();
Expand Down
Loading