Files
awoooi/apps/web/sentry.server.config.ts
Your Name cdcd79eeba
All checks were successful
Code Review / ai-code-review (push) Successful in 15s
CD Pipeline / tests (push) Successful in 1m33s
CD Pipeline / build-and-deploy (push) Successful in 7m39s
CD Pipeline / post-deploy-checks (push) Successful in 2m14s
fix(publicenv): redact public host aliases
2026-06-13 08:13:17 +08:00

32 lines
662 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* Sentry Server Configuration
* ===========================
* Next.js Server-Side 錯誤追蹤
*
* 部署: Self-Hosted 內部來源(僅 runtime
*/
import * as Sentry from '@sentry/nextjs'
if (process.env.SENTRY_DSN) {
Sentry.init({
dsn: process.env.SENTRY_DSN,
// 環境標識
environment: process.env.NODE_ENV,
// Server-side 效能監控
tracesSampleRate: process.env.NODE_ENV === 'production' ? 0.2 : 1.0,
// 忽略常見的非錯誤
ignoreErrors: [
'ECONNREFUSED',
'ENOTFOUND',
'ETIMEDOUT',
],
// 只在生產環境發送
enabled: process.env.NODE_ENV === 'production',
})
}