From 1f61eb7e12d434bebd183755e665f8728d68a41e Mon Sep 17 00:00:00 2001 From: zhangwei <894646498@qq.com> Date: Wed, 27 Mar 2024 09:46:25 +0800 Subject: [PATCH] prometheus metrics Former-commit-id: abcbf3ec885c162e55dd709ec702a8a3d3a81988 --- api/internal/handler/core/metricshandler.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/api/internal/handler/core/metricshandler.go b/api/internal/handler/core/metricshandler.go index b3ca8b79..bec78bfc 100644 --- a/api/internal/handler/core/metricshandler.go +++ b/api/internal/handler/core/metricshandler.go @@ -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 }