Skip to content

Sentry error monitoring (errors-only) - #33

Merged
thomgabriel merged 2 commits into
mainfrom
feat/sentry
Aug 27, 2026
Merged

Sentry error monitoring (errors-only)#33
thomgabriel merged 2 commits into
mainfrom
feat/sentry

Conversation

@thomgabriel

Copy link
Copy Markdown
Collaborator

Wires @sentry/nextjs v10.71 in the current Next 16 shape: src/instrumentation.ts with onRequestError (auto-captures throws in server components, server actions, route handlers, middleware), src/instrumentation-client.ts, and a global-error.tsx so root-layout crashes stop being invisible. logQueryError now also reports to Sentry — that one edit covers every caught-and-handled { ok: false } mutation path.

Deliberate choices: errors-only client (~30 KB gz — no tracing/replay/logs), sendDefaultPii: false everywhere (LGPD; user association can come later as setUser({ id }) only), fixed tunnelRoute: '/sentry-tunnel' excluded from the middleware matcher — Turbopack builds don't auto-skip it and the Supabase middleware would eat the POSTs.

Everything no-ops until NEXT_PUBLIC_SENTRY_DSN (+ SENTRY_ORG/SENTRY_PROJECT/SENTRY_AUTH_TOKEN for source maps) land in Vercel. Prod build + next start smoke-tested locally against the known Turbopack/OTel crash (sentry-javascript #19367) — clean.

Client stays at the ~30 KB errors-only floor: no tracing, no replay,
enableLogs off. onRequestError covers server components, actions, handlers
and middleware; logQueryError captures the caught-and-handled paths that
never throw. Tunnel route is a fixed string and excluded from the auth
middleware matcher — under Turbopack the SDK doesn't skip it by itself.
No-ops until NEXT_PUBLIC_SENTRY_DSN is set.
@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hackathon-platform Ready Ready Preview Aug 27, 2026 2:11pm

Request Review

Review pass: the generic unwrap() rethrow is ignored server-side (already
captured with context in logQueryError), boundaries skip digest-bearing
errors (captured server-side, redacted on the client), and the Sentry env
vars join .env.example.
@thomgabriel
thomgabriel merged commit 319bf0c into main Aug 27, 2026
1 check was pending
@thomgabriel
thomgabriel deleted the feat/sentry branch August 27, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant