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
This commit is contained in:
Nicholas Tindle
2025-09-05 21:38:10 +02:00
committed by GitHub
parent 3beafae955
commit 00cbfb8f80
3 changed files with 18 additions and 21 deletions

View File

@@ -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;

View File

@@ -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,
});

View File

@@ -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,
});