prometheus metrics
Former-commit-id: abcbf3ec885c162e55dd709ec702a8a3d3a81988
This commit is contained in:
parent
496a3757c6
commit
1f61eb7e12
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue