Skip to content

Scheduling infrastructure for absolutely everyone.

chore: Remove Sentry replay integration (#21211)

Keith Williams54c4b0b65e78
diff --git a/.env.example b/.env.example
index 37224c869d3..ddd0dd9e9b4 100644
--- a/.env.example
+++ b/.env.example
@@ -167,6 +167,8 @@ NEXT_PUBLIC_SENTRY_DSN=
SENTRY_DEBUG=
SENTRY_MAX_SPANS=
SENTRY_TRACES_SAMPLE_RATE=
+SENTRY_REPLAYS_SESSION_SAMPLE_RATE=
+SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATE=
# Formbricks Experience Management Integration
NEXT_PUBLIC_FORMBRICKS_HOST_URL=https://app.formbricks.com
diff --git a/apps/web/instrumentation-client.ts b/apps/web/instrumentation-client.ts
index 33e00d43f88..a3fee14ccce 100644
--- a/apps/web/instrumentation-client.ts
+++ b/apps/web/instrumentation-client.ts
@@ -6,22 +6,26 @@ import * as Sentry from "@sentry/nextjs";
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
- // Add optional integrations for additional features
- integrations: [Sentry.replayIntegration()],
-
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
- tracesSampleRate: 1,
+ tracesSampleRate: parseFloat(process.env.SENTRY_TRACES_SAMPLE_RATE ?? "0.0") || 0.0,
// Define how likely Replay events are sampled.
// This sets the sample rate to be 10%. You may want this to be 100% while
// in development and sample at a lower rate in production
- replaysSessionSampleRate: 0.1,
+ // replaysSessionSampleRate: parseFloat(process.env.SENTRY_REPLAYS_SESSION_SAMPLE_RATE ?? "0.0") || 0.0,
// Define how likely Replay events are sampled when an error occurs.
- replaysOnErrorSampleRate: 1.0,
+ // replaysOnErrorSampleRate: parseFloat(process.env.SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATE ?? "0.0") || 0.0,
// Setting this option to true will print useful information to the console while you're setting up Sentry.
debug: false,
+ beforeSend(event) {
+ event.tags = {
+ ...event.tags,
+ errorSource: "client",
+ };
+ return event;
+ },
});
export const onRouterTransitionStart = Sentry.captureRouterTransitionStart;
diff --git a/apps/web/sentry.edge.config.ts b/apps/web/sentry.edge.config.ts
index 842f09fccc2..5cf8b25efac 100644
--- a/apps/web/sentry.edge.config.ts
+++ b/apps/web/sentry.edge.config.ts
@@ -2,4 +2,11 @@ import * as Sentry from "@sentry/nextjs";
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
+ beforeSend(event) {
+ event.tags = {
+ ...event.tags,
+ errorSource: "edge",
+ };
+ return event;
+ },
});
diff --git a/apps/web/sentry.server.config.ts b/apps/web/sentry.server.config.ts
index 576b31d0d44..be7122d37ba 100644
--- a/apps/web/sentry.server.config.ts
+++ b/apps/web/sentry.server.config.ts
@@ -5,4 +5,11 @@ Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
tracesSampleRate: parseFloat(process.env.SENTRY_TRACES_SAMPLE_RATE ?? "0.0") || 0.0,
integrations: [Sentry.prismaIntegration()],
+ beforeSend(event) {
+ event.tags = {
+ ...event.tags,
+ errorSource: "server",
+ };
+ return event;
+ },
});
diff --git a/turbo.json b/turbo.json
index 69e8f842415..c090c03dc7c 100644
--- a/turbo.json
+++ b/turbo.json
@@ -41,6 +41,8 @@
"SENTRY_DEBUG",
"SENTRY_MAX_SPANS",
"SENTRY_TRACES_SAMPLE_RATE",
+ "SENTRY_REPLAYS_SESSION_SAMPLE_RATE",
+ "SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATE",
"STRIPE_PREMIUM_PLAN_PRODUCT_ID",
"STRIPE_TEAM_MONTHLY_PRICE_ID",
"STRIPE_TEAM_PRODUCT_ID",