feat: 添加生产环境部署和监控配置
- 新增生产环境部署脚本和文档 - 添加监控系统配置(Alertmanager, Prometheus, Grafana) - 更新e2e测试用例以适配新环境 - 添加.env.production配置文件 - 优化Sentry初始化逻辑为动态加载 - 新增全局设置脚本以支持不同环境
This commit is contained in:
+10
-8
@@ -1,13 +1,15 @@
|
||||
import * as Sentry from '@sentry/nextjs';
|
||||
|
||||
export function initSentry() {
|
||||
if (process.env.NODE_ENV === 'production' && process.env.NEXT_PUBLIC_SENTRY_DSN) {
|
||||
Sentry.init({
|
||||
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
|
||||
environment: process.env.NODE_ENV,
|
||||
tracesSampleRate: 0.1,
|
||||
replaysSessionSampleRate: 0.1,
|
||||
replaysOnErrorSampleRate: 1.0,
|
||||
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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user