352 Commits

Author SHA1 Message Date
Andy Wilkinson
7ddbb37bd5 Polish 2018-11-26 16:52:49 +00:00
Andy Wilkinson
d2756319cb Polish 2018-11-26 12:09:14 +00:00
Andy Wilkinson
4bc32e6358 Use a HandlerInterceptor for timing long tasks
Closes gh-15204
2018-11-26 11:30:06 +00:00
Phillip Webb
e4d5714d50 Polish "Skip scoped targets when determining endpoints"
See gh-15182
2018-11-15 10:41:14 -08:00
Rahul Ahuja
4853e6a7af Skip scoped targets when determining endpoints
Update `EndpointDiscoverer` to filter out scoped target beans when
finding endpoints.

Closes gh-15182
2018-11-15 10:38:05 -08:00
Johnny Lim
8470d649bc Polish
See gh-15134
2018-11-11 10:58:31 +01:00
Phillip Webb
33c7a74bee Update copyright year for changed files 2018-10-26 16:35:28 -07:00
Phillip Webb
7bcc793faf Fix WebMvcMetricsFilter logger imports
Don't use SLF4J loggers in `WebMvcMetricsFilter`.

Fixes gh-14953
2018-10-24 22:46:31 -07:00
Madhura Bhave
4322b9781b Polish 2018-10-23 14:21:06 -07:00
dreis2211
5c0d7f4ac0 Avoid creation of unnecessary collections
Closes gh-14916
2018-10-22 14:54:39 -07:00
Andy Wilkinson
2110215559 Provide more detailed uri tag for calls to Data REST repositories
Closes gh-14872
2018-10-19 18:19:58 +01:00
Andy Wilkinson
76ad197584 Deallocate servlet after forcing initialization in mappings endpoint
Previously, when using Tomcat, a call to mappings endpoint would force
the initialization of any DispatcherServlets in the context. This was
done by calling allocate on Tomcat's StandardWrapper. This left the
wrapper in a state that would cause it to block for two seconds during
shutdown as the wrapper has an outstanding allocation.

This commit immediately deallocates the servlet after it has been
allocated. This ensures that the DispatcherServlet has been initialized
while also leaving the wrapper in a state that it can shut down
immediately when asked to do so.

Closes gh-14898
2018-10-19 10:43:23 +01:00
Phillip Webb
a12a6f2ade Polish 2018-10-15 21:24:35 -07:00
Phillip Webb
cd1c2638e5 Polish 2018-10-15 15:42:15 -07:00
Phillip Webb
5d219bcd19 Polish 2018-10-15 14:45:49 -07:00
Phillip Webb
b25e222136 Retain original case when mapping endpoint paths
Update `MappingWebEndpointPathMapper` to keep the original case rather
than using a lower-case version.

Closes gh-14773
2018-10-15 14:20:16 -07:00
Phillip Webb
c306e03112 Support '-' in endpoint names
Update the `EndpointId` constraints to allow '-' in names.

Closes gh-14773
2018-10-15 11:27:30 -07:00
Phillip Webb
d8b9685635 Support '.' in endpoint names
Update the `EndpointId` constraints to allow '.' in names.

Closes gh-14773
2018-10-15 09:37:44 -07:00
Andy Wilkinson
6d98851fb5 Use Couchbase's DiagnosticsReport to determine its health
Previously, Couchbase's health was determined by retrieving the bucket info
from the cluster info. This retrieval could take over one minute in some
cases even when Couchbase is health. This latency is too large for a health
check.

The Couchbase team have recommended the of a Cluster#diagnostics instead.
This provides a much lower latency view of the cluster's health. This
commit updates CouchbaseHealthIndicator to use Cluster#diagnostics while
retaining support, in a deprecated form, for the old info-based mechanism
should anyone want to opt back into that in 2.0.x.

Closes gh-14685
2018-10-15 13:44:42 +01:00
Hanope
535dd7470f Fix typo in EndpointIdTests
Closes gh-14822
2018-10-14 19:11:56 -07:00
Phillip Webb
df5dfbf4be Support mixed case endpoint includes/excludes
Update `ExposeExcludePropertyEndpointFilter` so that mixed case
endpoint IDs are supported. Prior to this commit it was not easy for
an endpoint to be missed by the filter due to the formatting of the
property value.

See gh-14773
2018-10-14 13:45:05 -07:00
Phillip Webb
138d85477d Support mixed case endpoint IDs with time-to-live
Update the endpoint time-to-live binding logic so that mixed case
endpoint IDs are supported. Prior to this commit an
`InvalidConfigurationPropertyNameException` would be thrown when using
a camel case endpoint ID.

See gh-14773
2018-10-14 13:45:04 -07:00
Phillip Webb
3105a38884 Introduce EndpointID to enforce naming rules
Add an `EndpointID` class to enforce the naming rules that we support
for actuator endpoints. We now ensure that all endpoint names contain
only letters and numbers and must begin with a lower-case letter.

Existing public classes and interfaces have been changes so that String
based `endpointId` methods are deprecated and strongly typed versions
are preferred instead. A few public classes that we're not expecting
to be used directly have been changed without deprecated methods being
introduced.

See gh-14773
2018-10-14 13:45:04 -07:00
Phillip Webb
c5786c218d Polish 2018-10-14 11:24:10 -07:00
Phillip Webb
30ab4f9691 Polish "Stop MetricsEndpoint from summing up same metrics"
See gh-14497
2018-10-11 15:31:40 -07:00
pmehra
950480dc1c Stop MetricsEndpoint from summing up same metrics
Update `MetricsEndpoint` so that only the first matching meter is used
when calculating the sum of of statistics.

Prior this this commit the endpoint would consider all Meters. This
caused incorrect statistics when multiple back-end systems were being
used since the registries contained in the `CompositeMeterRegistry`
would be  iterated, and the same effective metric would be counted more
than once.

Closes gh-14497
2018-10-11 15:18:35 -07:00
Andy Wilkinson
839e686c9e Fix Checkstyle violation 2018-10-10 12:43:06 +01:00
Andy Wilkinson
9e14fc6b8b Cope with hanging call to connection.start() in JmsHealthIndicator
Previously, if the call to connection.start() hung, JmsHealthIndicator
would also hang and then never respond.

This commit introduces the use of an additional thread that waits for
up to 5 seconds for the connection to start. If the call to start
does not complete within that time, the connection is closed. The
call to close causes the call to start to throw an exception, thereby
stopping the hang and allowing the indicator to report that the
broker is down.

Closes gh-10809
2018-10-10 12:20:34 +01:00
Andy Wilkinson
d3b3c8c64e Honour management.metrics.web.server.auto-time-requests with WebFlux
Closes gh-13895
2018-10-08 15:52:50 +01:00
Johnny Lim
1eca492c5e Polish
See gh-14621
2018-10-01 10:46:27 -04:00
Andy Wilkinson
6fba477d5e Remove redundant handling of a null exchange from WebFluxTags.uri()
Closes gh-14504
2018-09-18 11:59:19 +01:00
Andy Wilkinson
6020cb67d3 Polish javadoc of status method on WebFluxTags and WebMvcTags 2018-09-18 11:30:35 +01:00
Phillip Webb
9af6b3422f Polish 2018-09-04 16:18:47 -07:00
Johnny Lim
ca57e58ee5 Polish
See gh-14293
2018-09-04 08:52:13 +02:00
Johnny Lim
3eef927499 Use InvalidEndpointRequestException for MetricsEndpoint
Closes gh-14291
2018-09-04 08:33:33 +02:00
Stephane Nicoll
f9081a2c23 Revert "Polish some joining collectors"
See gh-14221
2018-08-29 17:37:33 +02:00
dreis2211
afda71e419 Polish some joining collectors
Closes gh-14221
2018-08-28 17:17:46 +02:00
Madhura Bhave
b93c2b9a9f Allow actuator endpoints to be used with mvcMatchers
This commit changes AbstractWebMvcEndpointHandlerMapping to
be a MatchableHandlerMapping. Additionally, EndpointRequest,
now delegates to MvcRequestMatcher for Spring MVC applications.

For all other applications, AntPathRequestMatcher is used as
a delegate.

Closes gh-13962
2018-08-16 15:41:02 -07:00
Andy Wilkinson
3e093035b4 Merge branch '1.5.x' into 2.0.x 2018-08-16 10:18:52 +01:00
Johnny Lim
5f3f1a1f11 Polish
Closes gh-14067
2018-08-15 16:54:46 -07:00
Johnny Lim
b4abccc07c Polish
See gh-14049
2018-08-15 10:43:04 +03:00
Andy Wilkinson
27f5e46587 Polish "Fix NPE in FlywayEndpoint when migration.installedOn is null"
Closes gh-14019
2018-08-09 11:10:21 +01:00
artsiom
83fbdc6ea8 Fix NPE in FlywayEndpoint when migration.installedOn is null
See gh-14019
2018-08-09 11:10:02 +01:00
Stephane Nicoll
a023bd030a Add configurable timeout for Couchbase health indicator
This commit makes sure to use a configurable timeout to check if the
Couchbase cluster is up, rather than relying on the default that can be
quite long.

Closes gh-13879
2018-08-08 16:01:58 +02:00
Stephane Nicoll
fbf3c48bf8 Fix setter detection in configprops endpoint
Previously, the setter of a property whose second letter is upper-case (
such as `oAuth2Uri`) was not detected properly. The JavaBean spec states
that, in such a case, the first letter should not be capitalized (i.e.
the setter should be `setoAuth2Uri` rather than `setOAuth2Uri`).

This commit makes sure that Jackson uses standard bean names and fixes
the setter detection algorithm to take this case into account.

Closes gh-13878
2018-08-08 11:13:03 +02:00
Stephane Nicoll
f731f6aa39 Restore customization of HTTP trace request headers
This commit restore the use of the `postProcessRequestHeaders` method
when overridden in a custom HttpExchangeTracer implementation.

Closes gh-13924
2018-08-06 18:35:12 +02:00
Stephane Nicoll
4e45f36bd1 Clean basePath if necessary
This commit makes sure that ServletEndpointRegistrar does not add a
duplicate `/` if the basePath is suffixed with it already

Close gh-13964
2018-08-01 10:58:40 +02:00
Phillip Webb
aeb885192e Polish ternary expressions 2018-07-29 09:24:46 +01:00
Phillip Webb
63b609827e Fix checkstyle method order issues
Fix checkstyle issues with method ordering following the
spring-javaformat upgrade.

See gh-13932
2018-07-28 01:11:53 +01:00
Phillip Webb
e6a68b39a3 Fix checkstyle javadoc issues
Fix checkstyle issues in javadoc following the spring-javaformat
upgrade.

See gh-13932
2018-07-28 01:11:52 +01:00