From f8c5d28f47791beb2959463c1c95fad7ac698c9d Mon Sep 17 00:00:00 2001 From: batmanisko Date: Tue, 14 Jul 2026 11:24:20 +0200 Subject: [PATCH] fix: Sentry jen s error monitoringem (bez Sentry Logs) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Naše self-hosted instance nemá zapnuté Sentry Logs — console.error/warn se nově hlásí jako eventy (captureConsoleIntegration), console.log se k chybám přikládá jako breadcrumbs. --- client/src/index.tsx | 1 - server/.env.template | 2 +- server/src/instrument.ts | 7 ++++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/src/index.tsx b/client/src/index.tsx index b37f9f7..bdf1e9e 100644 --- a/client/src/index.tsx +++ b/client/src/index.tsx @@ -23,7 +23,6 @@ getConfig().then(({ data }) => { Sentry.init({ dsn: data.sentry.dsn, environment: data.sentry.environment, - enableLogs: true, }); } }).catch(() => { /* config endpoint nedostupný — běžíme bez Sentry */ }); diff --git a/server/.env.template b/server/.env.template index 767efc9..57cc1b3 100644 --- a/server/.env.template +++ b/server/.env.template @@ -58,7 +58,7 @@ # BOLT_POLL_INTERVAL_MS=3000 # Sentry (volitelné) — když není vyplněno, Sentry se vůbec neaktivuje. -# Server hlásí chyby (5xx, pády) a přeposílá console logy jako Sentry Logs. +# Server hlásí chyby (5xx, pády, console.error/warn); console.log se k chybám přikládá jako breadcrumbs. # SENTRY_DSN=https://...@sentry.example.com/1 # DSN pro prohlížeč (klient si ho vyzvedne z GET /api/config). Když není vyplněno, použije se SENTRY_DSN. # SENTRY_CLIENT_DSN=https://...@sentry.example.com/2 diff --git a/server/src/instrument.ts b/server/src/instrument.ts index e6a13b9..0bf22ae 100644 --- a/server/src/instrument.ts +++ b/server/src/instrument.ts @@ -11,9 +11,10 @@ if (process.env.SENTRY_DSN) { Sentry.init({ dsn: process.env.SENTRY_DSN, environment: process.env.NODE_ENV ?? 'production', - enableLogs: true, - // Přeposílá console.log/warn/error jako Sentry Logs — mj. přechody stavů Bolt trackingu - integrations: [Sentry.consoleLoggingIntegration({ levels: ['log', 'warn', 'error'] })], + // Naše self-hosted instance má jen error monitoring (bez Sentry Logs): + // console.error/warn se hlásí jako eventy, console.log (např. přechody stavů + // Bolt trackingu) se k chybám přikládá jako breadcrumbs (výchozí integrace). + integrations: [Sentry.captureConsoleIntegration({ levels: ['error', 'warn'] })], }); console.log('Sentry: inicializováno'); }