958 Commits

Author SHA1 Message Date
Alexandre Dutra
dad9ec86d5 Add health indicator for Cassandra that uses the CqlSession
This commit provides a CassandraDriverHealthIndicator and
CassandraDriverReactiveHealthIndicator that do not require Spring Data.
As a result, a health indicator for Cassandra is provided even if the
application does not use Spring Data.

See gh-20887
2020-06-15 11:13:13 +02:00
Stephane Nicoll
554971d29b Merge branch '2.3.x'
Closes gh-21917
2020-06-15 08:42:13 +02:00
Stephane Nicoll
ee250e058a Merge branch '2.2.x' into 2.3.x
Closes gh-21916
2020-06-15 08:41:44 +02:00
Stephane Nicoll
ec8c1e3860 Update copyright year of changed files
See gh-21906
2020-06-15 08:39:51 +02:00
lltx
de897b9b72 Fix wrong property reference to keys-to-sanitize in Javadoc
See gh-21906
2020-06-15 08:39:51 +02:00
Phillip Webb
16b1d64b43 Merge branch '2.3.x'
Closes gh-21764
2020-06-08 10:30:33 -07:00
dreis2211
eeb1db2176 Use supplier assertions in availability indicator
See gh-21758
2020-06-08 10:29:28 -07:00
Phillip Webb
8a7a5929ae Merge branch '2.3.x' 2020-06-05 15:37:33 -07:00
Phillip Webb
cc50605687 Merge branch '2.2.x' into 2.3.x 2020-06-05 15:36:44 -07:00
Phillip Webb
0a05b4c9fd Update copyright year of changed files 2020-06-05 15:36:09 -07:00
Johnny Lim
cd1baf18fe Support filtered scrape for Prometheus
See gh-21545
2020-06-05 14:16:42 +02:00
Andy Wilkinson
daeca9f332 Restore Boot 2.2's compile-scoped dependencies
Fixes gh-21507
2020-06-03 12:55:11 +01:00
Stephane Nicoll
1d2d76b051 Merge branch '2.2.x'
Closes gh-21560
2020-05-25 13:52:10 +02:00
Stephane Nicoll
afcb5d54b2 Polish "Fix uri tag for empty path"
See gh-21392
2020-05-25 13:51:40 +02:00
Jon Schneider
f78f2d57e1 Fix uri tag for empty path
See gh-21392
2020-05-25 13:41:19 +02:00
Phillip Webb
fd505e516f Merge branch '2.2.x'
Closes gh-21444
2020-05-13 19:11:29 -07:00
Phillip Webb
49a21ded7a Create endpoint beans as late as possible
Update `EndpointDiscoverer` so that `@Endpoint` and `@EndpointExtension`
beans are created as late as possible.

Prior to this commit, endpoint beans and extension beans would be
created during the discovery phase which could cause early bean
initialization. The problem was especially nasty when using an embedded
servlet container since `ServletEndpointRegistrar` is loaded as the
container is initialized. This would trigger discovery and load all
endpoint beans, including the health endpoint, and all health indicator
beans.

Fixes gh-20714
2020-05-13 19:10:54 -07:00
Phillip Webb
038ae93406 Update copyright year of changed files 2020-05-13 16:48:51 -07:00
Scott Frederick
a30740f8d2 Separate server properties for message and errors
Prior to this commit, there was a property server.error.include-details
that allowed configuration of the message and errors attributes in a
server error response.

This commit separates the control of the message and errors attributes
into two separate properties named server.error.include-message and
server.error.include-binding-errors. When the message attribute is
excluded from a servlet response, the value is changed from a
hard-coded text value to an empty value.

Fixes gh-20505
2020-04-29 17:56:47 -05:00
Stephane Nicoll
ee913503b4 Tolerate Hazelcast 4
This commit updates HazelcastHealthIndicator and
HazelcastCacheMeterBinderProvider so that they work with
Hazelcast 4 while retaining compatibility with Hazelcast 3. Reflection
is used when necessary.

This commit also adds a smoke test that validates those features are
working when Hazelcast 4 is on the classpath.

Closes gh-21169
2020-04-29 13:39:54 +02:00
Brian Clozel
ec871d6752 Fix StatusAggregator static initialization
Prior to this commit, there was a cycle between `StatusAggregator` and
`SimpleStatusAggregator`, which caused a static initialization bug -
depending on which class (the implementation or its interface) was
loaded first.

This commit turns the static field of the `StatusAggregator` interface
into a static method to avoid this problem.

Fixes gh-21211
2020-04-28 21:01:14 +02:00
dreis2211
5eb5bf0a2d Polish
See gh-21009
2020-04-25 08:54:47 +02:00
Stephane Nicoll
85e9f713b0 Update copyright year of changed files
See gh-21007
2020-04-25 08:50:51 +02:00
Johnny Lim
29717423a3 Remove this keyword on member method invocations
See gh-21007
2020-04-25 08:49:44 +02:00
Phillip Webb
56711d678a Merge branch '2.2.x'
Closes gh-21083
2020-04-22 11:59:22 -07:00
Phillip Webb
102729b5e1 Merge branch '2.1.x' into 2.2.x
Closes gh-21082
2020-04-22 11:58:39 -07:00
Phillip Webb
b3d33754a5 Remove outdated FIXMEs from tests
Closes gh-19782
2020-04-22 11:55:35 -07:00
Phillip Webb
bf41da5322 Update copyright year of changed files 2020-04-21 18:12:27 -07:00
Scott Frederick
70d4994502 Disable exception details on default error views
Prior to this commit, default error responses included the message
from a handled exception. When the exception was a BindException, the
error responses could also include an errors attribute containing the
details of the binding failure. These details could leak information
about the application.

This commit removes the exception message and binding errors detail
from error responses by default, and introduces a
`server.error.include-details` property that can be used to cause
these details to be included in the response.

Fixes gh-20505
2020-04-16 10:46:36 -05:00
dreis2211
b0eea26260 Prevent shaded imports from Datastax
See gh-20967
2020-04-15 09:21:56 +02:00
Phillip Webb
5311c04437 Change HealthEndpointGroups customization support
Update the `HealthEndpointGroups` customization support to use a
post-processor rather than a mutable registry. Although this approach
is slightly less flexible, it removes a lot of complexity from the
`HealthEndpointGroups` code. Specifically, it allows us to drop the
`HealthEndpointGroupsRegistry` interface entirely.

The probe health groups are now added via the post-processor if they
aren't already defined. Unlike the previous implementation, users are
no longer able to customize status aggregation and http status code
mapping rules _unless_ they also re-define the health indicators that
are members of the group.

See gh-20962
2020-04-14 16:40:36 -07:00
Phillip Webb
82cfd7c6c9 Restructure probes auto-configuration
Relocate probe auto-configuration from the `kubernetes` package to
`availability` since probes could also be used on other platforms.

The classes have also been renamed to named to `AvailabilityProbes...`

See gh-20962
2020-04-14 16:40:36 -07:00
Phillip Webb
71e4801e68 Rename probe health indicators
Rename `LivenessProbeHealthIndicator` to `LivenessStateHealthIndicator`
and `ReadinessProbeHealthIndicator` to `ReadinessStateHealthIndicator`.

Also introduce a general purpose `AvailabilityStateHealthIndicator`
class.

See gh-20962
2020-04-14 16:40:36 -07:00
Phillip Webb
bb79c847b2 Allow custom availability states
Create a general purpose `AvailabilityState` interface and refactor
the existing `LivenessState` and `ReadinessState` to use it. A single
`AvailabilityChangeEvent` is now used to carry all availability state
updates.

This commit also renames `ApplicationAvailabilityProvider` to
`ApplicationAvailabilityBean` and extracts an `ApplicationAvailability`
interface that other beans can inject. The helps to hide the event
listener method, which is really internal.

Finally the state enums have been renamed as follows:

 - `LivenessState.LIVE` -> `LivenessState.CORRECT`
 - `ReadinessState.READY` -> `ReadinessState.ACCEPTING_TRAFFIC`
 - `ReadinessState.UNREADY` -> `ReadinessState.REFUSING_TRAFFIC`

See gh-20962
2020-04-14 16:40:36 -07:00
Phillip Webb
1604cb2a1e Polish 2020-04-13 14:05:48 -07:00
dreis2211
4b9986d790 Remove unused fields in tests
See gh-20926
2020-04-13 13:46:43 +02:00
Brian Clozel
ce653059c8 Improve recording of cancellation signal in WebClient
With its initial fix in gh-18444, the `WebClient` instrumentation would
record all CANCEL signals, including:

* when a `timeout` expires and the response has not been received
* when the client partially consumes the response body

Since the second use case is arguable intentional, this commit restricts
the instrumentation and thus avoids recording two events for a single
request in that case.

Closes gh-18444
2020-04-11 21:52:18 +02:00
Brian Clozel
3879a7505c Record cancelled client requests in WebClient
Prior to this commit, cancelled client requests (for example as a result
of a `timeout()` reactor operator would not be recorded by Micrometer.

This commit instruments the cancelled signal for outgoing client
requests and assigns a status `CLIENT_ERROR`.
The cancellation can be intentional (triggering a timeout and falling
back on a faster alternative) or considered as an error. The intent
cannot be derived from the signal itself so we're considering it as a
client error.

Closes gh-18444
2020-04-10 22:37:00 +02:00
Phillip Webb
3ca896e63f Polish 2020-04-07 12:10:49 -07:00
Phillip Webb
5d8d0bb159 Update copyright year of changed files 2020-04-01 11:51:29 -07:00
Andy Wilkinson
f238812cea Polish "Improve handling of non-existent path in disk space health check"
See gh-20580
2020-03-31 12:24:10 +01:00
Andreas Born
db565cfc3a Improve handling of non-existent path in disk space health check
See gh-20580
2020-03-31 12:24:10 +01:00
Stephane Nicoll
ef592eaed8 Merge branch '2.2.x'
Closes gh-20726
2020-03-30 13:08:16 +02:00
Stephane Nicoll
ac56db703e Merge branch '2.1.x' into 2.2.x
Closes gh-20725
2020-03-30 13:02:58 +02:00
Stephane Nicoll
88b7b78344 Make sure that cassandra health check reports version
Closes gh-20719
2020-03-30 12:58:41 +02:00
Stephane Nicoll
a7e8829560 Polish 2020-03-29 18:44:48 +02:00
Stephane Nicoll
5ad4de184d Merge branch '2.2.x'
Closes gh-20718
2020-03-29 18:43:35 +02:00
Stephane Nicoll
05f10819c4 Merge branch '2.1.x' into 2.2.x
Closes gh-20717
2020-03-29 18:39:17 +02:00
Stephane Nicoll
c9e32aaa47 Use LOCAL_ONE when querying system.local
This commit is a follow-up of gh-20709 to apply the same consistency
level to the Cassandra reactive health indicator.

Closes gh-20713
2020-03-29 18:37:30 +02:00
Stephane Nicoll
876371e0fd Merge branch '2.2.x'
Closes gh-20712
2020-03-28 16:09:47 +01:00