接入运维真实 metrics:负载、请求错误率与服务探测

- 新增 GET /admin/ops/metrics 与进程内请求统计中间件
- 运维页展示 CPU/内存/磁盘、24h 曲线与 WS/DB/存储状态
- 去掉未使用的消息队列占位项
This commit is contained in:
yml2213
2026-07-15 15:01:18 +08:00
parent a1336c630b
commit 9251815695
14 changed files with 797 additions and 248 deletions
+3
View File
@@ -8,6 +8,7 @@ import (
"github.com/gin-gonic/gin"
"kefu-sys/server/internal/config"
"kefu-sys/server/internal/handler"
"kefu-sys/server/internal/metrics"
"kefu-sys/server/internal/middleware"
"kefu-sys/server/internal/model"
"kefu-sys/server/internal/storage"
@@ -43,6 +44,8 @@ func main() {
gin.SetMode(cfg.Server.Mode)
r := gin.Default()
// 全站请求统计(运维监控 24h 曲线)
r.Use(metrics.Middleware())
// CORS
r.Use(func(c *gin.Context) {