From 0ebef190fc1dd4c4d09ee3d3dedba1edb1a7a3f7 Mon Sep 17 00:00:00 2001 From: Alaister Young Date: Thu, 8 Jan 2026 16:31:01 +0800 Subject: [PATCH] [FE-2328] feat(studio): add sentry environment environment variable (#41769) feat(studio): add sentry environment environment variable --- apps/studio/instrumentation-client.ts | 3 +++ apps/studio/sentry.edge.config.ts | 3 +++ apps/studio/sentry.server.config.ts | 3 +++ 3 files changed, 9 insertions(+) diff --git a/apps/studio/instrumentation-client.ts b/apps/studio/instrumentation-client.ts index 82cc2a026e1..9bd34e8177f 100644 --- a/apps/studio/instrumentation-client.ts +++ b/apps/studio/instrumentation-client.ts @@ -52,6 +52,9 @@ function isThirdPartyError(frames: Sentry.StackFrame[] | undefined) { Sentry.init({ dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, + ...(process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT && { + environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT, + }), // Setting this option to true will print useful information to the console while you're setting up Sentry. debug: false, // [Ali] Filter out browser extensions and user scripts (FE-2094) diff --git a/apps/studio/sentry.edge.config.ts b/apps/studio/sentry.edge.config.ts index 1e69c24525d..c5db7e27ad9 100644 --- a/apps/studio/sentry.edge.config.ts +++ b/apps/studio/sentry.edge.config.ts @@ -7,6 +7,9 @@ import * as Sentry from '@sentry/nextjs' Sentry.init({ dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, + ...(process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT && { + environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT, + }), // Setting this option to true will print useful information to the console while you're setting up Sentry. debug: false, }) diff --git a/apps/studio/sentry.server.config.ts b/apps/studio/sentry.server.config.ts index fd089fb1ff0..dba6457bc5f 100644 --- a/apps/studio/sentry.server.config.ts +++ b/apps/studio/sentry.server.config.ts @@ -6,6 +6,9 @@ import * as Sentry from '@sentry/nextjs' Sentry.init({ dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, + ...(process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT && { + environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT, + }), // Setting this option to true will print useful information to the console while you're setting up Sentry. debug: false, ignoreErrors: [