From 13121a5ef917b36dfdcdb4d81e6ad1f4e9ecf66e Mon Sep 17 00:00:00 2001 From: Alex Krawiec Date: Mon, 18 Nov 2024 14:51:04 -0800 Subject: [PATCH 1/2] Add include explaining sample code options --- .../integrate-frontend/initialize-sentry-sdk.mdx | 5 ++++- .../platforms/configuration/options/js-config-options.mdx | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 includes/platforms/configuration/options/js-config-options.mdx diff --git a/docs/product/sentry-basics/integrate-frontend/initialize-sentry-sdk.mdx b/docs/product/sentry-basics/integrate-frontend/initialize-sentry-sdk.mdx index cb8ee2a8c0bac..60fee54644bb7 100644 --- a/docs/product/sentry-basics/integrate-frontend/initialize-sentry-sdk.mdx +++ b/docs/product/sentry-basics/integrate-frontend/initialize-sentry-sdk.mdx @@ -67,7 +67,10 @@ Sentry captures data by using a platform-specific SDK that you add to your appli }); ``` - It's important to import and initialize the SDK as early as possible in your application's lifecycle so Sentry can capture errors throughout the lifecycle. + It's important to import and initialize the SDK as early as possible in your application's lifecycle so Sentry can capture errors throughout the lifecycle. + + + 1. Add your DSN key to the Sentry SDK configuration. diff --git a/includes/platforms/configuration/options/js-config-options.mdx b/includes/platforms/configuration/options/js-config-options.mdx new file mode 100644 index 0000000000000..dc0ac0366fc78 --- /dev/null +++ b/includes/platforms/configuration/options/js-config-options.mdx @@ -0,0 +1 @@ +Learn more about the [tracesSampleRate](/platforms/javascript/configuration/options/#traces-sample-rate), [replaysSessionSampleRate](/platforms/javascript/session-replay/configuration/#general-integration-configuration), and [replaysOnErrorSampleRate](/platforms/javascript/session-replay/configuration/#general-integration-configuration). From ae3782fdb1115858812240b87418d4d18b69b3da Mon Sep 17 00:00:00 2001 From: Alex Krawiec Date: Fri, 22 Nov 2024 15:17:59 -0800 Subject: [PATCH 2/2] Add links to JS snippets for tracesSampleRate & replaySessionSampleRate --- .../integrations/unhandledrejection.mdx | 2 ++ .../guides/aws-lambda/install/cjs-layer.mdx | 2 ++ .../guides/aws-lambda/install/cjs-npm.mdx | 2 ++ .../guides/aws-lambda/install/esm-npm.mdx | 2 ++ .../guides/cloudflare/frameworks/astro.mdx | 2 ++ .../platforms/javascript/guides/gatsby/index.mdx | 4 ++++ .../javascript/guides/gcp-functions/index.mdx | 2 ++ .../javascript/guides/nextjs/manual-setup.mdx | 8 ++++++++ .../javascript/guides/remix/manual-setup.mdx | 6 ++++++ docs/platforms/react-native/index.mdx | 2 ++ .../platforms/react-native/manual-setup/expo.mdx | 2 ++ docs/platforms/react-native/profiling/index.mdx | 4 ++++ .../instrumentation/custom-navigation.mdx | 2 ++ .../tracing/instrumentation/expo-router.mdx | 2 ++ .../integrate-frontend/initialize-sentry-sdk.mdx | 5 +++++ .../javascript.angular.mdx | 8 ++++++++ .../javascript.aws-lambda.mdx | 4 ++++ .../javascript.azure-functions.mdx | 2 ++ .../getting-started-config/javascript.bun.mdx | 2 ++ .../javascript.capacitor.mdx | 16 ++++++++++++++++ .../javascript.cloudflare.mdx | 4 ++++ .../getting-started-config/javascript.deno.mdx | 4 ++++ .../javascript.electron.mdx | 4 ++++ .../getting-started-config/javascript.ember.mdx | 6 +++++- .../javascript.gcp-functions.mdx | 6 ++++++ .../getting-started-config/javascript.mdx | 13 ++++++++++++- .../getting-started-config/javascript.react.mdx | 4 ++++ .../getting-started-config/javascript.solid.mdx | 4 ++++ .../getting-started-config/javascript.svelte.mdx | 4 ++++ .../getting-started-config/javascript.vue.mdx | 8 ++++++++ .../javascript.express__v7.x.mdx | 10 ++++++---- 31 files changed, 140 insertions(+), 6 deletions(-) diff --git a/docs/platforms/javascript/common/configuration/integrations/unhandledrejection.mdx b/docs/platforms/javascript/common/configuration/integrations/unhandledrejection.mdx index 473e0d223a13e..1fe5cd5b3c48a 100644 --- a/docs/platforms/javascript/common/configuration/integrations/unhandledrejection.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/unhandledrejection.mdx @@ -63,6 +63,8 @@ Sentry.init({ // Add Tracing by setting tracesSampleRate and adding integration // Set tracesSampleRate to 1.0 to capture 100% of transactions // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, }); diff --git a/docs/platforms/javascript/guides/aws-lambda/install/cjs-layer.mdx b/docs/platforms/javascript/guides/aws-lambda/install/cjs-layer.mdx index 7733d751b1eb5..fc10999fa1b80 100644 --- a/docs/platforms/javascript/guides/aws-lambda/install/cjs-layer.mdx +++ b/docs/platforms/javascript/guides/aws-lambda/install/cjs-layer.mdx @@ -75,6 +75,8 @@ Sentry.init({ // Add Tracing by setting tracesSampleRate and adding integration // Set tracesSampleRate to 1.0 to capture 100% of transactions // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, }); diff --git a/docs/platforms/javascript/guides/aws-lambda/install/cjs-npm.mdx b/docs/platforms/javascript/guides/aws-lambda/install/cjs-npm.mdx index 81e5e8466a895..cc2f9d0c601d1 100644 --- a/docs/platforms/javascript/guides/aws-lambda/install/cjs-npm.mdx +++ b/docs/platforms/javascript/guides/aws-lambda/install/cjs-npm.mdx @@ -72,6 +72,8 @@ Sentry.init({ // Add Tracing by setting tracesSampleRate and adding integration // Set tracesSampleRate to 1.0 to capture 100% of transactions // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // Set sampling rate for profiling - this is relative to tracesSampleRate profilesSampleRate: 1.0, diff --git a/docs/platforms/javascript/guides/aws-lambda/install/esm-npm.mdx b/docs/platforms/javascript/guides/aws-lambda/install/esm-npm.mdx index 2ff9f89052225..015b716e8bc12 100644 --- a/docs/platforms/javascript/guides/aws-lambda/install/esm-npm.mdx +++ b/docs/platforms/javascript/guides/aws-lambda/install/esm-npm.mdx @@ -117,6 +117,8 @@ Sentry.init({ // Add Tracing by setting tracesSampleRate and adding integration // Set tracesSampleRate to 1.0 to capture 100% of transactions // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // Set sampling rate for profiling - this is relative to tracesSampleRate profilesSampleRate: 1.0, diff --git a/docs/platforms/javascript/guides/cloudflare/frameworks/astro.mdx b/docs/platforms/javascript/guides/cloudflare/frameworks/astro.mdx index 40adf850a3da5..9d225208f0cb1 100644 --- a/docs/platforms/javascript/guides/cloudflare/frameworks/astro.mdx +++ b/docs/platforms/javascript/guides/cloudflare/frameworks/astro.mdx @@ -29,6 +29,8 @@ export const onRequest = [ Sentry.sentryPagesPlugin((context) => ({ dsn: "___PUBLIC_DSN___", // Set tracesSampleRate to 1.0 to capture 100% of spans for tracing. + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, })), // Add more middlewares here diff --git a/docs/platforms/javascript/guides/gatsby/index.mdx b/docs/platforms/javascript/guides/gatsby/index.mdx index c973dd172822b..4931c024b28e1 100644 --- a/docs/platforms/javascript/guides/gatsby/index.mdx +++ b/docs/platforms/javascript/guides/gatsby/index.mdx @@ -69,10 +69,14 @@ Sentry.init({ // Set tracesSampleRate to 1.0 to capture 100% // of transactions for tracing. // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // Capture Replay for 10% of all sessions, // plus for 100% of sessions with an error + // Learn more at + // https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, }); diff --git a/docs/platforms/javascript/guides/gcp-functions/index.mdx b/docs/platforms/javascript/guides/gcp-functions/index.mdx index 0df77e7f3e09e..e8f9615ed407c 100644 --- a/docs/platforms/javascript/guides/gcp-functions/index.mdx +++ b/docs/platforms/javascript/guides/gcp-functions/index.mdx @@ -41,6 +41,8 @@ Sentry.init({ // Add Tracing by setting tracesSampleRate and adding integration // Set tracesSampleRate to 1.0 to capture 100% of transactions // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, }); diff --git a/docs/platforms/javascript/guides/nextjs/manual-setup.mdx b/docs/platforms/javascript/guides/nextjs/manual-setup.mdx index 8ef87fae8629d..c18a5edeee250 100644 --- a/docs/platforms/javascript/guides/nextjs/manual-setup.mdx +++ b/docs/platforms/javascript/guides/nextjs/manual-setup.mdx @@ -91,10 +91,14 @@ Sentry.init({ // Set tracesSampleRate to 1.0 to capture 100% // of transactions for tracing. // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // Capture Replay for 10% of all sessions, // plus for 100% of sessions with an error + // Learn more at + // https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, @@ -115,6 +119,8 @@ Sentry.init({ // Set tracesSampleRate to 1.0 to capture 100% // of transactions for tracing. // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // ... @@ -134,6 +140,8 @@ Sentry.init({ // Set tracesSampleRate to 1.0 to capture 100% // of transactions for tracing. // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // ... diff --git a/docs/platforms/javascript/guides/remix/manual-setup.mdx b/docs/platforms/javascript/guides/remix/manual-setup.mdx index ba46cef1c9831..9f1eb67abe15a 100644 --- a/docs/platforms/javascript/guides/remix/manual-setup.mdx +++ b/docs/platforms/javascript/guides/remix/manual-setup.mdx @@ -59,6 +59,8 @@ Sentry.init({ // Set tracesSampleRate to 1.0 to capture 100% // of transactions for tracing. // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled @@ -66,6 +68,8 @@ Sentry.init({ // Capture Replay for 10% of all sessions, // plus for 100% of sessions with an error + // Learn more at + // https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, }); @@ -161,6 +165,8 @@ Sentry.init({ // Set tracesSampleRate to 1.0 to capture 100% // of transactions for tracing. // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // To use Sentry OpenTelemetry auto-instrumentation diff --git a/docs/platforms/react-native/index.mdx b/docs/platforms/react-native/index.mdx index e152b4e6d6a6a..c31ec231b2266 100644 --- a/docs/platforms/react-native/index.mdx +++ b/docs/platforms/react-native/index.mdx @@ -72,6 +72,8 @@ Sentry.init({ dsn: "___PUBLIC_DSN___", // Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing. // We recommend adjusting this value in production. + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // profilesSampleRate is relative to tracesSampleRate. // Here, we'll capture profiles for 100% of transactions. diff --git a/docs/platforms/react-native/manual-setup/expo.mdx b/docs/platforms/react-native/manual-setup/expo.mdx index 5d7e51872ac32..f87ca5b5f2422 100644 --- a/docs/platforms/react-native/manual-setup/expo.mdx +++ b/docs/platforms/react-native/manual-setup/expo.mdx @@ -68,6 +68,8 @@ Sentry.init({ // Set tracesSampleRate to 1.0 to capture 100% // of transactions for tracing. // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, }); diff --git a/docs/platforms/react-native/profiling/index.mdx b/docs/platforms/react-native/profiling/index.mdx index 4044bc6476ba2..b1c73ac0d207b 100644 --- a/docs/platforms/react-native/profiling/index.mdx +++ b/docs/platforms/react-native/profiling/index.mdx @@ -15,6 +15,8 @@ Sentry.init({ dsn: "___DSN___", // Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing. // We recommend adjusting this value in production. + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, }); ``` @@ -36,6 +38,8 @@ Sentry.init({ dsn: "___DSN___", // Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing. // We recommend adjusting this value in production. + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // profilesSampleRate is relative to tracesSampleRate. // Here, we'll capture profiles for 100% of transactions. diff --git a/docs/platforms/react-native/tracing/instrumentation/custom-navigation.mdx b/docs/platforms/react-native/tracing/instrumentation/custom-navigation.mdx index 0bd8bea2ce524..9baf9c68ce6a3 100644 --- a/docs/platforms/react-native/tracing/instrumentation/custom-navigation.mdx +++ b/docs/platforms/react-native/tracing/instrumentation/custom-navigation.mdx @@ -28,6 +28,8 @@ Sentry.init({ dsn: '___PUBLIC_DSN___', // Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing. // We recommend adjusting this value in production. + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, integrations: [customNavigationIntegration({navigator})], }); diff --git a/docs/platforms/react-native/tracing/instrumentation/expo-router.mdx b/docs/platforms/react-native/tracing/instrumentation/expo-router.mdx index dac7efe69c2d9..36c60a2aed131 100644 --- a/docs/platforms/react-native/tracing/instrumentation/expo-router.mdx +++ b/docs/platforms/react-native/tracing/instrumentation/expo-router.mdx @@ -24,6 +24,8 @@ Sentry.init({ dsn: '___PUBLIC_DSN___', // Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing. // We recommend adjusting this value in production. + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, integrations: [navigationIntegration], enableNativeFramesTracking: Constants.executionEnvironment === ExecutionEnvironment.StoreClient, // Only in native builds, not in Expo Go. diff --git a/docs/product/sentry-basics/integrate-frontend/initialize-sentry-sdk.mdx b/docs/product/sentry-basics/integrate-frontend/initialize-sentry-sdk.mdx index 60fee54644bb7..b8b2226f4190e 100644 --- a/docs/product/sentry-basics/integrate-frontend/initialize-sentry-sdk.mdx +++ b/docs/product/sentry-basics/integrate-frontend/initialize-sentry-sdk.mdx @@ -58,12 +58,17 @@ Sentry captures data by using a platform-specific SDK that you add to your appli // Set tracesSampleRate to 1.0 to capture 100% // of transactions for performance monitoring. + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // Capture Replay for 10% of all sessions, // plus for 100% of sessions with an error + // Learn more at + // https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, + ${} }); ``` diff --git a/platform-includes/getting-started-config/javascript.angular.mdx b/platform-includes/getting-started-config/javascript.angular.mdx index 2c3d155ac4e22..e84a7a08e12ae 100644 --- a/platform-includes/getting-started-config/javascript.angular.mdx +++ b/platform-includes/getting-started-config/javascript.angular.mdx @@ -22,6 +22,8 @@ Sentry.init({ // Set tracesSampleRate to 1.0 to capture 100% // of transactions for tracing. // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled @@ -29,6 +31,8 @@ Sentry.init({ // Capture Replay for 10% of all sessions, // plus for 100% of sessions with an error + // Learn more at + // https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, }); @@ -59,6 +63,8 @@ Sentry.init({ // Set tracesSampleRate to 1.0 to capture 100% // of transactions for tracing. // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled @@ -66,6 +72,8 @@ Sentry.init({ // Capture Replay for 10% of all sessions, // plus for 100% of sessions with an error + // Learn more at + // https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, }); diff --git a/platform-includes/getting-started-config/javascript.aws-lambda.mdx b/platform-includes/getting-started-config/javascript.aws-lambda.mdx index 68c323ca6c748..3c018c330d8d8 100644 --- a/platform-includes/getting-started-config/javascript.aws-lambda.mdx +++ b/platform-includes/getting-started-config/javascript.aws-lambda.mdx @@ -11,6 +11,8 @@ Sentry.init({ // Add Performance Monitoring by setting tracesSampleRate // Set tracesSampleRate to 1.0 to capture 100% of transactions // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // Set sampling rate for profiling - this is relative to tracesSampleRate @@ -35,6 +37,8 @@ Sentry.init({ // Add Performance Monitoring by setting tracesSampleRate // Set tracesSampleRate to 1.0 to capture 100% of transactions // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // Set sampling rate for profiling - this is relative to tracesSampleRate diff --git a/platform-includes/getting-started-config/javascript.azure-functions.mdx b/platform-includes/getting-started-config/javascript.azure-functions.mdx index 439aabe930f0b..3e92b6467f7a3 100644 --- a/platform-includes/getting-started-config/javascript.azure-functions.mdx +++ b/platform-includes/getting-started-config/javascript.azure-functions.mdx @@ -11,6 +11,8 @@ Sentry.init({ // Add Performance Monitoring by setting tracesSampleRate // Set tracesSampleRate to 1.0 to capture 100% of transactions // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // Set sampling rate for profiling - this is relative to tracesSampleRate diff --git a/platform-includes/getting-started-config/javascript.bun.mdx b/platform-includes/getting-started-config/javascript.bun.mdx index 5a1a32b4aeb3e..938c437064c90 100644 --- a/platform-includes/getting-started-config/javascript.bun.mdx +++ b/platform-includes/getting-started-config/javascript.bun.mdx @@ -14,6 +14,8 @@ Sentry.init({ // Add Performance Monitoring by setting tracesSampleRate // Set tracesSampleRate to 1.0 to capture 100% of transactions // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, }); ``` diff --git a/platform-includes/getting-started-config/javascript.capacitor.mdx b/platform-includes/getting-started-config/javascript.capacitor.mdx index f594253cc31ee..582ed459b34f7 100644 --- a/platform-includes/getting-started-config/javascript.capacitor.mdx +++ b/platform-includes/getting-started-config/javascript.capacitor.mdx @@ -26,6 +26,8 @@ Sentry.init( // Set tracesSampleRate to 1.0 to capture 100% // of transactions for tracing. // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled @@ -33,6 +35,8 @@ Sentry.init( // Capture Replay for 10% of all sessions, // plus for 100% of sessions with an error + // Learn more at + // https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, }, @@ -87,6 +91,8 @@ Sentry.init( // Set tracesSampleRate to 1.0 to capture 100% // of transactions for tracing. // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled @@ -94,6 +100,8 @@ Sentry.init( // Capture Replay for 10% of all sessions, // plus for 100% of sessions with an error + // Learn more at + // https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, }, @@ -147,6 +155,8 @@ Sentry.init( // Set tracesSampleRate to 1.0 to capture 100% // of transactions for tracing. // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled @@ -154,6 +164,8 @@ Sentry.init( // Capture Replay for 10% of all sessions, // plus for 100% of sessions with an error + // Learn more at + // https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, }, @@ -191,6 +203,8 @@ Sentry.init( // Set tracesSampleRate to 1.0 to capture 100% // of transactions for tracing. // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled @@ -198,6 +212,8 @@ Sentry.init( // Capture Replay for 10% of all sessions, // plus for 100% of sessions with an error + // Learn more at + // https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, }, diff --git a/platform-includes/getting-started-config/javascript.cloudflare.mdx b/platform-includes/getting-started-config/javascript.cloudflare.mdx index ee7974fdff688..815755c2e0c0d 100644 --- a/platform-includes/getting-started-config/javascript.cloudflare.mdx +++ b/platform-includes/getting-started-config/javascript.cloudflare.mdx @@ -27,6 +27,8 @@ export const onRequest = [ Sentry.sentryPagesPlugin((context) => ({ dsn: "___PUBLIC_DSN___", // Set tracesSampleRate to 1.0 to capture 100% of spans for tracing. + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, })), // Add more middlewares here @@ -45,6 +47,8 @@ export default withSentry( env => ({ dsn: "___PUBLIC_DSN___", // Set tracesSampleRate to 1.0 to capture 100% of spans for tracing. + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, }), { diff --git a/platform-includes/getting-started-config/javascript.deno.mdx b/platform-includes/getting-started-config/javascript.deno.mdx index 10931d60b185a..1ea9f3bcdf5b3 100644 --- a/platform-includes/getting-started-config/javascript.deno.mdx +++ b/platform-includes/getting-started-config/javascript.deno.mdx @@ -14,6 +14,8 @@ Sentry.init({ // Set tracesSampleRate to 1.0 to capture 100% // of transactions for performance monitoring. // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, }); ``` @@ -27,6 +29,8 @@ Sentry.init({ // Set tracesSampleRate to 1.0 to capture 100% // of transactions for performance monitoring. // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, }); ``` diff --git a/platform-includes/getting-started-config/javascript.electron.mdx b/platform-includes/getting-started-config/javascript.electron.mdx index 6c2de34c83065..d1a6e4c08ce64 100644 --- a/platform-includes/getting-started-config/javascript.electron.mdx +++ b/platform-includes/getting-started-config/javascript.electron.mdx @@ -25,10 +25,14 @@ Sentry.init({ // Set tracesSampleRate to 1.0 to capture 100% // of transactions for performance monitoring. // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // Capture Replay for 10% of all sessions, // plus for 100% of sessions with an error + // Learn more at + // https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, }); diff --git a/platform-includes/getting-started-config/javascript.ember.mdx b/platform-includes/getting-started-config/javascript.ember.mdx index 1051bf69184b0..318b47d4b0c64 100644 --- a/platform-includes/getting-started-config/javascript.ember.mdx +++ b/platform-includes/getting-started-config/javascript.ember.mdx @@ -15,11 +15,15 @@ Sentry.init({ // Set tracesSampleRate to 1.0 to capture 100% // of transactions for tracing. - // We recommend adjusting this value in production, + // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // Capture Replay for 10% of all sessions, // plus for 100% of sessions with an error + // Learn more at + // https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, }); diff --git a/platform-includes/getting-started-config/javascript.gcp-functions.mdx b/platform-includes/getting-started-config/javascript.gcp-functions.mdx index c35abf4395264..2441379ca1f92 100644 --- a/platform-includes/getting-started-config/javascript.gcp-functions.mdx +++ b/platform-includes/getting-started-config/javascript.gcp-functions.mdx @@ -11,6 +11,8 @@ Sentry.init({ // Add Performance Monitoring by setting tracesSampleRate // Set tracesSampleRate to 1.0 to capture 100% of transactions // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // Set sampling rate for profiling - this is relative to tracesSampleRate @@ -35,6 +37,8 @@ Sentry.init({ // Add Performance Monitoring by setting tracesSampleRate // Set tracesSampleRate to 1.0 to capture 100% of transactions // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // Set sampling rate for profiling - this is relative to tracesSampleRate @@ -61,6 +65,8 @@ Sentry.init({ // Add Performance Monitoring by setting tracesSampleRate // Set tracesSampleRate to 1.0 to capture 100% of transactions // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // Set sampling rate for profiling - this is relative to tracesSampleRate diff --git a/platform-includes/getting-started-config/javascript.mdx b/platform-includes/getting-started-config/javascript.mdx index 2435056639ef9..0039279f3dd49 100644 --- a/platform-includes/getting-started-config/javascript.mdx +++ b/platform-includes/getting-started-config/javascript.mdx @@ -2,7 +2,6 @@ Once this is done, Sentry's JavaScript SDK will capture all unhandled exceptions Note, that configuration differs slightly depending on how you installed the Sentry SDK. Make sure to follow the instructions in the correct tab, depending on if you installed the Sentry SDK via NPM, using the Loader Script, or via CDN. - ```javascript {tabTitle:npm} import * as Sentry from "@sentry/browser"; @@ -20,6 +19,8 @@ Sentry.init({ // Set tracesSampleRate to 1.0 to capture 100% // of transactions for tracing. // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled @@ -27,6 +28,8 @@ Sentry.init({ // Capture Replay for 10% of all sessions, // plus for 100% of sessions with an error + // Learn more at + // https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, }); @@ -54,6 +57,8 @@ Sentry.init({ // Set tracesSampleRate to 1.0 to capture 100% // of transactions for tracing. // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled @@ -61,6 +66,8 @@ Sentry.init({ // Capture Replay for 10% of all sessions, // plus for 100% of sessions with an error + // Learn more at + // https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, }); @@ -90,6 +97,8 @@ Sentry.init({ // Set tracesSampleRate to 1.0 to capture 100% // of transactions for tracing. // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled @@ -97,6 +106,8 @@ Sentry.init({ // Capture Replay for 10% of all sessions, // plus for 100% of sessions with an error + // Learn more at + // https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, }); diff --git a/platform-includes/getting-started-config/javascript.react.mdx b/platform-includes/getting-started-config/javascript.react.mdx index c966b41617154..33ab0f746408c 100644 --- a/platform-includes/getting-started-config/javascript.react.mdx +++ b/platform-includes/getting-started-config/javascript.react.mdx @@ -28,6 +28,8 @@ Sentry.init({ // Set tracesSampleRate to 1.0 to capture 100% // of transactions for tracing. + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled @@ -35,6 +37,8 @@ Sentry.init({ // Capture Replay for 10% of all sessions, // plus for 100% of sessions with an error + // Learn more at + // https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, }); diff --git a/platform-includes/getting-started-config/javascript.solid.mdx b/platform-includes/getting-started-config/javascript.solid.mdx index b393733288419..996f89baa2cab 100644 --- a/platform-includes/getting-started-config/javascript.solid.mdx +++ b/platform-includes/getting-started-config/javascript.solid.mdx @@ -24,6 +24,8 @@ if (!DEV) { // Set tracesSampleRate to 1.0 to capture 100% // of transactions for tracing. // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled @@ -31,6 +33,8 @@ if (!DEV) { // Capture Replay for 10% of all sessions, // plus 100% of sessions with an error + // Learn more at + // https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, }); diff --git a/platform-includes/getting-started-config/javascript.svelte.mdx b/platform-includes/getting-started-config/javascript.svelte.mdx index 622d617b277df..ba02560c84852 100644 --- a/platform-includes/getting-started-config/javascript.svelte.mdx +++ b/platform-includes/getting-started-config/javascript.svelte.mdx @@ -18,6 +18,8 @@ Sentry.init({ // Set tracesSampleRate to 1.0 to capture 100% // of transactions for tracing. // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled @@ -25,6 +27,8 @@ Sentry.init({ // Capture Replay for 10% of all sessions, // plus 100% of sessions with an error + // Learn more at + // https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, }); diff --git a/platform-includes/getting-started-config/javascript.vue.mdx b/platform-includes/getting-started-config/javascript.vue.mdx index 1bfdf8a787c82..027e97f007ec5 100644 --- a/platform-includes/getting-started-config/javascript.vue.mdx +++ b/platform-includes/getting-started-config/javascript.vue.mdx @@ -26,6 +26,8 @@ Sentry.init({ // Set tracesSampleRate to 1.0 to capture 100% // of transactions for tracing. // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled @@ -33,6 +35,8 @@ Sentry.init({ // Capture Replay for 10% of all sessions, // plus for 100% of sessions with an error + // Learn more at + // https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, }); @@ -66,6 +70,8 @@ Sentry.init({ // Set tracesSampleRate to 1.0 to capture 100% // of transactions for tracing. // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled @@ -73,6 +79,8 @@ Sentry.init({ // Capture Replay for 10% of all sessions, // plus for 100% of sessions with an error + // Learn more at + // https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, }); diff --git a/platform-includes/getting-started-node/javascript.express__v7.x.mdx b/platform-includes/getting-started-node/javascript.express__v7.x.mdx index 617df1238d214..fe4ddd0020c27 100644 --- a/platform-includes/getting-started-node/javascript.express__v7.x.mdx +++ b/platform-includes/getting-started-node/javascript.express__v7.x.mdx @@ -22,17 +22,19 @@ Sentry.init({ // Add Performance Monitoring by setting tracesSampleRate and adding integration // Set tracesSampleRate to 1.0 to capture 100% of transactions // We recommend adjusting this value in production + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate tracesSampleRate: 1.0, // Set sampling rate for profiling // This is relative to tracesSampleRate profilesSampleRate: 1.0, - + integrations: [ expressIntegration({ app }), nodeProfilingIntegration(), ], - + // It is possible to specify the routes that should be traced by passing a router instance to the `router` option: // expressIntegration({ router: someRouterInstance }) }); @@ -80,12 +82,12 @@ Sentry.init({ // Set sampling rate for profiling // This is relative to tracesSampleRate profilesSampleRate: 1.0, - + integrations: [ expressIntegration({ app }), nodeProfilingIntegration(), ], - + // It is possible to specify the routes that should be traced by passing a router instance to the `router` option: // expressIntegration({ router: someRouterInstance }) });