Creating a Custom Monitoring Provider

Extend the monitoring abstraction with your own provider.

If you need a provider other than Sentry, add it through the monitoring abstraction.

Steps

  1. Implement MonitoringService
  2. Register the provider in packages/monitoring/api/src/get-monitoring-provider.ts
  3. Register the client provider in packages/monitoring/api/src/components/provider.tsx
  4. Register the server service in packages/monitoring/api/src/services/get-server-monitoring-service.ts

Core Types

Use these files as the source of truth:

  • packages/monitoring/core/src/monitoring.service.ts
  • packages/monitoring/core/src/monitoring.context.ts
  • packages/monitoring/api/src/get-monitoring-provider.ts

Important Constraint

The provider name must be added to the MONITORING_PROVIDERS enum. Without that change, NEXT_PUBLIC_MONITORING_PROVIDER will be treated as invalid and the app will fall back to the console service.