feat: 添加指标统计功能,支持QPS和QPM监控

This commit is contained in:
2025-09-26 22:04:33 +08:00
parent 0f2fb51065
commit 0f2d550a14
4 changed files with 201 additions and 2 deletions

View File

@@ -61,6 +61,7 @@ func main() {
r.Use(middleware.Recovery(logger), middleware.RequestID(), middleware.Logger(logger))
r.GET("/", proxy.HelloPage) // 欢迎页面
r.GET("/metrics", middleware.MetricsHandler) // 指标接口
r.Any("/proxy/*proxyPath", p.HandleProxyPath) // 处理 /proxy/*path 形式的请求
r.Any(":protocol/*remainder", p.HandleProtocol) // 处理 /:protocol/*remainder 形式的请求