immobiliare / fastify-metrics

πŸ“Š Fastify plugin that integrates metrics collection and dispatch to statsd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

500 error codes on 404

dnlup opened this issue Β· comments

commented

A 404 generates an internal server error because the plugin tries to send a metric using the reply decorator, which in turn checks for the presence of a routeId inside the metrics object. This object is not setup for a route that doesn't exists because we use the onRoute hook to do it. We should take this into account in the onError hook.

commented

While I am working on it, I see that every hook has this problem, not just the onError one. So I think we should move the check inside the decorators.

I think we can check in both cases.

πŸŽ‰ This issue has been resolved in version 2.0.0 πŸŽ‰

The release is available on:

Your semantic-release bot πŸ“¦πŸš€