Skip to content

Commit de285e6

Browse files
authored
Adjust sentry sample rate based on env (#4465)
1 parent 7fab922 commit de285e6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

packages/playground/src/main.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ if (window.env.ENABLE_TELEMETRY) {
4242
integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()],
4343
release: process.env.VERSION,
4444
// Performance Monitoring
45-
tracesSampleRate: 1.0, // Capture 100% of the transactions
45+
tracesSampleRate: import.meta.env.PROD ? 0.1 : 1.0, // 10% in production, 100% in development
4646
// Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
4747
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
4848
// Session Replay
49-
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.
50-
replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
49+
replaysSessionSampleRate: import.meta.env.PROD ? 0.01 : 0.1, // 1% in production, 10% in development
50+
replaysOnErrorSampleRate: import.meta.env.PROD ? 0.5 : 1.0, // 50% in production, 100% in development
5151
});
5252
});
5353
}

0 commit comments

Comments
 (0)