Merge pull request #236 from trails-cool/feat/sentry-dev-log
Log Sentry dev-inert status; explicit replay=0
This commit is contained in:
commit
27c9892bab
4 changed files with 30 additions and 4 deletions
|
|
@ -9,13 +9,14 @@ import { renderToPipeableStream } from "react-dom/server";
|
||||||
import { initI18nServer, detectLanguage } from "@trails-cool/i18n";
|
import { initI18nServer, detectLanguage } from "@trails-cool/i18n";
|
||||||
|
|
||||||
const sentryEnvironment = process.env.CI ? "ci" : (process.env.NODE_ENV ?? "development");
|
const sentryEnvironment = process.env.CI ? "ci" : (process.env.NODE_ENV ?? "development");
|
||||||
|
const sentryEnabled = process.env.NODE_ENV === "production" && !process.env.CI;
|
||||||
|
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
dsn: "https://a32ffcc575d34be072e91b20f247eeee@o4509530546634752.ingest.de.sentry.io/4509530555547728",
|
dsn: "https://a32ffcc575d34be072e91b20f247eeee@o4509530546634752.ingest.de.sentry.io/4509530555547728",
|
||||||
release: process.env.SENTRY_RELEASE,
|
release: process.env.SENTRY_RELEASE,
|
||||||
environment: sentryEnvironment,
|
environment: sentryEnvironment,
|
||||||
tracesSampleRate: 1.0,
|
tracesSampleRate: 1.0,
|
||||||
enabled: process.env.NODE_ENV === "production" && !process.env.CI,
|
enabled: sentryEnabled,
|
||||||
sendDefaultPii: false,
|
sendDefaultPii: false,
|
||||||
beforeSend(event) {
|
beforeSend(event) {
|
||||||
// Drop 404s — they're expected (scanners, typos), not bugs
|
// Drop 404s — they're expected (scanners, typos), not bugs
|
||||||
|
|
@ -25,6 +26,10 @@ Sentry.init({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!sentryEnabled && !process.env.CI) {
|
||||||
|
console.debug(`[sentry] journal SSR init inert (env=${sentryEnvironment}); would send to Sentry in production`);
|
||||||
|
}
|
||||||
|
|
||||||
export const streamTimeout = 5_000;
|
export const streamTimeout = 5_000;
|
||||||
|
|
||||||
export default function handleRequest(
|
export default function handleRequest(
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ export function initSentryClient() {
|
||||||
|
|
||||||
const sentryEnvironment = import.meta.env.VITE_SENTRY_ENVIRONMENT ??
|
const sentryEnvironment = import.meta.env.VITE_SENTRY_ENVIRONMENT ??
|
||||||
(import.meta.env.PROD ? "production" : "development");
|
(import.meta.env.PROD ? "production" : "development");
|
||||||
|
const enabled = import.meta.env.PROD && sentryEnvironment !== "ci";
|
||||||
|
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
dsn: "https://a32ffcc575d34be072e91b20f247eeee@o4509530546634752.ingest.de.sentry.io/4509530555547728",
|
dsn: "https://a32ffcc575d34be072e91b20f247eeee@o4509530546634752.ingest.de.sentry.io/4509530555547728",
|
||||||
|
|
@ -24,7 +25,14 @@ export function initSentryClient() {
|
||||||
],
|
],
|
||||||
environment: sentryEnvironment,
|
environment: sentryEnvironment,
|
||||||
tracesSampleRate: sentryEnvironment === "ci" ? 0 : 1.0,
|
tracesSampleRate: sentryEnvironment === "ci" ? 0 : 1.0,
|
||||||
enabled: import.meta.env.PROD && sentryEnvironment !== "ci",
|
enabled,
|
||||||
sendDefaultPii: false,
|
sendDefaultPii: false,
|
||||||
|
// Session Replay is not installed; document the intent explicitly.
|
||||||
|
replaysSessionSampleRate: 0,
|
||||||
|
replaysOnErrorSampleRate: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!enabled && !import.meta.env.PROD) {
|
||||||
|
console.debug(`[sentry] journal client init inert (env=${sentryEnvironment}); would send to Sentry in production`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,20 @@ import * as Sentry from "@sentry/react-native";
|
||||||
const SENTRY_DSN = "https://af50ac7aea803216adbe21e9dd4b896b@o4509530546634752.ingest.de.sentry.io/4511209742532688";
|
const SENTRY_DSN = "https://af50ac7aea803216adbe21e9dd4b896b@o4509530546634752.ingest.de.sentry.io/4511209742532688";
|
||||||
|
|
||||||
export function initSentry() {
|
export function initSentry() {
|
||||||
|
const enabled = !__DEV__;
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
dsn: SENTRY_DSN,
|
dsn: SENTRY_DSN,
|
||||||
tracesSampleRate: __DEV__ ? 0 : 1.0,
|
tracesSampleRate: __DEV__ ? 0 : 1.0,
|
||||||
enabled: !__DEV__,
|
enabled,
|
||||||
sendDefaultPii: false,
|
sendDefaultPii: false,
|
||||||
|
// Session Replay is not installed; document the intent explicitly.
|
||||||
|
replaysSessionSampleRate: 0,
|
||||||
|
replaysOnErrorSampleRate: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!enabled) {
|
||||||
|
console.debug("[sentry] mobile init inert in dev; would send to Sentry in production");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export { Sentry };
|
export { Sentry };
|
||||||
|
|
|
||||||
|
|
@ -11,13 +11,14 @@ import { expireSessionsJob } from "./app/jobs/expire-sessions.ts";
|
||||||
import postgres from "postgres";
|
import postgres from "postgres";
|
||||||
|
|
||||||
const sentryEnvironment = process.env.CI ? "ci" : (process.env.NODE_ENV ?? "development");
|
const sentryEnvironment = process.env.CI ? "ci" : (process.env.NODE_ENV ?? "development");
|
||||||
|
const sentryEnabled = process.env.NODE_ENV === "production" && !process.env.CI;
|
||||||
|
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
dsn: "https://5215134cd78d5e6c199e29300b8425af@o4509530546634752.ingest.de.sentry.io/4511102546608208",
|
dsn: "https://5215134cd78d5e6c199e29300b8425af@o4509530546634752.ingest.de.sentry.io/4511102546608208",
|
||||||
release: process.env.SENTRY_RELEASE,
|
release: process.env.SENTRY_RELEASE,
|
||||||
environment: sentryEnvironment,
|
environment: sentryEnvironment,
|
||||||
tracesSampleRate: 1.0,
|
tracesSampleRate: 1.0,
|
||||||
enabled: process.env.NODE_ENV === "production" && !process.env.CI,
|
enabled: sentryEnabled,
|
||||||
beforeSend(event) {
|
beforeSend(event) {
|
||||||
const serialized = event.extra?.__serialized__ as Record<string, unknown> | undefined;
|
const serialized = event.extra?.__serialized__ as Record<string, unknown> | undefined;
|
||||||
if (serialized?.status === 404) return null;
|
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 port = Number(process.env.PORT ?? 3001);
|
||||||
const CLIENT_DIR = resolve(import.meta.dirname, "build", "client");
|
const CLIENT_DIR = resolve(import.meta.dirname, "build", "client");
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue