4ece85a9c3
- 新增生产环境部署脚本和文档 - 添加监控系统配置(Alertmanager, Prometheus, Grafana) - 更新e2e测试用例以适配新环境 - 添加.env.production配置文件 - 优化Sentry初始化逻辑为动态加载 - 新增全局设置脚本以支持不同环境
16 lines
490 B
TypeScript
16 lines
490 B
TypeScript
export function initSentry() {
|
|
if (process.env.NODE_ENV === 'production' && process.env.NEXT_PUBLIC_SENTRY_DSN) {
|
|
import('@sentry/nextjs').then(({ init }) => {
|
|
init({
|
|
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
|
|
environment: process.env.NODE_ENV,
|
|
tracesSampleRate: 0.1,
|
|
replaysSessionSampleRate: 0.1,
|
|
replaysOnErrorSampleRate: 1.0,
|
|
});
|
|
}).catch((error) => {
|
|
console.error('Failed to initialize Sentry:', error);
|
|
});
|
|
}
|
|
}
|