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
Describe the bug
We've noticed that our log entries describe cases where we receive a 400 response (Or 404 as the default in Koa) but they are not logged in the metrics.
This seems to happen when there are errors in the form of ECONNRESET - when the underlying socket of the request throws some error.
To Reproduce
Using express, we can imitate this behavior using the following code
Expected behavior
The /metrics route to record the request to the /error route.
Additional context
It seems that the response finished event does not trigger in such cases (code)
Using a module such as https://www.npmjs.com/package/on-finished does trigger the callback and record the request correctly
The text was updated successfully, but these errors were encountered:
Hi, thanks for the issue. I lost track of responding. I think it makes sense tracking such errors but it's also on the boundary of what logging is for to me. Cause in terms of labelling the response they're not the regular 404. Or at least I'd like to now if the 404 was sent or a ECONNRESET.
Maybe it should be another metric which contains these by error and status code. Do you have any preference here?
Note, it would be nice to start with a test case proving that it doesn't work. Then we could make the test pass. Would you be able to contribute on this issue yourself?
Describe the bug
We've noticed that our log entries describe cases where we receive a 400 response (Or 404 as the default in Koa) but they are not logged in the metrics.
This seems to happen when there are errors in the form of ECONNRESET - when the underlying socket of the request throws some error.
To Reproduce
Using express, we can imitate this behavior using the following code
Expected behavior
The
/metrics
route to record the request to the/error
route.Additional context
It seems that the response finished event does not trigger in such cases (code)
Using a module such as https://www.npmjs.com/package/on-finished does trigger the callback and record the request correctly
The text was updated successfully, but these errors were encountered: