feat(observability): integrate Sentry error tracking for API and Web apps
- API: add @sentry/nestjs with instrument.ts, SentryModule, and SentryGlobalFilter - Web: add @sentry/nextjs with client/server/edge configs, instrumentation hook - Update next.config.js with withSentryConfig wrapper - Replace TODO in error.tsx with Sentry.captureException - Add SENTRY_DSN, SENTRY_AUTH_TOKEN, SENTRY_ORG, SENTRY_PROJECT to .env.example Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import * as Sentry from '@sentry/nextjs';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
export default function GlobalError({
|
||||
@@ -10,11 +11,8 @@ export default function GlobalError({
|
||||
reset: () => void;
|
||||
}) {
|
||||
useEffect(() => {
|
||||
// Report to error tracking service in production; log digest only
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
// TODO: integrate with Sentry/Datadog when available
|
||||
// errorReporter.captureException(error);
|
||||
} else {
|
||||
Sentry.captureException(error);
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
console.error('Unhandled error:', error);
|
||||
}
|
||||
}, [error]);
|
||||
|
||||
Reference in New Issue
Block a user