Commit Graph

918 Commits

Author SHA1 Message Date
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
Stephane Nicoll a9a6df2ed4 Merge branch '2.1.x' into 2.2.x
Closes gh-20711
2020-03-28 16:05:36 +01:00
Stephane Nicoll 63be1678de Polish "Use LOCAL_ONE when querying system.local"
See gh-20709
2020-03-28 16:02:04 +01:00
Alexandre Dutra 851f631eac Use LOCAL_ONE when querying system.local
The system keyspace has a replication factor of 1 and is local to each
node; it is therefore recommended to query system.local with a
consistency level of ONE or LOCAL_ONE.

Stronger consistency levels may result in an Unavailable error, but this
does not mean that the node is down.

See gh-20709
2020-03-28 16:01:47 +01:00
dreis2211 674f1e77b5 Fix typos
See gh-20704
2020-03-28 08:42:59 +01:00
Brian Clozel eb70fd952f Turn LivenessState and ReadinessState into enums
Prior to this commit, `LivenessState` and `ReadinessState` were
immutable classes. This was done in order to have additional behavior
and information in those classes.

Because the current implementation doesn't need this, this commit turns
those classes into simple enums.
Additional state and information can be added to the
`*StateChangedEvent` classes.

See gh-19593
2020-03-24 18:25:52 +01:00
dreis2211 25f48cb289 Fix typos in HealthEndpointGroupConfigurer
See gh-20628
2020-03-24 11:18:42 +01:00
Phillip Webb 0717de723f Polish 2020-03-23 20:03:44 -07:00
Phillip Webb 9a33a723fe Update copyright year of changed files 2020-03-23 14:15:08 -07:00
Phillip Webb 16b5ea3414 Update copyright year of changed files 2020-03-23 14:13:33 -07:00
dreis2211 ef9f1d39a3 Remove redundant MockitoAnnotations.initMocks()
See gh-20601
2020-03-22 08:43:50 +01:00
Stephane Nicoll 70aa788747 Merge branch '2.2.x'
Closes gh-20600
2020-03-21 15:15:20 +01:00
Stephane Nicoll 8593270b5b Only remove trailing slash from URI value
This commit upgrades the algorithm when trailing slash are to be
ignored. Previously a root URI (i.e. "/") would result to to empty
string which is an issue for monitoring system that requires tag values
to be non empty. If the URI is a single character, the trailing is not
applied and "/" is left as is.

Closes gh-20536
2020-03-21 15:11:50 +01:00
Brian Clozel ffdf9a422f Polish Liveness and Readiness support
This commit moves the core Liveness and Readiness support to its own
`availability` package. We've made this a core concept independent of
Kubernetes.

Spring Boot now produces `LivenessStateChanged` and
`ReadinessStateChanged` events as part of the typical application
lifecycle.

Liveness and Readiness Probes (`HealthIndicator` components and health
groups) are still configured only when deployed on Kubernetes.

This commit also improves the documentation around Probes best practices
and container lifecycle considerations.

See gh-19593
2020-03-20 23:54:00 +01:00
Brian Clozel fd0b2f6695 Add Kubernetes Liveness and Readiness Probes support
Prior to this commit and as of Spring Boot 2.2.0, we would advise
developers to use the Actuator health groups to define custom "liveness"
and "readiness" groups and configure them with subsets of existing
health indicators.

This commit addresses several limitations with that approach.

First, `LivenessState` and `ReadinessState` are promoted to first class
concepts in Spring Boot applications. These states should not only based
on periodic health checks. Applications should be able to track changes
(and adapt their behavior) or update states (when an error happens).

The `ApplicationStateProvider` can be injected and used by applications
components to get the current application state. Components can also
track specific `ApplicationEvent` to be notified of changes, like
`ReadinessStateChangedEvent` and `LivenessStateChangedEvent`.
Components can also publish such events with an
`ApplicationEventPublisher`. Spring Boot will track startup event and
application context state to update the liveness and readiness state of
the application. This infrastructure is available in the
main spring-boot module.

If Spring Boot Actuator is on the classpath, additional
`HealthIndicator` will be contributed to the application:
`"LivenessProveHealthIndicator"` and `"ReadinessProbeHealthIndicator"`.
Also, "liveness" and "readiness" Health groups will be defined if
they're not configured already.

Closes gh-19593
2020-03-19 14:11:00 +01:00
Brian Clozel b680db6cd8 Add HealthEndpointGroupsRegistry and its Customizer
Prior to this commit, `HealthContributor` would be exposed under the
main `HealthEndpoint` and subgroups, `HealthEndpointGroups`. Groups are
driven by configuration properties and there was no way to contribute
programmatically new groups.

This commit introduces the `HealthEndpointGroupsRegistry` (a mutable
version of `HealthEndpointGroups`) and a
`HealthEndpointGroupsRegistryCustomizer`. This allows configurations to
add/remove groups during Actuator auto-configuration.

Closes gh-20554
2020-03-19 14:11:00 +01:00
Stephane Nicoll abe43b2e83 Upgrade to Couchbase SDK v3
This commit upgrades to the Couchbase SDK v3 which brings the following
breaking changes:

* Bootstrap hosts have been replaced by a connection string and the
authentication is now mandatory.
* A `Bucket` is no longer auto-configured. The
`spring.couchbase.bucket.*` properties have been removed
* `ClusterInfo` no longer exists and has been replaced by a dedicated
API on `Cluster`.
* `CouchbaseEnvironment` no longer exist in favour of
`ClusterEnvironment`, the customizer has been renamed accordingly.
* The bootstrap-related properties have been removed. Users requiring
custom ports should supply the seed nodes and initialize a Cluster
themselves.
* The endpoints-related configuration has been consolidated in a
single IO configuration.

The Spring Data Couchbase provides an integration with the new SDK. This
leads to the following changes:

* A convenient `CouchbaseClientFactory` is auto-configured.
* Repositories are configured against a bucket and a scope. Those can
be set via configuration in `spring.data.couchbase.*`.
* The default consistency property has been removed in favour of a more
flexible annotation on the repository query methods instead. You can now
specify different query consistency on a per method basis.
* The `CacheManager` implementation is provided, as do other stores for
consistency so a dependency on `couchbase-spring-cache` is no longer
required.

See gh-19893

Co-authored-by: Michael Nitschinger <michael@nitschinger.at>
2020-03-17 17:00:09 +01:00
dreis2211 3e24df3beb Fix method order checkstyle issue
See gh-20525
2020-03-13 15:53:42 +00:00
Andy Wilkinson 0315724126 Cache endpoint responses on a per-principal basis
Previously, any HTTP request to an endpoint that included a principal
would bypass the cache. This prevented authenticated requests from
making use of the cache and its configurable time-to-live.

This commit updates the caching operation invoker to include the
principal, if any, in its cache key. As a result, requests that
include a principal will make use of the cache, potentially returning
the result of a previous invocation of the same endpoint by the same
principal.

Closes gh-19538
2020-03-13 15:31:41 +00:00
Andy Wilkinson ef9960c69f Allow additional tags to be contributed to WebMvc and WebFlux defaults
Closes gh-20175
2020-03-13 09:38:29 +00:00
Andy Wilkinson c917b61484 Reinstate leading / in default value for spring.liquibase.change-log
Unfortunately, while redundant for new applications, removing the
leading slash adversely affected existing application upon upgrades as
it caused Liquibase to re-apply every change log.

Closes gh-20177
2020-03-10 21:22:27 +00:00
Stephane Nicoll 278f769f80 Merge branch '2.2.x' 2020-03-08 17:23:56 +01:00
Stephane Nicoll 1fdb08300b Polish 2020-03-08 17:22:22 +01:00
Scott Frederick 185f644877 Remove the body from actuator 404 responses
When a request to the /actuator/env/{toMatch} endpoint does not match a
property, a response status 404 was being returned along with a body
containing the existing property sources. This commit removes the body
from the response to be more consistent with a typical 404 response.

Fixes gh-20314
2020-03-05 17:21:15 -06:00
Stephane Nicoll fa8a09d46d Merge branch '2.2.x'
Closes gh-20395
2020-03-05 10:31:17 +01:00
dreis2211 f08a9db984 Fix some deprecations
See gh-20388
2020-03-05 10:24:49 +01:00
Johnny Lim bd08b4d91c Polish DataSourceHealthIndicator
See gh-20367
2020-03-05 10:10:39 +01:00
Stephane Nicoll 51c29229d3 Polish "Improve details of neo4h health indicator"
See gh-20356
2020-03-04 15:48:00 +01:00
Said BOUDJELDA b09d5d27e0 Improve details of neo4h health indicator
This commit changes the neo4j health indicator to provide the version
and edition of the neo4j database.

See gh-20356
2020-03-04 15:46:38 +01:00
Stephane Nicoll 89e5c285e5 Merge branch '2.2.x'
Closes gh-20387
2020-03-04 15:44:01 +01:00
Johnny Lim 1721aeccb0 Use ServerHttpResponse.getRawStatusCode() in WebFluxTags
See gh-19987
2020-03-04 15:28:31 +01:00
Stephane Nicoll 925756dae1 Polish "Add descriptions for data source pool metrics"
See gh-20354
2020-03-01 11:02:39 -05:00
Johnny Lim 21a0b0544a Add descriptions for data source pool metrics
See gh-20354
2020-03-01 10:58:52 -05:00
Stephane Nicoll 45e6058761 Add R2BC connection pool metrics
This commit adds metrics support for `ConnectionPool` beans.

See gh-19988

Co-authored-by: Mark Paluch <mpaluch@pivotal.io>
Co-authored-by: Tadaya Tsuyukubo <tadaya@ttddyy.net>
2020-02-25 09:22:57 -05:00
Stephane Nicoll bee7302fc7 Add R2BC connection factory health check
This commit adds an health indicator for R2DBC. If a validation query is
provided, it is used to validate the state of the database. If not, a
check of the connection is issued.

See gh-19988

Co-authored-by: Mark Paluch <mpaluch@pivotal.io>
2020-02-25 09:22:31 -05:00
Brian Clozel e73ee7b3fe Merge branch '2.2.x'
Closes gh-20293
2020-02-21 18:48:54 +01:00
Brian Clozel 11b9862064 Revert "Clear ProducesRequestCondition cache attribute"
Closes gh-20292
2020-02-21 17:38:43 +01:00
Brian Clozel ab72cc8fdb Revert "Add actuator specific ObjectMapper"
See gh-12951
See gh-20291
2020-02-21 17:16:24 +01:00
Dmytro Nosan 1a8c321a7b Support nested requests in MetricsClientHttpRequestInterceptor
Prior to this commit, requests made by `HttpRequestInterceptor`
instances configured on `RestTemplate` would not be recorded
properly.

This commit ensures that nested requests are recorded separately.

Closes gh-20231
2020-02-20 14:49:50 -08:00
Stephane Nicoll 26c673a1a4 Merge branch '2.2.x' 2020-02-20 11:03:41 +01:00
Stephane Nicoll 592ae85043 Merge branch '2.1.x' into 2.2.x 2020-02-20 11:03:10 +01:00