Log Sentry dev-inert status; explicit replay=0
When Sentry init runs but is disabled (local dev / CI), log a debug message so developers can see Sentry *would* send in production. Also explicitly set replaysSessionSampleRate/replaysOnErrorSampleRate to 0 in the client and mobile configs. Replay integration isn't installed, so this is documentation — it prevents future accidental enablement if an integration is ever added. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
cc0f44258a
commit
4092f21475
4 changed files with 30 additions and 4 deletions
|
|
@ -11,13 +11,14 @@ import { expireSessionsJob } from "./app/jobs/expire-sessions.ts";
|
|||
import postgres from "postgres";
|
||||
|
||||
const sentryEnvironment = process.env.CI ? "ci" : (process.env.NODE_ENV ?? "development");
|
||||
const sentryEnabled = process.env.NODE_ENV === "production" && !process.env.CI;
|
||||
|
||||
Sentry.init({
|
||||
dsn: "https://5215134cd78d5e6c199e29300b8425af@o4509530546634752.ingest.de.sentry.io/4511102546608208",
|
||||
release: process.env.SENTRY_RELEASE,
|
||||
environment: sentryEnvironment,
|
||||
tracesSampleRate: 1.0,
|
||||
enabled: process.env.NODE_ENV === "production" && !process.env.CI,
|
||||
enabled: sentryEnabled,
|
||||
beforeSend(event) {
|
||||
const serialized = event.extra?.__serialized__ as Record<string, unknown> | undefined;
|
||||
if (serialized?.status === 404) return null;
|
||||
|
|
@ -25,6 +26,10 @@ Sentry.init({
|
|||
},
|
||||
});
|
||||
|
||||
if (!sentryEnabled && !process.env.CI) {
|
||||
console.debug(`[sentry] planner server init inert (env=${sentryEnvironment}); would send to Sentry in production`);
|
||||
}
|
||||
|
||||
const port = Number(process.env.PORT ?? 3001);
|
||||
const CLIENT_DIR = resolve(import.meta.dirname, "build", "client");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue