Setting up Sentry
Configure the built-in Sentry monitoring provider.
Sentry is the only built-in monitoring provider in this repo.
Repo Structure
The integration is split across packages:
packages/monitoring/apiselects and loads the active providerpackages/monitoring/sentrycontains the Sentry service and provider wrapperapps/web/instrumentation.tsloads monitoring instrumentation
This repo does not configure Sentry by wrapping apps/web/next.config.ts with withSentryConfig().
Required Environment Variables
NEXT_PUBLIC_MONITORING_PROVIDER=sentryNEXT_PUBLIC_SENTRY_DSN=https://your-dsn@sentry.io/project-idOptional:
NEXT_PUBLIC_SENTRY_ENVIRONMENT=productionSENTRY_RELEASE=1.0.0Key Files
apps/web/instrumentation.tspackages/monitoring/api/src/components/provider.tsxpackages/monitoring/api/src/server.tspackages/monitoring/sentry/src/sentry.client.config.tspackages/monitoring/sentry/src/sentry.server.config.tspackages/monitoring/sentry/src/services/sentry-monitoring.service.ts
Runtime Behavior
- client code gets a Sentry-backed monitoring context through
MonitoringProvider - server code gets a Sentry-backed service through
getServerMonitoringService() - if no provider is configured, monitoring falls back to the console service