prometheus metrics

Former-commit-id: abcbf3ec885c162e55dd709ec702a8a3d3a81988
This commit is contained in:
zhangwei 2024-03-27 09:46:25 +08:00
parent 496a3757c6
commit 1f61eb7e12
1 changed files with 2 additions and 7 deletions

View File

@ -1,16 +1,11 @@
package core
import (
"gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/core"
"github.com/prometheus/client_golang/prometheus/promhttp"
"gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc"
"gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result"
"net/http"
)
func MetricsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
l := core.NewMetricsLogic(r.Context(), svcCtx)
err := l.Metrics()
result.HttpResult(r, w, nil, err)
}
return promhttp.Handler().ServeHTTP
}