mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-21 10:13:01 +00:00
refactor🎨:系统监控接口
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
package router
|
package router
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/go-admin-team/go-admin-core/sdk/config"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
@@ -15,11 +14,10 @@ func init() {
|
|||||||
|
|
||||||
// 需认证的路由代码
|
// 需认证的路由代码
|
||||||
func registerMonitorRouter(v1 *gin.RouterGroup) {
|
func registerMonitorRouter(v1 *gin.RouterGroup) {
|
||||||
if config.ApplicationConfig.Mode == "dev" {
|
v1.GET("/metrics", transfer.Handler(promhttp.Handler()))
|
||||||
v1.GET("/metrics", transfer.Handler(promhttp.Handler()))
|
//健康检查
|
||||||
//健康检查
|
v1.GET("/health", func(c *gin.Context) {
|
||||||
v1.GET("/health", func(c *gin.Context) {
|
c.Status(http.StatusOK)
|
||||||
c.Status(http.StatusOK)
|
})
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user