AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
feat(frontend): allow sentry disable in dev (#10858)
Nicholas Tindlec03af5c1963d
diff --git a/autogpt_platform/frontend/instrumentation-client.ts b/autogpt_platform/frontend/instrumentation-client.tsindex f9e0b226e3..d491553ae7 100644--- a/autogpt_platform/frontend/instrumentation-client.ts+++ b/autogpt_platform/frontend/instrumentation-client.ts@@ -5,10 +5,14 @@import { BehaveAs, getBehaveAs, getEnvironmentStr } from "@/lib/utils";import * as Sentry from "@sentry/nextjs";-const shouldEnable =- (process.env.NODE_ENV === "production" ||- process.env.NODE_ENV === "development") &&- getBehaveAs() === BehaveAs.CLOUD;+const isProdOrDev =+ process.env.NODE_ENV === "production" ||+ process.env.NODE_ENV === "development";++const isCloud = getBehaveAs() === BehaveAs.CLOUD;+const isDisabled = process.env.DISABLE_SENTRY === "true";++const shouldEnable = !isDisabled && isProdOrDev && isCloud;Sentry.init({dsn: "https://fe4e4aa4a283391808a5da396da20159@o4505260022104064.ingest.us.sentry.io/4507946746380288",diff --git a/autogpt_platform/frontend/sentry.edge.config.ts b/autogpt_platform/frontend/sentry.edge.config.tsindex a98034161d..e0d3d5c5ce 100644--- a/autogpt_platform/frontend/sentry.edge.config.ts+++ b/autogpt_platform/frontend/sentry.edge.config.ts@@ -6,10 +6,14 @@import * as Sentry from "@sentry/nextjs";import { BehaveAs, getBehaveAs, getEnvironmentStr } from "./src/lib/utils";-const shouldEnable =- (process.env.NODE_ENV === "production" ||- process.env.NODE_ENV === "development") &&- getBehaveAs() === BehaveAs.CLOUD;+const isProdOrDev =+ process.env.NODE_ENV === "production" ||+ process.env.NODE_ENV === "development";++const isCloud = getBehaveAs() === BehaveAs.CLOUD;+const isDisabled = process.env.DISABLE_SENTRY === "true";++const shouldEnable = !isDisabled && isProdOrDev && isCloud;Sentry.init({dsn: "https://fe4e4aa4a283391808a5da396da20159@o4505260022104064.ingest.us.sentry.io/4507946746380288",diff --git a/autogpt_platform/frontend/sentry.server.config.ts b/autogpt_platform/frontend/sentry.server.config.tsindex 3a16900b51..20a9b718b4 100644--- a/autogpt_platform/frontend/sentry.server.config.ts+++ b/autogpt_platform/frontend/sentry.server.config.ts@@ -6,10 +6,14 @@ import { BehaveAs, getBehaveAs, getEnvironmentStr } from "@/lib/utils";import * as Sentry from "@sentry/nextjs";// import { NodeProfilingIntegration } from "@sentry/profiling-node";-const shouldEnable =- (process.env.NODE_ENV === "production" ||- process.env.NODE_ENV === "development") &&- getBehaveAs() === BehaveAs.CLOUD;+const isProdOrDev =+ process.env.NODE_ENV === "production" ||+ process.env.NODE_ENV === "development";++const isCloud = getBehaveAs() === BehaveAs.CLOUD;+const isDisabled = process.env.DISABLE_SENTRY === "true";++const shouldEnable = !isDisabled && isProdOrDev && isCloud;Sentry.init({dsn: "https://fe4e4aa4a283391808a5da396da20159@o4505260022104064.ingest.us.sentry.io/4507946746380288",