Skip to content

Commit

Permalink
fix duplicated metrics
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <rleungx@gmail.com>
  • Loading branch information
rleungx committed Nov 3, 2023
1 parent 689fcbe commit f754ae1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/mcs/resourcemanager/server/apis/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ func NewService(srv *rmserver.Service) *Service {
c.Set(multiservicesapi.ServiceContextKey, manager.GetBasicServer())
c.Next()
})
apiHandlerEngine.Use(multiservicesapi.ServiceRedirector())
apiHandlerEngine.GET("metrics", utils.PromHandler())
pprof.Register(apiHandlerEngine)
endpoint := apiHandlerEngine.Group(APIPathPrefix)
endpoint.Use(multiservicesapi.ServiceRedirector())
s := &Service{
manager: manager,
apiHandlerEngine: apiHandlerEngine,
Expand Down
2 changes: 1 addition & 1 deletion pkg/mcs/scheduling/server/apis/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ func NewService(srv *scheserver.Service) *Service {
c.Set(handlerKey, handler.NewHandler(&server{srv.Server}))
c.Next()
})
apiHandlerEngine.Use(multiservicesapi.ServiceRedirector())
apiHandlerEngine.GET("metrics", mcsutils.PromHandler())
pprof.Register(apiHandlerEngine)
root := apiHandlerEngine.Group(APIPathPrefix)
root.Use(multiservicesapi.ServiceRedirector())
s := &Service{
srv: srv,
apiHandlerEngine: apiHandlerEngine,
Expand Down
2 changes: 1 addition & 1 deletion pkg/mcs/tso/server/apis/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ func NewService(srv *tsoserver.Service) *Service {
c.Set(multiservicesapi.ServiceContextKey, srv)
c.Next()
})
apiHandlerEngine.Use(multiservicesapi.ServiceRedirector())
apiHandlerEngine.GET("metrics", utils.PromHandler())
pprof.Register(apiHandlerEngine)
root := apiHandlerEngine.Group(APIPathPrefix)
root.Use(multiservicesapi.ServiceRedirector())
s := &Service{
srv: srv,
apiHandlerEngine: apiHandlerEngine,
Expand Down

0 comments on commit f754ae1

Please sign in to comment.