Skip to content

Commit

Permalink
feat: Update JS docs to use top level tracePropagationTargets
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhiPrasad committed Jul 10, 2023
1 parent a136c61 commit 578b7b1
Show file tree
Hide file tree
Showing 26 changed files with 104 additions and 112 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ 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 @@ -27,6 +25,9 @@ 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 @@ -52,8 +53,6 @@ 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 @@ -62,6 +61,9 @@ 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
11 changes: 4 additions & 7 deletions src/platform-includes/getting-started-config/javascript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,16 @@ Sentry.init({
// Alternatively, use `process.env.npm_package_version` for a dynamic release version
// if your build tool supports it.
release: "[email protected]",
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(),
],
integrations: [new Sentry.BrowserTracing(), 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,8 +9,6 @@ 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 @@ -28,6 +26,9 @@ 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,8 +13,6 @@ 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 @@ -30,6 +28,9 @@ 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,19 +9,16 @@ import * as Sentry from "@sentry/svelte";
// Initialize the Sentry SDK here
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/],
}),
new Sentry.Replay(),
],
integrations: [new Sentry.BrowserTracing(), 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: 6 additions & 4 deletions src/platform-includes/getting-started-config/javascript.vue.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ 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 @@ -31,6 +29,9 @@ 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 @@ -59,8 +60,6 @@ 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 @@ -71,6 +70,9 @@ 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,15 +11,13 @@ 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({
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
}),
],
integrations: [new Sentry.BrowserTracing()],

// 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,8 +11,6 @@ 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 @@ -28,5 +26,8 @@ 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 @@ -10,10 +10,9 @@ For example:
```javascript
Sentry.init({
// ...
integrations: [
new Sentry.BrowserTracing({
tracePropagationTargets: ["localhost", /^https:\/\/api\.example\.com/],
}),
],
integrations: [new Sentry.BrowserTracing()],

// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
});
```
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({
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
}),
new Sentry.BrowserTracing(),
// 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: 3 additions & 2 deletions src/wizard/javascript/angular/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ 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 @@ -48,6 +46,9 @@ 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
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,16 @@ 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(),
],

// 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,13 @@ import * as Sentry from "@sentry/gatsby";

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/],
}),
new Sentry.Replay(),
],
integrations: [new Sentry.BrowserTracing(), 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.
Expand Down
10 changes: 4 additions & 6 deletions src/wizard/javascript/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,15 @@ import * as Sentry from "@sentry/browser";

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/],
}),
],
integrations: [new Sentry.BrowserTracing()],

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,12 @@ npm install --save @sentry/nextjs
```javascript
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/],
}),
],
integrations: [new Sentry.BrowserTracing()],

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,13 @@ npm install --save @sentry/nextjs
```javascript
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/],
}),
new Sentry.Replay(),
],
integrations: [new Sentry.BrowserTracing(), 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,14 @@ import App from "./App";

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/],
}),
],
integrations: [new Sentry.BrowserTracing()],

// 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(<App />, document.getElementById("root"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ import App from "./App";
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/],
}),
new Sentry.BrowserTracing(),
],

// 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”);
Expand Down
Loading

0 comments on commit 578b7b1

Please sign in to comment.