Skip to content

Commit 00cbfb8

Browse files
authored
feat(frontend): re-enable sentry in dev (#10857)
<!-- Clearly explain the need for these changes: --> ### Changes 🏗️ - We want sentry to actually work so we can do testing <!-- Concisely describe all of the changes made in this pull request: --> ### Checklist 📋 #### For code changes: - [x] I have clearly listed my changes in the PR description - [x] I have made a test plan - [x] I have tested my changes according to the test plan: <!-- Put your test plan here: --> - [x] we're just re-enabling. it wroks in prod
1 parent 3beafae commit 00cbfb8

File tree

3 files changed

+18
-21
lines changed

3 files changed

+18
-21
lines changed

autogpt_platform/frontend/instrumentation-client.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@
55
import { BehaveAs, getBehaveAs, getEnvironmentStr } from "@/lib/utils";
66
import * as Sentry from "@sentry/nextjs";
77

8-
const isProductionCloud =
9-
process.env.NODE_ENV === "production" && getBehaveAs() === BehaveAs.CLOUD;
8+
const shouldEnable =
9+
(process.env.NODE_ENV === "production" ||
10+
process.env.NODE_ENV === "development") &&
11+
getBehaveAs() === BehaveAs.CLOUD;
1012

1113
Sentry.init({
1214
dsn: "https://fe4e4aa4a283391808a5da396da20159@o4505260022104064.ingest.us.sentry.io/4507946746380288",
1315

1416
environment: getEnvironmentStr(),
1517

16-
enabled: isProductionCloud,
18+
enabled: shouldEnable,
1719

1820
// Add optional integrations for additional features
1921
integrations: [
@@ -56,10 +58,7 @@ Sentry.init({
5658
// For example, a tracesSampleRate of 0.5 and profilesSampleRate of 0.5 would
5759
// result in 25% of transactions being profiled (0.5*0.5=0.25)
5860
profilesSampleRate: 1.0,
59-
_experiments: {
60-
// Enable logs to be sent to Sentry.
61-
enableLogs: true,
62-
},
61+
enableLogs: true,
6362
});
6463

6564
export const onRouterTransitionStart = Sentry.captureRouterTransitionStart;

autogpt_platform/frontend/sentry.edge.config.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@
66
import * as Sentry from "@sentry/nextjs";
77
import { BehaveAs, getBehaveAs, getEnvironmentStr } from "./src/lib/utils";
88

9-
const isProductionCloud =
10-
process.env.NODE_ENV === "production" && getBehaveAs() === BehaveAs.CLOUD;
9+
const shouldEnable =
10+
(process.env.NODE_ENV === "production" ||
11+
process.env.NODE_ENV === "development") &&
12+
getBehaveAs() === BehaveAs.CLOUD;
1113

1214
Sentry.init({
1315
dsn: "https://fe4e4aa4a283391808a5da396da20159@o4505260022104064.ingest.us.sentry.io/4507946746380288",
1416

1517
environment: getEnvironmentStr(),
1618

17-
enabled: isProductionCloud,
19+
enabled: shouldEnable,
1820

1921
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
2022
tracesSampleRate: 1,
@@ -28,8 +30,5 @@ Sentry.init({
2830
// Setting this option to true will print useful information to the console while you're setting up Sentry.
2931
debug: false,
3032

31-
_experiments: {
32-
// Enable logs to be sent to Sentry.
33-
enableLogs: true,
34-
},
33+
enableLogs: true,
3534
});

autogpt_platform/frontend/sentry.server.config.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@ import { BehaveAs, getBehaveAs, getEnvironmentStr } from "@/lib/utils";
66
import * as Sentry from "@sentry/nextjs";
77
// import { NodeProfilingIntegration } from "@sentry/profiling-node";
88

9-
const isProductionCloud =
10-
process.env.NODE_ENV === "production" && getBehaveAs() === BehaveAs.CLOUD;
9+
const shouldEnable =
10+
(process.env.NODE_ENV === "production" ||
11+
process.env.NODE_ENV === "development") &&
12+
getBehaveAs() === BehaveAs.CLOUD;
1113

1214
Sentry.init({
1315
dsn: "https://fe4e4aa4a283391808a5da396da20159@o4505260022104064.ingest.us.sentry.io/4507946746380288",
1416

1517
environment: getEnvironmentStr(),
1618

17-
enabled: isProductionCloud,
19+
enabled: shouldEnable,
1820

1921
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
2022
tracesSampleRate: 1,
@@ -35,8 +37,5 @@ Sentry.init({
3537
// Sentry.fsIntegration(),
3638
],
3739

38-
_experiments: {
39-
// Enable logs to be sent to Sentry.
40-
enableLogs: true,
41-
},
40+
enableLogs: true,
4241
});

0 commit comments

Comments
 (0)