migu_music_server/app/other/router/monitor.go

24 lines
499 B
Go
Raw Normal View History

2025-03-28 06:07:20 +00:00
package router
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/go-admin-team/go-admin-core/tools/transfer"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
func init() {
routerNoCheckRole = append(routerNoCheckRole, registerMonitorRouter)
}
// 需认证的路由代码
func registerMonitorRouter(v1 *gin.RouterGroup) {
v1.GET("/metrics", transfer.Handler(promhttp.Handler()))
//健康检查
v1.GET("/health", func(c *gin.Context) {
c.Status(http.StatusOK)
})
}