Skip to content

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): re-enable sentry in dev (#10857)

Nicholas Tindle00cbfb8f8080
diff --git a/autogpt_platform/frontend/instrumentation-client.ts b/autogpt_platform/frontend/instrumentation-client.ts
index f439303a42..f9e0b226e3 100644
--- a/autogpt_platform/frontend/instrumentation-client.ts
+++ b/autogpt_platform/frontend/instrumentation-client.ts
@@ -5,15 +5,17 @@
import { BehaveAs, getBehaveAs, getEnvironmentStr } from "@/lib/utils";
import * as Sentry from "@sentry/nextjs";
-const isProductionCloud =
- process.env.NODE_ENV === "production" && getBehaveAs() === BehaveAs.CLOUD;
+const shouldEnable =
+ (process.env.NODE_ENV === "production" ||
+ process.env.NODE_ENV === "development") &&
+ getBehaveAs() === BehaveAs.CLOUD;
Sentry.init({
dsn: "https://fe4e4aa4a283391808a5da396da20159@o4505260022104064.ingest.us.sentry.io/4507946746380288",
environment: getEnvironmentStr(),
- enabled: isProductionCloud,
+ enabled: shouldEnable,
// Add optional integrations for additional features
integrations: [
@@ -56,10 +58,7 @@ Sentry.init({
// For example, a tracesSampleRate of 0.5 and profilesSampleRate of 0.5 would
// result in 25% of transactions being profiled (0.5*0.5=0.25)
profilesSampleRate: 1.0,
- _experiments: {
- // Enable logs to be sent to Sentry.
- enableLogs: true,
- },
+ enableLogs: true,
});
export const onRouterTransitionStart = Sentry.captureRouterTransitionStart;
diff --git a/autogpt_platform/frontend/sentry.edge.config.ts b/autogpt_platform/frontend/sentry.edge.config.ts
index 3f7007d456..a98034161d 100644
--- a/autogpt_platform/frontend/sentry.edge.config.ts
+++ b/autogpt_platform/frontend/sentry.edge.config.ts
@@ -6,15 +6,17 @@
import * as Sentry from "@sentry/nextjs";
import { BehaveAs, getBehaveAs, getEnvironmentStr } from "./src/lib/utils";
-const isProductionCloud =
- process.env.NODE_ENV === "production" && getBehaveAs() === BehaveAs.CLOUD;
+const shouldEnable =
+ (process.env.NODE_ENV === "production" ||
+ process.env.NODE_ENV === "development") &&
+ getBehaveAs() === BehaveAs.CLOUD;
Sentry.init({
dsn: "https://fe4e4aa4a283391808a5da396da20159@o4505260022104064.ingest.us.sentry.io/4507946746380288",
environment: getEnvironmentStr(),
- enabled: isProductionCloud,
+ enabled: shouldEnable,
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
tracesSampleRate: 1,
@@ -28,8 +30,5 @@ Sentry.init({
// Setting this option to true will print useful information to the console while you're setting up Sentry.
debug: false,
- _experiments: {
- // Enable logs to be sent to Sentry.
- enableLogs: true,
- },
+ enableLogs: true,
});
diff --git a/autogpt_platform/frontend/sentry.server.config.ts b/autogpt_platform/frontend/sentry.server.config.ts
index b93128805c..3a16900b51 100644
--- a/autogpt_platform/frontend/sentry.server.config.ts
+++ b/autogpt_platform/frontend/sentry.server.config.ts
@@ -6,15 +6,17 @@ import { BehaveAs, getBehaveAs, getEnvironmentStr } from "@/lib/utils";
import * as Sentry from "@sentry/nextjs";
// import { NodeProfilingIntegration } from "@sentry/profiling-node";
-const isProductionCloud =
- process.env.NODE_ENV === "production" && getBehaveAs() === BehaveAs.CLOUD;
+const shouldEnable =
+ (process.env.NODE_ENV === "production" ||
+ process.env.NODE_ENV === "development") &&
+ getBehaveAs() === BehaveAs.CLOUD;
Sentry.init({
dsn: "https://fe4e4aa4a283391808a5da396da20159@o4505260022104064.ingest.us.sentry.io/4507946746380288",
environment: getEnvironmentStr(),
- enabled: isProductionCloud,
+ enabled: shouldEnable,
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
tracesSampleRate: 1,
@@ -35,8 +37,5 @@ Sentry.init({
// Sentry.fsIntegration(),
],
- _experiments: {
- // Enable logs to be sent to Sentry.
- enableLogs: true,
- },
+ enableLogs: true,
});