1 Star 1 Fork 0

kade/library

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
metric.go 499 Bytes
一键复制 编辑 原始数据 按行查看 历史
kade 提交于 9个月前 . v2.0.0
package metric
import (
"gitee.com/go-kade/library/v2/ioc/config/gogin"
"gitee.com/go-kade/library/v2/ioc/config/http"
"github.com/gin-gonic/gin"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
func (h *ginHandler) Registry() {
r := gogin.InitRouter(h)
r.GET("/", func(ctx *gin.Context) {
// 基于标准库 包装了一层
promhttp.Handler().ServeHTTP(ctx.Writer, ctx.Request)
})
h.log.Info().Msgf("Get the Metric using http://%s%s", http.Get().Addr(), h.Endpoint)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/go-kade/library.git
git@gitee.com:go-kade/library.git
go-kade
library
library
v2.0.1

搜索帮助