* feat: add Sentry error monitoring, tracing, and session replay - Install @sentry/react and @sentry/vite-plugin - Create instrument.ts with error monitoring, browser tracing (20% prod), and session replay (10% sessions, 100% on errors) - Wire React 19 reactErrorHandler() on createRoot error hooks - Wrap router with wrapCreateBrowserRouterV7 for route-aware transactions - Configure sentryVitePlugin for source map uploads - Add VITE_SENTRY_DSN to .env.example Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add Sentry error monitoring and tracing to FastAPI backend - Install sentry-sdk[fastapi] with auto-enabled FastAPI + Anthropic integrations - Init before app = FastAPI() with env-aware sample rates (100% dev, 20% prod) - Filter /health endpoint from traces to reduce noise - Add SENTRY_DSN to config settings Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
34 lines
933 B
TypeScript
34 lines
933 B
TypeScript
import "./instrument"; // Sentry must init before any other imports
|
|
|
|
import { StrictMode } from 'react'
|
|
import { createRoot } from 'react-dom/client'
|
|
import { reactErrorHandler } from '@sentry/react'
|
|
import { HelmetProvider } from 'react-helmet-async'
|
|
import { Toaster } from 'sonner'
|
|
import './index.css'
|
|
import App from './App'
|
|
|
|
createRoot(document.getElementById('root')!, {
|
|
onUncaughtError: reactErrorHandler(),
|
|
onCaughtError: reactErrorHandler(),
|
|
onRecoverableError: reactErrorHandler(),
|
|
}).render(
|
|
<StrictMode>
|
|
<HelmetProvider>
|
|
{/* Toast notification system - theme syncs automatically via CSS custom properties */}
|
|
<Toaster
|
|
position="top-right"
|
|
expand={false}
|
|
closeButton
|
|
visibleToasts={3}
|
|
gap={8}
|
|
theme="dark"
|
|
toastOptions={{
|
|
className: 'sonner-toast-custom',
|
|
}}
|
|
/>
|
|
<App />
|
|
</HelmetProvider>
|
|
</StrictMode>,
|
|
)
|