Vier config-files volgens Next.js 15+ conventie: - instrumentation.ts (root) → koppelt server/edge config aan runtime-hook - instrumentation-client.ts → client-init + onRouterTransitionStart - sentry.server.config.ts → node-runtime - sentry.edge.config.ts → edge-runtime (proxy.ts) next.config.ts gewrapped met withSentryConfig: - Source-map-upload ALLEEN als SENTRY_AUTH_TOKEN gezet is - Tunnel /monitoring omzeilt ad-blockers (*.sentry.io) - Silent buiten CI SDK is no-op zonder NEXT_PUBLIC_SENTRY_DSN — geen network/overhead in dev of bij ontbrekende creds. Sample-rates conservatief: errors 100%, performance 10% in productie / 100% in dev. Geen Replay (privacy-review nodig + overkill voor MVP). sendDefaultPii uit. .env.example gedocumenteerd; architectuur-doc bijgewerkt met nieuwe sleutelbeslissing en file-tree-aanvulling. v1-readiness #1 verschoven naar 'done', #2 hiermee in flight. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
16 lines
506 B
TypeScript
16 lines
506 B
TypeScript
// PBI/v1-readiness item 2: Next.js instrumentation hook — koppelt Sentry's
|
|
// server- en edge-configs aan de juiste runtime. Bestand moet in project-root
|
|
// staan voor Next.js 15+.
|
|
|
|
import * as Sentry from '@sentry/nextjs'
|
|
|
|
export async function register() {
|
|
if (process.env.NEXT_RUNTIME === 'nodejs') {
|
|
await import('./sentry.server.config')
|
|
}
|
|
if (process.env.NEXT_RUNTIME === 'edge') {
|
|
await import('./sentry.edge.config')
|
|
}
|
|
}
|
|
|
|
export const onRequestError = Sentry.captureRequestError
|