You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My application has a default handler to catch any request not fullfilled by previous middlewares (koa-static, koa-routes) in order log those requests and return a custom 404 page.
After install prometheus-api-metrics, I was surprised when request on /metrics and /metrics.json url are logged by the default handler.
Looking into middleware function I think there is a error because after fulfill the /metrics and /metrics.json queries, the function call next() to drill down on middleware chain. IMHO request must be finished in this point, don't propagate the request and return the stats.
As workaround, you can define these paths in your router and do nothing. This allow the response generated by the middleware to be returned and not be overwritten by default handler.
My application has a default handler to catch any request not fullfilled by previous middlewares (koa-static, koa-routes) in order log those requests and return a custom 404 page.
After install prometheus-api-metrics, I was surprised when request on /metrics and /metrics.json url are logged by the default handler.
Looking into middleware function I think there is a error because after fulfill the /metrics and /metrics.json queries, the function call next() to drill down on middleware chain. IMHO request must be finished in this point, don't propagate the request and return the stats.
As workaround, you can define these paths in your router and do nothing. This allow the response generated by the middleware to be returned and not be overwritten by default handler.
Regards,
Manuel
The text was updated successfully, but these errors were encountered: