feat: 添加生产环境部署和监控配置

- 新增生产环境部署脚本和文档
- 添加监控系统配置(Alertmanager, Prometheus, Grafana)
- 更新e2e测试用例以适配新环境
- 添加.env.production配置文件
- 优化Sentry初始化逻辑为动态加载
- 新增全局设置脚本以支持不同环境
This commit is contained in:
张翔
2026-03-09 16:37:23 +08:00
parent 261c45b4d9
commit 4ece85a9c3
14 changed files with 950 additions and 356 deletions
+10 -8
View File
@@ -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);
});
}
}