Add method label for prometheus middleware metrics (#3226)

Co-authored-by: 蓝益尤 <lan.yiyou@intellif.com>
This commit is contained in:
SleeplessBot
2023-05-08 20:59:20 +08:00
committed by GitHub
parent 9f42eda9ff
commit a93c24ce84
3 changed files with 8 additions and 8 deletions

View File

@@ -136,7 +136,7 @@ func (ng *engine) buildChainWithNativeMiddlewares(fr featuredRoutes, route Route
chn = chn.Append(ng.getLogHandler())
}
if ng.conf.Middlewares.Prometheus {
chn = chn.Append(handler.PrometheusHandler(route.Path))
chn = chn.Append(handler.PrometheusHandler(route.Path, route.Method))
}
if ng.conf.Middlewares.MaxConns {
chn = chn.Append(handler.MaxConnsHandler(ng.conf.MaxConns))