Sentry Integration (補強 SignOz): - Add @sentry/nextjs for frontend error tracking + session replay - Add sentry-sdk[fastapi] for backend error tracking - Create sentry.client/server/edge.config.ts - Integrate with next.config.js + instrumentation.ts - Add Sentry exception capture in FastAPI error handler - Create deployment scripts for Self-Hosted @ 192.168.0.110 CI/CD Fixes: - Fix F821 Undefined name 'Field' in incidents.py - Add NEXT_PUBLIC_API_URL env var to CI build step - Add build-arg to Docker build verification E2E Test Improvements: - Fix strict mode violations in dashboard-acceptance tests - Add timeout increase for Phase 4 demo tests - Make tests more resilient to UI variations Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
18 lines
417 B
TypeScript
18 lines
417 B
TypeScript
/**
|
|
* Next.js Instrumentation
|
|
* =======================
|
|
* Server-side 初始化 (Sentry + OpenTelemetry 並行)
|
|
*/
|
|
|
|
export async function register() {
|
|
if (process.env.NEXT_RUNTIME === 'nodejs') {
|
|
// Server-side Sentry 初始化
|
|
await import('../sentry.server.config')
|
|
}
|
|
|
|
if (process.env.NEXT_RUNTIME === 'edge') {
|
|
// Edge runtime Sentry 初始化
|
|
await import('../sentry.edge.config')
|
|
}
|
|
}
|