Merge branch '2.4.x' into 2.5.x

This commit is contained in:
Phillip Webb
2021-09-21 11:17:55 -07:00
9 changed files with 43 additions and 24 deletions

View File

@@ -105,11 +105,15 @@ public class WebMvcMetricsFilter extends OncePerRequestFilter {
}
catch (Exception ex) {
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
record(timingContext, request, response, (ex instanceof NestedServletException) ? ex.getCause() : ex);
record(timingContext, request, response, unwrapNestedServletException(ex));
throw ex;
}
}
private Throwable unwrapNestedServletException(Throwable ex) {
return (ex instanceof NestedServletException) ? ex.getCause() : ex;
}
private TimingContext startAndAttachTimingContext(HttpServletRequest request) {
Timer.Sample timerSample = Timer.start(this.registry);
TimingContext timingContext = new TimingContext(timerSample);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.