Sprint 3 batch 2: Sentry integration (opt-in) - #130
Merged
Merged
Conversation
Backend: src/instrument.ts initialises @sentry/nestjs before any other
application code so the auto-instrumentation can wrap http/express/prisma.
beforeSend strips authorization/cookie/x-api-key/set-cookie headers and
any *password* / *token* / *secret* / *apiKey* / *credential* nested key
from the event body. main.ts imports it before NestFactory.create.
Frontend: sentry.{client,server,edge}.config.ts plus src/instrumentation.ts
delegating to the right runtime. onRequestError captures errors thrown by
RSCs / route handlers; a defensive wrapper means a missing
captureRequestError helper in older Sentry versions doesn't break the
build.
All four init paths read SENTRY_DSN (or NEXT_PUBLIC_SENTRY_DSN on the
client) and short-circuit when unset, so the default self-hosted
experience ships zero traffic to Sentry. tracesSampleRate /
profilesSampleRate / replaysSampleRate default to 0 and require the
operator to set the corresponding env vars to opt in.
Verified: backend jest 554/555 pass, frontend Playwright 3/3 pass,
both tsc --noEmit clean. Full Docker smoke deferred to the end-of-sprint
final run.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backend (@sentry/nestjs) and frontend (@sentry/nextjs) error reporting wired in. All four init paths read SENTRY_DSN / NEXT_PUBLIC_SENTRY_DSN and short-circuit when unset, so the default self-hosted experience ships nothing to Sentry. Sample rates default to 0 — operators must opt in explicitly.
Sensitive headers and DTO field names are scrubbed in the backend beforeSend so credential leaks can't reach Sentry even if a controller logs its body.
Verified: backend 554/555, Playwright 3/3, both tsc clean.