From 16b88c8c047b1b2b628c9f05455a9d6897c2c66a Mon Sep 17 00:00:00 2001 From: jangwoong Date: Wed, 8 Jul 2026 17:56:48 +0900 Subject: [PATCH] =?UTF-8?q?[cs=20frontend]=20sentry=20=EA=B8=B0=EB=B3=B8?= =?UTF-8?q?=20disable=EB=A1=9C=20=EC=84=A4=EC=A0=95=ED=9B=84=20=EA=B8=B0?= =?UTF-8?q?=EB=8F=99=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD=ED=95=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/as/instrumentation-client.ts | 6 ++++++ apps/as/next.config.ts | 6 ++++++ apps/as/sentry.edge.config.ts | 6 ++++++ apps/as/sentry.server.config.ts | 6 ++++++ apps/cs/instrumentation-client.ts | 6 ++++++ apps/cs/next.config.ts | 6 ++++++ apps/cs/sentry.edge.config.ts | 6 ++++++ apps/cs/sentry.server.config.ts | 6 ++++++ 8 files changed, 48 insertions(+) diff --git a/apps/as/instrumentation-client.ts b/apps/as/instrumentation-client.ts index 07509aaa4..93548aca2 100644 --- a/apps/as/instrumentation-client.ts +++ b/apps/as/instrumentation-client.ts @@ -2,7 +2,13 @@ import * as Sentry from "@sentry/nextjs"; export const onRouterTransitionStart = Sentry.captureRouterTransitionStart; +const isSentryEnabled = + process.env.NEXT_PUBLIC_SENTRY_ENABLED === "true" && + process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT !== "dev" && + process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT !== "prd"; + Sentry.init({ + enabled: isSentryEnabled, dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT ?? "local", tracesSampleRate: 1.0, diff --git a/apps/as/next.config.ts b/apps/as/next.config.ts index ff77b9a36..be9b410eb 100644 --- a/apps/as/next.config.ts +++ b/apps/as/next.config.ts @@ -8,12 +8,18 @@ const nextConfig: NextConfig = { outputFileTracingRoot: path.join(__dirname, "../../"), }; +const isSentryEnabled = + process.env.NEXT_PUBLIC_SENTRY_ENABLED === "true" && + process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT !== "dev" && + process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT !== "prd"; + export default withSentryConfig(nextConfig, { org: process.env.SENTRY_ORG, project: process.env.SENTRY_PROJECT, silent: true, widenClientFileUpload: true, tunnelRoute: "/monitoring", + disable: !isSentryEnabled, webpack: { treeshake: { removeDebugLogging: process.env.NEXT_PUBLIC_SENTRY_DEBUG === "true" ? false : true, diff --git a/apps/as/sentry.edge.config.ts b/apps/as/sentry.edge.config.ts index 436630178..f1064d70b 100644 --- a/apps/as/sentry.edge.config.ts +++ b/apps/as/sentry.edge.config.ts @@ -1,6 +1,12 @@ import * as Sentry from "@sentry/nextjs"; +const isSentryEnabled = + process.env.NEXT_PUBLIC_SENTRY_ENABLED === "true" && + process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT !== "dev" && + process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT !== "prd"; + Sentry.init({ + enabled: isSentryEnabled, dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT ?? "local", tracesSampleRate: 1.0, diff --git a/apps/as/sentry.server.config.ts b/apps/as/sentry.server.config.ts index 436630178..f1064d70b 100644 --- a/apps/as/sentry.server.config.ts +++ b/apps/as/sentry.server.config.ts @@ -1,6 +1,12 @@ import * as Sentry from "@sentry/nextjs"; +const isSentryEnabled = + process.env.NEXT_PUBLIC_SENTRY_ENABLED === "true" && + process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT !== "dev" && + process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT !== "prd"; + Sentry.init({ + enabled: isSentryEnabled, dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT ?? "local", tracesSampleRate: 1.0, diff --git a/apps/cs/instrumentation-client.ts b/apps/cs/instrumentation-client.ts index 07509aaa4..93548aca2 100644 --- a/apps/cs/instrumentation-client.ts +++ b/apps/cs/instrumentation-client.ts @@ -2,7 +2,13 @@ import * as Sentry from "@sentry/nextjs"; export const onRouterTransitionStart = Sentry.captureRouterTransitionStart; +const isSentryEnabled = + process.env.NEXT_PUBLIC_SENTRY_ENABLED === "true" && + process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT !== "dev" && + process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT !== "prd"; + Sentry.init({ + enabled: isSentryEnabled, dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT ?? "local", tracesSampleRate: 1.0, diff --git a/apps/cs/next.config.ts b/apps/cs/next.config.ts index 11d8237c7..1fdc9639b 100644 --- a/apps/cs/next.config.ts +++ b/apps/cs/next.config.ts @@ -59,12 +59,18 @@ const nextConfig: NextConfig = { }, }; +const isSentryEnabled = + process.env.NEXT_PUBLIC_SENTRY_ENABLED === "true" && + process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT !== "dev" && + process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT !== "prd"; + export default withSentryConfig(nextConfig, { org: process.env.SENTRY_ORG, project: process.env.SENTRY_PROJECT, silent: true, widenClientFileUpload: true, tunnelRoute: "/monitoring", + disable: !isSentryEnabled, webpack: { treeshake: { removeDebugLogging: process.env.NEXT_PUBLIC_SENTRY_DEBUG === "true" ? false : true, diff --git a/apps/cs/sentry.edge.config.ts b/apps/cs/sentry.edge.config.ts index 436630178..f1064d70b 100644 --- a/apps/cs/sentry.edge.config.ts +++ b/apps/cs/sentry.edge.config.ts @@ -1,6 +1,12 @@ import * as Sentry from "@sentry/nextjs"; +const isSentryEnabled = + process.env.NEXT_PUBLIC_SENTRY_ENABLED === "true" && + process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT !== "dev" && + process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT !== "prd"; + Sentry.init({ + enabled: isSentryEnabled, dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT ?? "local", tracesSampleRate: 1.0, diff --git a/apps/cs/sentry.server.config.ts b/apps/cs/sentry.server.config.ts index 436630178..f1064d70b 100644 --- a/apps/cs/sentry.server.config.ts +++ b/apps/cs/sentry.server.config.ts @@ -1,6 +1,12 @@ import * as Sentry from "@sentry/nextjs"; +const isSentryEnabled = + process.env.NEXT_PUBLIC_SENTRY_ENABLED === "true" && + process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT !== "dev" && + process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT !== "prd"; + Sentry.init({ + enabled: isSentryEnabled, dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT ?? "local", tracesSampleRate: 1.0,