mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Handle missing exceptions in WebMvcMetricsFilter
Prior to this commit, exceptions nested in `NestedServletExceptions` would not be recorded by the `WebMvcMetricsFilter`. This commit ensures that exceptions happening downstream (e.g. happening while writing the response body itself) are properly recorded. See https://github.com/micrometer-metrics/micrometer/issues/1190 See gh-16014
This commit is contained in:
parent
50d0b4df46
commit
a6ccdbe19f
@ -130,6 +130,10 @@ public class WebMvcMetricsFilter extends OncePerRequestFilter {
|
||||
record(timingContext, response, request, ex.getCause());
|
||||
throw ex;
|
||||
}
|
||||
catch (ServletException | IOException | RuntimeException ex) {
|
||||
record(timingContext, response, request, ex);
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
private TimingContext startAndAttachTimingContext(HttpServletRequest request) {
|
||||
|
Loading…
Reference in New Issue
Block a user