internal/cloudapi: register status code middleware
Register the custom middleware function to the cloudapi server. This function is responsible for recording all the status codes of all the server's endpoints.
This commit is contained in:
parent
8756ea717d
commit
8b5458ae83
1 changed files with 3 additions and 1 deletions
|
|
@ -87,7 +87,9 @@ func (s *Server) Handler(path string) http.Handler {
|
|||
handler := apiHandlers{
|
||||
server: s,
|
||||
}
|
||||
RegisterHandlers(e.Group(path, prometheus.MetricsMiddleware, s.ValidateRequest), &handler)
|
||||
|
||||
statusMW := prometheus.StatusMiddleware(prometheus.ComposerSubsystem)
|
||||
RegisterHandlers(e.Group(path, prometheus.MetricsMiddleware, s.ValidateRequest, statusMW), &handler)
|
||||
|
||||
return e
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue