feat(observability): browser Sentry SDK (gated on VITE_SENTRY_DSN) #68
Reference in New Issue
Block a user
Delete Branch "feat/sentry-browser"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds
@sentry/reactto the Vite frontend, gated onVITE_SENTRY_DSN. No behaviour change when DSN is unset.What this fixes
A recent panel investigation (insight
cmpv9q3ms004dfcphluw0z8bh— silent rage-clicks afterparts_panel_viewed, no API call follows) couldn't be confirmed or refuted from JS error data because sase frontend has no browser error channel. Faro (RUM/traces) and PostHog (product) are wired, Sentry isn't. This adds it.Changes
apps/web/package.json:@sentry/react^9apps/web/src/lib/sentry.ts: new — dynamic import, no SDK cost when DSN unsetapps/web/src/main.tsx:initSentry()called before other init (so it captures their errors too)apps/web/vite.config.ts:sourcemap: 'hidden'so Sentry can de-minify traces (via release upload) without exposing source to end-user browsersdocker-compose.coolify.yml: threadVITE_SENTRY_DSN,VITE_SENTRY_ENVIRONMENT,VITE_SENTRY_RELEASEas build args (Vite values must be build-time)Tuning
tracesSampleRate: 0.1— start conservative, can raise laterreplaysSessionSampleRate: 0/replaysOnErrorSampleRate: 1— only record replay when an error firessendDefaultPii: false+maskAllText: true+blockAllMedia: true— KVKK complianceignoreErrors: framework noise (ResizeObserver, etc.)Post-merge wiring (manual)
ro48g8ooo0gk4kskog0oo8s8:VITE_SENTRY_DSN=https://683bd4176e870d331d2ac8eba3160ec9@o4508621271203840.ingest.de.sentry.io/4511490774138960VITE_SENTRY_ENVIRONMENT=productionjwgwkg4ssks80os0wswckgcswithVITE_SENTRY_ENVIRONMENT=development.otolog/sase-webproject (id 4511490774138960).Out of scope (future PRs)
@sentry/vite-plugin(needsSENTRY_AUTH_TOKENin CI)sentry-archivejob multi-project support (currently single-project topython)🤖 Generated with Claude Code
1dbccc706dto9f3eb0ff86