Closed
Description
If any request is dealt with by a filter (e.g. something in the security chain) then it appears in the metrics as unmapped
. This makes it hard to see, for example, which endpoints clients keep failing to authenticate with (all of them, or one in particular), or the total number of requests made to an endpoint.
One solution I can see is to inject a HandlerMapping
into the filter and add this at the top of getFinalStatus
:
try {
handlerMapping.getHandler(request);
} catch (Exception ignored) { }
This then adds the appropriate attribute if the request would have been mapped to something before a filter dealt with it. As this method is private, I cannot easily just replace this behaviour.