metrics: add operation name used in metrics/tracing for middlewares (#53949)

Signed-off-by: bergquist <carl.bergquist@gmail.com>
This commit is contained in:
Carl Bergquist
2022-08-25 10:11:27 +02:00
committed by GitHub
parent 8eac5706fd
commit ab59f3cb1a
3 changed files with 30 additions and 3 deletions

View File

@@ -525,7 +525,7 @@ func (hs *HTTPServer) applyRoutes() {
// then add view routes & api routes
hs.RouteRegister.Register(hs.web, hs.namedMiddlewares...)
// lastly not found route
hs.web.NotFound(middleware.ReqSignedIn, hs.NotFoundHandler)
hs.web.NotFound(middleware.ProvideRouteOperationName("notfound"), middleware.ReqSignedIn, hs.NotFoundHandler)
}
func (hs *HTTPServer) addMiddlewaresAndStaticRoutes() {