Commit Graph

963 Commits

Author SHA1 Message Date
Andy Wilkinson 07fb4b065d Merge branch '2.3.x'
Closes gh-21940
2020-06-16 10:10:38 +01:00
Andy Wilkinson 0de466e06e Require dependency on s-b-dependencies to use its constraints
Previously, Spring Boot's modules published Gradle Module Metadata
(GMM) the declared a platform dependency on spring-boot-dependencies.
This provided versions for each module's own dependencies but also had
they unwanted side-effect of pulling in spring-boot-dependencies
constraints which would influence the version of other dependencies
declared in the same configuration. This was undesirable as users
should be able to opt in to this level of dependency management, either
by using the dependency management plugin or by using Gradle's built-in
support via a platform dependency on spring-boot-dependencies.

This commit reworks how Spring Boot's build uses
spring-boot-dependencies and spring-boot-parent to provide its own
dependency management. Configurations that aren't seen by consumers are
configured to extend a dependencyManagement configuration that has an
enforced platform dependency on spring-boot-parent. This enforces
spring-boot-parent's version constraints on Spring Boot's build without
making them visible to consumers. To ensure that the versions that
Spring Boot has been built against are visible to consumers, the
Maven publication that produces pom files and GMM for the published
modules is configured to use the resolved versions from the module's
runtime classpath.

Fixes gh-21911
2020-06-16 08:50:21 +01:00
Stephane Nicoll e87c3193ce Polish "Add Java 15 CI"
See gh-21713
2020-06-15 17:08:12 +02:00
dreis2211 cf3cd0be48 Use Class.getName() as fallback in HandlerFunctionDescription
In JDK 15 the concept of hidden classes was introduced, which also
affects Lambdas in so far that Class.getCanonicalName() will return null
for those. This commit uses Class.getName() as a fallback when no
canonical name is available.

See gh-21713
2020-06-15 16:45:59 +02:00
Stephane Nicoll 35e069e2cd Polish "Add health indicator for Cassandra that uses the CqlSession"
See gh-20887
2020-06-15 11:13:13 +02:00
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