Skip to content

Commit

Permalink
mcs: fix duplicated metrics (#7319)
Browse files Browse the repository at this point in the history
close #7290

Signed-off-by: Ryan Leung <[email protected]>
  • Loading branch information
rleungx committed Nov 6, 2023
1 parent 689fcbe commit ab8bf7b
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 ab8bf7b

Please sign in to comment.