288 Commits

Author SHA1 Message Date
Stephane Nicoll
b0433d66c1 Merge branch '2.0.x' 2018-05-11 14:24:13 +02:00
dreis2211
e6a23fa3ff Remove unnecessary semicolons
Closes gh-13144
2018-05-11 14:23:47 +02:00
Stephane Nicoll
c72df104d8 Improve caches endpoint format
This commit adds an intermediate "caches" element so that additional
cache manager attributes can be added in the future.

Closes gh-13079
2018-05-09 11:08:23 +02:00
Andy Wilkinson
a41c9eb736 Merge branch '2.0.x' 2018-05-09 09:14:48 +01:00
Andy Wilkinson
c826310fd1 Polish 2018-05-09 08:44:15 +01:00
Johnny Lim
96ce71ddc4 Polish
Closes gh-13078
2018-05-07 14:55:13 +02:00
Phillip Webb
c578a30e90 Polish 2018-05-04 23:12:42 -07:00
Phillip Webb
a323a85e3b Merge branch '2.0.x' 2018-05-04 20:06:55 -07:00
Phillip Webb
975e986fef Polish 2018-05-04 20:06:27 -07:00
Phillip Webb
7b120c1c97 Formatting 2018-05-04 16:36:35 -07:00
Phillip Webb
42c053cf1b Merge branch '2.0.x' 2018-05-04 16:31:46 -07:00
Phillip Webb
5b3cb8a698 Update copyright header year for changed files 2018-05-04 15:59:26 -07:00
Phillip Webb
57bfbfb3ad Fix checkstyle errors 2018-05-04 15:58:59 -07:00
Phillip Webb
6e09e497f2 Formatting 2018-05-04 12:06:19 -07:00
Phillip Webb
b6a2a46f78 Merge branch '2.0.x' 2018-05-03 23:54:42 -07:00
Phillip Webb
2d70a7ae5e Polish caught exception names
Prefer `ex` over `e`.
2018-05-03 22:43:32 -07:00
Phillip Webb
41efea51a7 Polish ternary expressions
Consistently format ternary expressions and always favor `!=` as the
the check.
2018-05-03 22:43:12 -07:00
Phillip Webb
8c0c0ee55a Merge branch '2.0.x' 2018-05-03 12:44:58 -07:00
Phillip Webb
e125085993 Merge branch '1.5.x' into 2.0.x 2018-05-03 12:43:50 -07:00
Andy Wilkinson
0526594a3c Merge branch '2.0.x' 2018-05-02 12:26:23 +01:00
Andy Wilkinson
f019d5c85b Merge branch '1.5.x' into 2.0.x 2018-05-02 12:22:04 +01:00
Stephane Nicoll
fb8a5a9864 Polish "Add cache actuator endpoint"
This commit improves the initial proposal by providing a by name read
operation that returns the detail of a particular cache. It also adds
more tests and complete API documentation for the feature.

Closes gh-12216
2018-04-30 16:34:00 +02:00
Johannes Edmeier
1a57673345 Add cache actuator endpoint
This commits adds an actuator endpoint which lists the caches per
context and cacheManager and provides a delete operation to clear the
caches. As the statistics are exposed via the metrics endpoint they are
not included

See gh-12216
2018-04-30 16:34:00 +02:00
Brian Clozel
1ef0098ab5 Add WebClient metrics support
This commit adds support for Actuator Metrics for WebClient.
This support mirrors the current behavior for `RestTemplate`, reusing
the same metric name `"http.client.requests"` and tags.

`WebClient` is instrumented by a `MetricsWebClientFilterFunction` which
is applied by a `WebClientCustomizer`. This instrumentation happens
automatically only if you create an instance of `WebClient` using an
auto-configured `WebClient.Builder` bean.

This infrastructure is reusing de facto the `MeterFilter` that has been
added for `RestTemplate` in order to limit the "uri" tag cardinality.

Closes gh-12228
2018-04-27 13:54:14 +02:00
Stephane Nicoll
03cf4fbb10 Polish "Add actuator endpoint for exposing the Spring Integration graph"
Closes gh-12331
2018-04-25 16:16:43 +02:00
Tim Ysewyn
8c67ef1079 Add actuator endpoint for exposing the Spring Integration graph
See gh-12331
2018-04-25 16:16:43 +02:00
Stephane Nicoll
2b98b11c12 Polish "Less object instantiation in WebMvcTags"
Closes gh-12894
2018-04-18 09:41:40 +02:00
Jon Schneider
d676147680 Less object instantiation in WebMvcTags
See gh-12894
2018-04-18 09:38:23 +02:00
Stephane Nicoll
0bc7bef5e5 Properly handle InvalidEndpointRequestException
This commit makes sure that `InvalidEndpointRequestException` is wrapped
in a `ReflectionException` when invoked via JMX.

Closes gh-12857
2018-04-16 11:33:22 +02:00
dreis2211
2bbf438c36 Fix duplicate words in comments
Closes gh-12866
2018-04-16 08:09:40 +02:00
Stephane Nicoll
fa542bacc0 Translate user-defined exception when invoking JMX operation
This commit makes sure to respect the MBeanServer#invoke contract by
wrapping any user-defined exception in an MBeanException. Also, any
exception not from the JDK is translated, as it may lead to unexpected
issue on the client if that class isn't present. This is consistent
with our operation result mapping strategy.

Closes gh-10448
2018-04-13 16:26:04 +02:00
Brian Clozel
b2e7be17ab Polish gh-11514
As pointed out by Rossen in gh-11514 comments, a handler might commit
the response and then send an error signal in the pipeline. In this
case, adding a callback to `beforeCommit` is useless because it won't be
triggered. In those cases, we need to collect metrics right away.
2018-04-12 22:50:16 +02:00
Brian Clozel
3fa8fe85af Deprecate RouterFunctionMetrics
Spring Boot now deploys both annotation-based and functional endpoints
under the same `HttpHandler`; this means the currently auto-configured
`MetricsWebFilter` is instrumenting all endpoints to produce metrics.

There is no need for a WebFlux functional specific support.
This commit removes mentions of `RouterFunctionMetrics` in the docs and
deprecates that class.

Closes gh-12833
2018-04-12 12:08:44 +02:00
Brian Clozel
77be10e7bc Fix "status" metrics tag for error responses
Prior to this commit, the metrics `WebFilter` would handle exceptions
flowing through the pipeline and extract tag information right away.
Since error handling turns the exception information into error HTTP
responses later in the chain, the information extracted from the
response earlier is invalid.
In this case, the "status" information could be "200" whereas error
handlers would later set that status to "500".

This commit delays the tags extraction later in the process, right
before the response is comitted. The happy path is not changed, as
handlers signal that the response is fully taken care of at that point.

Fixes gh-11514
2018-04-12 11:30:43 +02:00
Stephane Nicoll
e8fac7d9c4 Properly discover endpoints that are proxied
Previously to this commit, if a `@ControllerEndpoint`,
`@RestControllerEndpoint` or `@ServletEndpoint` annotated bean was
proxied, the endpoint wasn't properly detected.

This commit makes sure that annotation retrieval works on the user class
while preserving the get (vs. find) retrieval semantic

Closes gh-12441
2018-04-10 20:23:55 +02:00
Stephane Nicoll
86b96254a1 Migrate to ApplicationContextRunner 2018-04-10 20:23:54 +02:00
Johnny Lim
f03849d502 Polish
See gh-12812
2018-04-10 11:46:16 +02:00
Andy Wilkinson
8d5b9f37d5 Merge branch '1.5.x' 2018-04-09 17:59:53 +01:00
Phillip Webb
598e9bb842 Polish 2018-04-04 18:01:25 -07:00
Brian Clozel
f6d16c8b99 Align WebFluxTags uri support on WebMvcTags
This commit ensures that `WebFluxTags` not only relies on
`BEST_MATCHING_PATTERN_ATTRIBUTE` or request URI to provide the "uri"
tag information.

To avoid cardinality explosion, HTTP not found and redirects are
assigned fixed uri tags.

Closes gh-12685
2018-04-04 11:46:10 +02:00
Phillip Webb
98a2a91d16 Polish 2018-03-29 14:00:13 -07:00
Brian Clozel
ebb2f70e0b Make WebMvgTags use matched patterns for HTTP 404
Prior to this commit, `WebMvcTags' would always mark as "NOT_FOUND" or
"REDIRECTION" *any* exchange with responses of 404 and 3xx status, even
if those responses are actually returned by Controller handlers.

This commit checks inverts those checks and first considers if the
"BEST_MATCHING_PATTERN_ATTRIBUTE" request attribute is present and uses
it - then falls back to "NOT_FOUND" and "REDIRECTION" to avoid
cardinality explosion.

Fixes gh-12577
2018-03-29 20:33:07 +02:00
Madhura Bhave
8b29823885 Prevent StackOverFlowException in metadata processor
Fixes gh-11037
2018-03-28 07:58:13 -07:00
dreis2211
3b0f6e7168 Use Supplier variants of Assert methods
See gh-12630
2018-03-26 17:58:17 +02:00
Johnny Lim
625bf93598 Polish
See gh-12584
2018-03-26 17:33:25 +02:00
Phillip Webb
78534a753d Polish "Iterate map by using lambda function"
See gh-12528
2018-03-19 08:00:36 -04:00
igor-suhorukov
ffc883b005 Iterate map by using lambda function
Closes gh-12528
2018-03-19 07:50:54 -04:00
Phillip Webb
6e2ecb8a43 Fix broken endpoint integration tests
Ensure that JSON response is returned when extracting data from the
error details.

See gh-12513
2018-03-17 12:29:39 -07:00
Andy Wilkinson
2da4897aa8 Polish 2018-03-16 09:57:35 +00:00
Johnny Lim
2e6914ea88 Add missing super() calls
Closes gh-12459
2018-03-14 15:56:53 -07:00