Commit Graph

1112 Commits (4d8382b25cb0467269f8aef2a01f41e607e9f4b9)

Author SHA1 Message Date
Stephane Nicoll 5ad4de184d Merge branch '2.2.x'
Closes gh-20718
5 years ago
Stephane Nicoll 05f10819c4 Merge branch '2.1.x' into 2.2.x
Closes gh-20717
5 years ago
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
5 years ago
Stephane Nicoll 876371e0fd Merge branch '2.2.x'
Closes gh-20712
5 years ago
Stephane Nicoll a9a6df2ed4 Merge branch '2.1.x' into 2.2.x
Closes gh-20711
5 years ago
Stephane Nicoll 63be1678de Polish "Use LOCAL_ONE when querying system.local"
See gh-20709
5 years ago
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
5 years ago
dreis2211 674f1e77b5 Fix typos
See gh-20704
5 years ago
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
5 years ago
dreis2211 25f48cb289 Fix typos in HealthEndpointGroupConfigurer
See gh-20628
5 years ago
Phillip Webb 0717de723f Polish 5 years ago
Phillip Webb 9a33a723fe Update copyright year of changed files 5 years ago
Phillip Webb 16b5ea3414 Update copyright year of changed files 5 years ago
dreis2211 ef9f1d39a3 Remove redundant MockitoAnnotations.initMocks()
See gh-20601
5 years ago
Stephane Nicoll 70aa788747 Merge branch '2.2.x'
Closes gh-20600
5 years ago
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
5 years ago
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
5 years ago
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
5 years ago
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
5 years ago
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>
5 years ago
dreis2211 3e24df3beb Fix method order checkstyle issue
See gh-20525
5 years ago
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
5 years ago
Andy Wilkinson ef9960c69f Allow additional tags to be contributed to WebMvc and WebFlux defaults
Closes gh-20175
5 years ago
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
5 years ago
Stephane Nicoll 278f769f80 Merge branch '2.2.x' 5 years ago
Stephane Nicoll 1fdb08300b Polish 5 years ago
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
5 years ago
Stephane Nicoll fa8a09d46d Merge branch '2.2.x'
Closes gh-20395
5 years ago
dreis2211 f08a9db984 Fix some deprecations
See gh-20388
5 years ago
Johnny Lim bd08b4d91c Polish DataSourceHealthIndicator
See gh-20367
5 years ago
Stephane Nicoll 51c29229d3 Polish "Improve details of neo4h health indicator"
See gh-20356
5 years ago
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
5 years ago
Stephane Nicoll 89e5c285e5 Merge branch '2.2.x'
Closes gh-20387
5 years ago
Johnny Lim 1721aeccb0 Use ServerHttpResponse.getRawStatusCode() in WebFluxTags
See gh-19987
5 years ago
Stephane Nicoll 925756dae1 Polish "Add descriptions for data source pool metrics"
See gh-20354
5 years ago
Johnny Lim 21a0b0544a Add descriptions for data source pool metrics
See gh-20354
5 years ago
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>
5 years ago
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>
5 years ago
Brian Clozel e73ee7b3fe Merge branch '2.2.x'
Closes gh-20293
5 years ago
Brian Clozel 11b9862064 Revert "Clear ProducesRequestCondition cache attribute"
Closes gh-20292
5 years ago
Brian Clozel ab72cc8fdb Revert "Add actuator specific ObjectMapper"
See gh-12951
See gh-20291
5 years ago
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
5 years ago
Stephane Nicoll 26c673a1a4 Merge branch '2.2.x' 5 years ago
Stephane Nicoll 592ae85043 Merge branch '2.1.x' into 2.2.x 5 years ago
Stephane Nicoll 6aeff91f50 Polish 5 years ago
Stephane Nicoll 287d577aea Merge branch '2.2.x'
Closes gh-20218
5 years ago
Stephane Nicoll 16111f126e Use query-less datasource validation by default
This commit changes DataSourceHealthIndicator to validate the connection
rather than issuing a query to the database. If a custom validation
query is specified, it uses that as before.

Closes gh-17582
5 years ago
Brian Clozel e59d3fbb86 Clear ProducesRequestCondition cache attribute
As of spring-projects/spring-framework#22644, Spring Framework caches
the "produces" condition when matching for endpoints in the
`HandlerMapping` infrastructure. This has been improved in
spring-projects/spring-framework#23091 to prevent side-effects in other
implementations.

Prior to this commit, the Spring Boot actuator infrastructure for
`EndpointHandlerMapping` would not clear the cached attribute,
presenting the same issue as Spring Framework's infrastructure. This
means that a custom arrangement with custom `HandlerMapping` or
`ContentTypeResolver` would not work properly and reuse the cached
produced conditions for other, unintented, parts of the handler mapping
process.

This commit clears the cached data and ensures that other handler
mapping implementations are free of that side-effect.

Fixes gh-20150
5 years ago
Stephane Nicoll 03bee83991 Update copyright date
See gh-20192
5 years ago
zhangt2333 e2d87a89d0 Polish
See gh-20192
5 years ago
Stephane Nicoll 2ede9e63b9 Merge branch '2.1.x' into 2.2.x
Closes gh-20117
5 years ago
Stephane Nicoll 32c1dd45a9 Revert "Merge pull request #19926 from xak2000"
Closes gh-19926
5 years ago
Brian Clozel 97af0b2f3a Add actuator specific ObjectMapper
Prior to this commit, Actuator endpoints would use the application
ObjectMapper instance for serializing payloads as JSON. This was
problematic in several cases:

* application-specific configuration would change the actuator endpoint
output.
* choosing a different JSON mapper implementation in the application
would break completely some endpoints.

Spring Boot Actuator already has a hard dependency on Jackson, and this
commit uses that fact to configure a shared `ObjectMapper` instance that
will be used by the Actuator infrastructure consistently, without
polluting the application context.

This `ObjectMapper` is used in Actuator for:

* JMX endpoints
* Spring MVC endpoints with an HTTP message converter
* Spring WebFlux endpoints with an `Encoder`
* Jersey endpoints with a `ContextResolver<ObjectMapper>`

For all web endpoints, this configuration is limited to the
actuator-specific media types such as
`"application/vnd.spring-boot.actuator.v3+json"`.

Fixes gh-12951
5 years ago
Stephane Nicoll 466c1ba251 Merge branch '2.2.x'
Closes gh-20118
5 years ago
Stephane Nicoll a425cc1b46 Merge branch '2.1.x' into 2.2.x
Closes gh-20117
5 years ago
Ruslan Stelmachenko 5f7e1ac4f2 Remove unnecessary leading slash in changelog locations
See gh-19926
5 years ago
Madhura Bhave 19b7dc8e4f Merge branch '2.2.x'
Closes gh-20114
5 years ago
Madhura Bhave d485708f68 Fix 404 when composite contributor is added to a group
Fixes gh-19974
5 years ago
Madhura Bhave eeab9233cc Merge branch '2.2.x'
Closes gh-20056
5 years ago
Madhura Bhave acc453db4a Polish contribution
See gh-19999
5 years ago
cbono badc83d368 Add 'uris', 'address' and 'addresses' to keys to sanitize.
See gh-19999
5 years ago
Stephane Nicoll 1c87325420 Merge branch '2.2.x' 5 years ago
Stephane Nicoll d85bdfb23c Fix checkstyle violation 5 years ago
Stephane Nicoll 9aef2bde77 Merge branch '2.2.x'
Closes gh-20030
5 years ago
Stephane Nicoll 10643b7702 Polish "Stop time web metrics when autotime is disabled"
See gh-19981
5 years ago
babjo e323e05eea Stop time web metrics when autotime is disabled
See gh-19981
5 years ago
Scott Frederick 60f5bb1636 Remove health actuator code deprecated in 2.2
This partially re-applies the deprecation removal from commit
df1837a16b,
without removing CompositeHealthIndicator, HealthAggregator, and related
configuration that is required by Spring Cloud.
5 years ago
Scott Frederick de1a26cf35 Revert "Remove deprecated HealthIndicator and HealthAggregator 2.2 code"
This reverts commit df1837a16b.
5 years ago
Stephane Nicoll b5e23e7405 Update copyright year of changed files
See gh-20020
5 years ago
Johnny Lim b67ece48e4 Polish
See gh-20020
5 years ago
Stephane Nicoll c4daff7225 Polish "Upgrade to MongoDB Java Driver 4.0 beta1"
See gh-19960
5 years ago
Christoph Strobl d2d6dbdc00 Upgrade to MongoDB Java Driver 4.0 beta1
See gh-19960
5 years ago
dreis2211 56df70b0e7 Use Spring 5 module of Jersey
See gh-20009
5 years ago
Johnny Lim e6d5f5a271 Polish
See gh-19995
5 years ago
Andy Wilkinson 6db5ca97d3 Sort names alphabetically in metrics list response
Closes gh-19934
5 years ago
Madhura Bhave dc542b29d8 Merge branch '2.2.x'
Closes gh-19977
5 years ago
Johnny Lim f3aed11714 Update test name in WebFluxTagsTests
See gh-19976
5 years ago
Stephane Nicoll cb7e8cdbef Merge branch '2.2.x'
Closes gh-19904
5 years ago
Stephane Nicoll 99330325c0 Merge branch '2.1.x' into 2.2.x
Closes gh-19903
5 years ago
Stephane Nicoll 7fd8cce465 Polish "Close TomcatMetrics on shutdown for cleanup"
See gh-19880
5 years ago
Johnny Lim 51dfd528bd Close TomcatMetrics on shutdown for cleanup
See micrometer-metrics/micrometer#1424
See gh-19880
5 years ago
Phillip Webb 77bbe089b2 Update copyright year of changed files 5 years ago
Phillip Webb e0013454b5 Use parentheses when declaring dependencies
Update all dependencies declarations to use the form `scope(reference)`
rather than `scope reference`.

Prior to this commit we declared dependencies without parentheses unless
we were forced to add them due to an `exclude`.
5 years ago
Phillip Webb 0209cd3e4c Polish quote form used in Gradle scripts
Replace Gradle single quote strings with the double quote form
whenever possible. The change helps to being consistency to the
dependencies section where mostly single quotes were used, but
occasionally double quotes were required due to `${}` references.
5 years ago
Stephane Nicoll 08967bca3e Merge branch '2.2.x'
Closes gh-19843
5 years ago
Stephane Nicoll 84324c438b Merge branch '2.1.x' into 2.2.x
Closes gh-19842
5 years ago
Stephane Nicoll 34c263a828 Polish actuator dependencies and test resources
This commit removes references of cache infra following the move to
Micrometer. We no longer ships an infinispan specific binder so the
dependency has been removed as well.

Closes gh-19838
5 years ago
dreis2211 991bcf5ce4 Revisit documentation that mentions Gradle "compile" configuration
See gh-19797
5 years ago
Scott Frederick 8f102aee68 Remove deprecated 2.2 code
See gh-19699
5 years ago
Scott Frederick 2e32cb2af1 Remove deprecated HealthIndicator and HealthAggregator 2.2 code
See gh-19699
5 years ago
Scott Frederick 1f1b06dfe2 Remove deprecated Actuator metrics 2.2 code
See gh-19699
5 years ago
Scott Frederick 7031a3b17d Remove deprecated logging properties
See gh-19699
5 years ago
Stephane Nicoll 421c464dd8 Deprecate CachingOperationInvoker#apply
This commit deprecates the only public accessor to
`CacheOperationInvoker` so that we can make the entire class package
private in the next feature release.

Closes gh-19089
5 years ago
Andy Wilkinson 443d1a6a21 Upgrade to Liquibase 3.8.5
Closes gh-19754
5 years ago
Andy Wilkinson 714a187d8f Rework dep mgmt again to avoid consumers picking up strict constraints
This paves the way for publishing Gradle module metadata once the
problem caused by snapshot versions and our two-step publication
process has been addressed.

See gh-19609
5 years ago
Andy Wilkinson aefe52e4d0 Revert "Rework dep management to avoid consumers picking up strict constraints"
This reverts commit b34a311d02 as,
having disabled the publishing of Gradle's module metadata (4f75ab5),
the changes are no longer needed.

See gh-19609
5 years ago
Phillip Webb 862462b791 Update copyright year of changed files 5 years ago
Phillip Webb 1e5ba09a3e Merge branch '2.2.x' 5 years ago
Phillip Webb 15652ae4c1 Update copyright year of changed files 5 years ago
Madhura Bhave d1f51e064b Merge branch '2.2.x'
Closes gh-19701
5 years ago
Madhura Bhave e60194c7d5 Ignore trailing slash when recording Web metrics
Fixes gh-18207
5 years ago
Scott Frederick c789592e26 Remove support for deprecated Elasticsearch Jest client
Closes #19676
5 years ago
Andy Wilkinson b34a311d02 Rework dep management to avoid consumers picking up strict constraints
Previously, enforcedPlatform dependencies were using to pull in the
constraints defined in spring-boot-dependencies and
spring-boot-parent and applied them strictly so that the constrained
version had to be used. This worked as intended in Spring Boot's own
build but incorrectly enforced those same strict version requirements
on external consumers of Spring Boot's modules.

This commit reworks how Spring Boot defines its internal dependency
management so that platform dependencies are exposed to external
consumers while enforced platform dependencies are using internally.

See gh-19609
5 years ago
Stephane Nicoll ca1710ee56 Upgrade to Apache Cassandra 4.3.1
See gh-19588
5 years ago
Dmytro Nosan 25838b4794 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.

See gh-19381
5 years ago
Andy Wilkinson 7595336184 Build against Spring Integration 5.3.0.M1 snapshots
See gh-19650
5 years ago
Andy Wilkinson ce99db1902 Port the build to Gradle
Closes gh-19609
Closes gh-19608
5 years ago
Madhura Bhave abe95fa8a7 Merge branch '2.2.x'
Closes gh-19600
5 years ago
Madhura Bhave 7f0573df49 Fallback on underlying server default when determining outcome tag
This commit also changed the default outcome to SUCCESS

Fixes gh-19367
5 years ago
Stephane Nicoll 7d6f4a6666 Merge branch '2.2.x'
Closes gh-19590
5 years ago
Stephane Nicoll 99c64b7cdf Merge branch '2.1.x' into 2.2.x
Closes gh-19589
5 years ago
Matthias Stock adfbbcc0f6 Simplify validation pattern of EndpointId
See gh-19584
5 years ago
Andy Wilkinson 4efd8ba587 Merge branch '2.2.x'
Closes gh-19574
5 years ago
Andy Wilkinson 02965e9744 Fix javadoc warnings
Fixes gh-19572
5 years ago
Stephane Nicoll 6fc52b0563 Polish 5 years ago
Stephane Nicoll 2c1e81adf0 Polish 5 years ago
Phillip Webb 695de2c6f5 Polish end-to-end configuration properties tracing
See gh-14880
5 years ago
Madhura Bhave 8dcf1e4033 Provide end-to-end traceability for config properties
Closes gh-14880

Co-authored-by: Andy Wilkinson <awilkinson@pivotal.io>
5 years ago
Stephane Nicoll 20bebdc07d Merge branch '2.2.x'
Closes gh-19331
5 years ago
dreis2211 b1158bf35d Simplify some Stream API usages
See gh-19291
5 years ago
Madhura Bhave b42bc1b23d Merge branch '2.2.x'
Closes gh-19314
5 years ago
Madhura Bhave ed571bab24 Merge branch '2.1.x' into 2.2.x
Closes gh-19313
5 years ago
dreis2211 20ff764756 Increase cache ttl in CachingOperationInvokerTests
See gh-19193
5 years ago
Andy Wilkinson ae5ec4e41a Merge branch '2.2.x'
Closes gh-19300
5 years ago
Andy Wilkinson 758b80a0fe Merge branch '2.1.x' into 2.2.x
Closes gh-19299
5 years ago
luoyuan c6a184474c Remove redundant hasText check as query always has text
See gh-19290
5 years ago
Madhura Bhave 0a2387ed0b Merge branch '2.2.x'
Closes gh-19279
5 years ago
Madhura Bhave 2c4a1f1c15 Display @Validated constructor bound properties in configprops endpoint
Fixes gh-19219
5 years ago
Andy Wilkinson b6fb251097 Merge branch '2.2.x'
Closes gh-19191
5 years ago
Andy Wilkinson 189f74220c Merge branch '2.1.x' into 2.2.x
Closes gh-19190
5 years ago
Andy Wilkinson e8eace2d5b Polish "Fix Liquibase endpoint's output with multiple datasources"
See gh-19171
5 years ago
Leo Li 5302d91930 Fix Liquibase endpoint's output with multiple datasources
Previously, the endpoint used the same change log history service for
for each SpringLiquibase bean that it processed. This resulted in
pollution of the reported changes as the history of each bean was not
isolated.

This commit updates the endpoint to use a new history service for each
SpringLiquibase bean that is processed.

See gh-19171
5 years ago
Stephane Nicoll 79201b61b6 Merge branch '2.2.x'
Closes gh-19158
5 years ago
Stephane Nicoll ce16c9e945 Merge branch '2.1.x' into 2.2.x
Closes gh-19157
5 years ago
Stephane Nicoll 2356462587 Polish "Remove '.' and '-' reference in the EndpointId javadoc"
See gh-19101
5 years ago
Lars Grefer 58e599b6c1 Remove '.' and '-' reference in the EndpointId javadoc
Endpoint ID's which contain '-' or '.' cause a deprecation warning.
Therefore they shouldn't be doumented as valid characters.

See gh-19101
5 years ago
dreis2211 8a730ff630 Use DateTimeFormatter in favor of SimpleDateFormat
See gh-19142
5 years ago
Stephane Nicoll 12c5cdceb1 Merge branch '2.2.x'
Closes gh-19104
5 years ago
thelproad 65ab82b3cd Remove redundant code
See gh-19000
5 years ago
dreis2211 21dc7e9ca3 Fix StepVerifier usage in HealthIndicatorReactiveAdapterTests 5 years ago
dreis2211 0bdcd2ee67 Handle ApiVersion in CachingOperationInvoker
Prior to this commit, ApiVersion was treated as a mandatory parameter in
CachingOperationInvokerAdvisor and thus prevented the
CachingOperationInvoker to kick in. By skipping ApiVersion in the same
way we're skipping SecurityContext we can avoid this.

In order to not return the same cached response, this commit also
changes the cache handling in CachingOperationInvoker to account for
different ApiVersions being passed.

See gh-18961
5 years ago
Madhura Bhave 6e22ddc1a6 Merge branch '2.1.x' into 2.2.x 5 years ago
Madhura Bhave 849a76c6c2 Polish 5 years ago
Madhura Bhave ff22bd4827 Merge branch '2.1.x' into 2.2.x
Closes gh-19059
5 years ago
Madhura Bhave a3a53d299f Check authorities when exposing health details
Fixes gh-18998
5 years ago
dreis2211 6b500d82b4 Polish
See gh-18918
5 years ago
Stephane Nicoll 86a1c96224 Make sure health endpoint is available with no contributor
This commit makes sure that the health endpoint returns a default health
status when no contributors are available. Previously, it was returning
`null` which leads to a 404 when exposed via HTTP.

Closes gh-18676
5 years ago
dreis2211 1b2112ea8c Reduce method visibility in EndpointDiscovererTests
See gh-18884
5 years ago
Andy Wilkinson ce01f7f150 Merge branch '2.1.x'
Closes gh-18882
5 years ago
Andy Wilkinson ed50bf2494 Honour EndpointFilter configured on an endpoint's superclass
Previously, @EndpointFilter would only have an effect when used as
an annotation or meta-annotation on the endpoint class itself. It
would have no effect when used on a super-class of the endpoint
bean's class.

This commit updates EndpointDiscoverer so that an @EndpointFilter
annotation or meta-annotation on a super-class will be found and
applied to the discovery process. This is achieved by using find…
rather than get… when retrieving the attributes for the EndpointFilter
annotation.

Fixes gh-17866
5 years ago
Phillip Webb b3e9a06476 Polish 5 years ago
Stephane Nicoll d6d32ec01d Polish 5 years ago
Stephane Nicoll 11e0045ec6 Polish contribution
See gh-18736
5 years ago
mattisonchao f61da8b723 Polish
See gh-18736
5 years ago
dreis2211 9ece2e277f Remove redundant explicit types
See gh-18754
5 years ago
dreis2211 911b12f28d Fix JsonParser deprecation
See gh-18750
5 years ago
Stephane Nicoll 3d253854e9 Handle constructor bound configuration properties in /configprops
This commit updates the configprops actuator endpoint to detect
configuration properties that are bound using a constructor.

Closes gh-18636
5 years ago
Phillip Webb 597baf9774 Polish "Optimize logger calls"
See gh-18710
5 years ago
wycm 240b1f9e29 Optimize logger calls
Guard logger calls to ensure that they are only made when the
level is set.

See gh-18710
5 years ago
Phillip Webb ba30ee03df Improve health contributor null support
Update `NamedContributorsMapAdapter` to check for `null` keys or values
during construction. Also update `HealthEndpointSupport` to allow
null component entries.

See gh-18687
5 years ago
Phillip Webb 7c9ac03014 Filter empty health contributions
Update `HealthEndpointSupport` so that aggregate elements that don't
ultimately provide a contribution are filtered out. Prior to this
commit an NPE was returned when calculating the aggregate status.

Fixes gh-18687
5 years ago
dreis2211 8ecdf919f8 Fix Mockito deprecations
See gh-18689
5 years ago
Stephane Nicoll d254c62712 Polish tests 5 years ago
Stephane Nicoll 64401216b0 Merge branch '2.1.x'
Closes gh-18614
5 years ago
contextshuffling a8c6540191 Use LinkedHashSet for deterministic order in test assertion
See gh-18612
5 years ago
Stephane Nicoll 9c6e5f0904 Merge branch '2.1.x'
Closes gh-18585
5 years ago
dreis2211 abfb87d1a3 Rename tests to match Surefire expectations
See gh-18579
5 years ago
dreis2211 d8de6fff53 Polish
See gh-18557
5 years ago
dreis2211 3174f06bf2 Remove usage of @InjectMocks
See gh-18557
5 years ago
Andy Wilkinson 46c30d6bb0 Merge branch '2.1.x'
Closes gh-18476
5 years ago
Andy Wilkinson 3d4157ad6d Correct SCM URLs in published poms
Previously, Maven's default behaviour was relied up which resulted
in the artifact ID being appended to each URL as it was inherited.
This behaviour can only be disabled in Maven 3.6 and later, a version
that we cannot use due to an incompatibility with the Flatten Plugin.

This commit works around Maven's default behaviour by defining
properties for the SCM URL, connection, and developer connection and
then explicitly defining the settings in each pom using these
properties. The explicit definition of the properties in each pom
prevents them being inherited from the parent, thereby disabling the
unwanted appending of the artifact ID to the URL.

Fixes gh-18328
5 years ago
Phillip Webb 869a8c2691 Merge branch '2.1.x'
Closes gh-18411
5 years ago
Phillip Webb 38968d2fff Polish 'Apply TTL invocation caching on reactor types'
Extract reactor specific code to an inner class to protect
against ClassNotFound exceptions if reactor is not in use.

Also add support for `Flux`.

See gh-18339
5 years ago
dreis2211 33d8bfa99d Apply TTL invocation caching on reactor types
Update `CachingOperationInvoker` so that TTL caching is applied directly
to reactive types. Prior to this commit, a `Mono` would be cached, but
the values that it emitted would not.

See gh-18339
5 years ago
Stephane Nicoll 15eeedb59a Merge branch '2.1.x'
Closes gh-18380
5 years ago
Phillip Webb a94ab673a3 Add health endpoint 'show-components' support
Add a `show-components` property under `management.endpoint.health` and
`management.endpoint.health.group.<name>` that can be used to change
when components are displayed.

Prior to this commit it was only possible to set `show-details` which
offered an "all or nothing" approach to the resulting JSON. The new
switch allows component information to be displayed whilst still hiding
potentially sensitive details returned from the actual `HealthIndicator`.

Closes gh-15076
5 years ago
Phillip Webb 69c561a69a Rename health JSON 'details' to 'components' in v3
Update the health endpoint so the nested components are now exposed
under `components` rather than `details` when v3 of the actuator
REST API is being used.

This distinction helps to clarify the difference between composite
health (health composed of other health components) and health
details (technology specific information gathered by the indicator).

Since this is a breaking change for the REST API, it is only returned
for v3 payloads. Requests made accepting only a v2 response will have
JSON provided in the original form.

Closes gh-17929
5 years ago
Phillip Webb cd1b7c1a9c Test v3 actuator API with loggers endpoint
Update `LoggersEndpointWebIntegrationTests` to ensure that the new
v3 media type can be used.

See gh-17929
5 years ago
Phillip Webb deb9d67cef Add Actuator ApiVersion support and bump version
Add `ApiVersion` enum that can be injected into actuator endpoints if
they need to support more than one API revision.

Spring MVC, WebFlux and Jersey integrations now detect the API version
based on the HTTP accept header. If the request explicitly accepts a
`application/vnd.spring-boot.actuator.v` media type then the version
is set from the header. If no explicit Spring Boot media type is
accepted then the latest `ApiVersion` is assumed.

A new v3 API revision has also been introduced to allow upcoming health
endpoint format changes. By default all endpoints now consume and
can produce v3, v2 and `application/json` media types.

See gh-17929
5 years ago
Phillip Webb 323a78c4b9 Add property to migrate deprecated endoint IDs
Allow legacy actuator endpoint IDs that contain dots to be transparently
migrated to the new format. This update will allow Spring Cloud users
to proactively migrate from endpoints such as `hystrix.stream` to
`hystrixstream`.

Closes gh-18148
5 years ago
Stephane Nicoll c2df1afff0 Start building against Spring Integration 5.2.0 snapshots
See gh-18254
5 years ago
Phillip Webb 221ff0ff6d Polish configuration property bean classes
Refactor the `org.springframework.boot.actuate.context` package
with the following changes:

- Deprecate several classes which would ideally be internal

- Replace `ConfigurationBeanFactoryMetadata` with a new
  `ConfigurationPropertiesBean` class to better reflect that we no
  longer maintain meta-data directly.

- Use constructor injection and final fields whenever possible

- Rename `ConfiguraionPropertiesBeanDefinition` to
  `ConfigurationPropertiesValueObjectBeanDefinition` to align
  with the binder changes made in commit 0b3015e4ff

- Add additional tests

Closes gh-16903
5 years ago
Johnny Lim b70be97cbf Polish
See gh-18281
5 years ago
Brian Clozel ce2c26e934 Use Reactor's new Schedulers.boundedElastic()
Prior to this commit, Spring Boot would use `Schedulers.elastic()` when
required to process blocking tasks in a reactive environment.
reactor/reactor-core#1804 introduced a new scheduler,
`Schedulers.boundedElastic()` that behaves quite similarly but:

* will limit the number of workers thread
* will queue tasks if no worker thread is available and reject them is
the queue is exceeds a limit

This allows Spring Boot to schedule blocking tasks as before and allows
greater flexibility.

Fixes gh-18269
See gh-18276
5 years ago
Andy Wilkinson b15e427a3e Improve handling of non-standard status codes in WebFluxTags
Closes gh-18267
5 years ago
Andy Wilkinson 1b237de5f5 Use Awaitility in our own tests
Closes gh-18227
5 years ago
wonwoo b321dacc1c Fix typo in javadoc
See gh-18187
5 years ago
Andy Wilkinson e8de5a6d95 Provide a public API for determining a request's outcome
Closes gh-18150
5 years ago
dreis2211 a2a672de0e Improve handling of non-standard status codes in WebMvcTags
See gh-17998
5 years ago
Andy Wilkinson 58eddb8fa4 Become compatible with Jackson 2.10 while remaining 2.9 compatible
See gh-17999
5 years ago
Phillip Webb 75a6397b52 Merge branch '2.1.x'
Closes gh-18110
5 years ago
Phillip Webb e8d9b6f498 Polish "Fallback to ping if Solr URL references core"
See gh-16477
5 years ago
Markus Schuch b9764e8de8 Fallback to ping if Solr URL references core
Update `SolrHealthIndicator` to fallback to a basic ping operation if
the `baseUrl` references a particular core rather than the root context.

Prior to this commit, if the Solr `baseUrl` pointed to a particular
core then the health indicator would incorrectly report `DOWN`.

See gh-16477
5 years ago
dreis2211 b4350a9d96 Remove unnecessary blank lines
See gh-18089
5 years ago
Andy Wilkinson 82ea3b51b3 Polish 5 years ago
Andy Wilkinson 0217de4349 Polish "Improve handling of non-standard status codes in RestTemplate metrics"
See gh-17991
5 years ago
Johnny Lim 1acff410a2 Improve handling of non-standard status codes in RestTemplate metrics
See gh-17991
5 years ago
Madhura Bhave 7829593746 Polish "Sanitize password in URI properties"
See gh-17939
5 years ago
HaiTao Zhang d49a2ec98e Sanitize password in URI properties
See gh-17939
5 years ago
Andy Wilkinson b54ff7c45f Merge branch '2.1.x'
Closes gh-17950
5 years ago
Andy Wilkinson 608228d617 Improve handling of non-standard status codes in WebClient metrics
Fixes gh-17695
5 years ago
Andy Wilkinson b43827d626 Configure ping (formerly application) health indicator by default
This commit renames ApplicationHealthIndicator to PingHealthIndicator
and changes the auto-configuration so that it is now always configured
by default.

Closes gh-17926
5 years ago
Phillip Webb e03f822c6d Add support for health indicator groups
Update the `HealthEndpoint` to support health groups. The
`HealthEndpointSettings` interface has been replaced with
`HealthEndpointGroups` which provides access to the primary group
as well as an optional set of additional groups.

Groups can be configured via properties and may have custom
`StatusAggregator` and `HttpCodeStatusMapper` settings.

Closes gh-14022

Co-authored-by: Stephane Nicoll <snicoll@pivotal.io>
5 years ago
Phillip Webb 3c535e0de3 Add HealthContributor and refactor HealthEndpoint
Overhaul `HealthEndpoint` support to make it easier to support health
groups. Prior to this commit the `HealthIndicator` interface was used
for both regular indicators and composite indicators. In addition the
`Health` result was used to both represent individual, system and
composite health. This design unfortunately means that all health
contributors need to be aware of the `HealthAggregator` and could not
easily support heath groups if per-group aggregation is required.

This commit reworks many aspects of the health support in order to
provide a cleaner separation between a `HealthIndicator`and a
composite. The following changes have been made:

- A `HealthContributor` interface has been introduced to represent
  the general concept of something that contributes health information.
  A contributor can either be a `HealthIndicator` or a
  `CompositeHealthContributor`.

- A `HealthComponent` class has been introduced to mirror the
  contributor arrangement. The component can be either
  `CompositeHealth` or `Health`.

- The `HealthAggregator` interface has been replaced with a more
  focused `StatusAggregator` interface which only deals with `Status`
  results.

- `CompositeHealthIndicator` has been replaced with
  `CompositeHealthContributor` which only provides access to other
  contributors. A composite can no longer directly return `Health`.

- `HealthIndicatorRegistry` has been replaced with
  `HealthContributorRegistry` and the default implementation now
  uses a copy-on-write strategy.

- `HealthEndpoint`, `HealthEndpointWebExtension` and
  `ReactiveHealthEndpointWebExtension` now extend a common
  `HealthEndpointSupport` class. They are now driven by a
  health contributor registry and `HealthEndpointSettings`.

- The `HealthStatusHttpMapper` class has been replaced by a
  `HttpCodeStatusMapper` interface.

- The `HealthWebEndpointResponseMapper` class has been replaced
  by a `HealthEndpointSettings` strategy. This allows us to move
  role related logic and `ShowDetails` to the auto-configure module.

- `SimpleHttpCodeStatusMapper` and `SimpleStatusAggregator`
  implementations have been added which are configured via constructor
  arguments rather than setters.

- Endpoint auto-configuration has been reworked and the
  `CompositeHealthIndicatorConfiguration` class has been replaced
  by `CompositeHealthContributorConfiguration`.

- The endpoint JSON has been changed make `details` distinct from
  `components`.

See gh-17926
5 years ago
Brian Clozel e7c3ab3e27 Rename WebFlux response body methods
This commit adapts to recent changes in Spring Framework.
See spring-projects/spring-framework#23212
5 years ago
Andy Wilkinson cc3df98135 Merge branch '2.1.x' 5 years ago
Andy Wilkinson ab87b2a39b Polish 5 years ago
Stephane Nicoll 6f28f41774 Polish "Simplify some code"
See gh-17860
5 years ago
jason 4bb842343a Simplify some code
See gh-17860
5 years ago
lijuny d8baefc38a Simplify some code
See gh-17834
5 years ago
lijuny 844a8d8027 Simplify some code
See gh-17832
5 years ago
Stephane Nicoll 71cf0a3ec8 Merge branch '2.1.x'
Closes gh-17812
5 years ago
Stephane Nicoll 994f08d234 Polish "Fix annotation lookup on proxied EndpointExtension"
See gh-17807
5 years ago
Jacques-Etienne Beaudet 9083da2876 Fix annotation lookup on proxied EndpointExtension
See gh-17807
5 years ago
Phillip Webb 105df823ee Polish 5 years ago
Phillip Webb 2cdceb92bf Polish 5 years ago
Phillip Webb da4f436140 Change SearchStrategy EXHAUSTIVE to TYPE_HIERARCHY
Fixup references following upstream Spring Framework change.
5 years ago
Phillip Webb 890ea153bf Allow endpoint @Selector to capture all paths
Update `@Selector` with a `match` attribute that can be used to select
all remaining path segments. An endpoint method like this:

	 select(@Selector(match = Match.ALL_REMAINING) String... selection)

Will now have all reaming path segments injected into the `selection`
parameter.

Closes gh-17743
5 years ago
Madhura Bhave 61b86ff231 Polish "Add support for configuring logging groups"
See gh-17515

Co-authored-by: Phillip Webb <pwebb@pivotal.io>
5 years ago
HaiTao Zhang b9047c22e0 Add support for configuring logging groups via endpoint
See gh-17515
5 years ago
Stephane Nicoll 6756385049 Merge branch '2.1.x'
Closes gh-17664
5 years ago
Stephane Nicoll 6356852e2f Polish "Log health check failure with Reactive health indicators"
See gh-17635
5 years ago
Dmytro Nosan fe1b9c9501 Log health check failure with Reactive health indicators
See gh-17635
5 years ago
dreis2211 eb9527a170 Fix deprecation warnings in spring-boot-actuator
See gh-17660
5 years ago
Phillip Webb 8bc780762a Merge branch '2.1.x' 5 years ago
Phillip Webb fb1dd8fe93 Merge branch '2.0.x' into 2.1.x 5 years ago
Phillip Webb 913e831f4e Merge '1.5.x' into 2.0.x 5 years ago
Phillip Webb 6c0dbacfce Polish 5 years ago
Stephane Nicoll 94c35ae1de Polish "Make Actuator dedicated ConversionService configurable"
See gh-16449
5 years ago
Stephane Nicoll be988d7072 Polish "Add HealthIndicator for Hazelcast"
See gh-17499
5 years ago
Dmytro Nosan fca5a2b824 Add HealthIndicator for Hazelcast
See gh-17499
5 years ago
Phillip Webb a9ba7080ce Merge branch '2.1.x' 5 years ago
Phillip Webb fd67f7ba3f Merge branch '1.5.x' into 2.0.x 5 years ago
Stephane Nicoll 56ce2b8e3f Polish "Add metrics support for idle jdbc connections"
See gh-17504
5 years ago
ayudovin 9acc02b5cc Add metrics support for idle jdbc connections
See gh-17504
5 years ago
Phillip Webb 01933f9b06 Merge previously split strings
Merge some string lines that were previously split because of the
90 chars wide formatting.
5 years ago
Phillip Webb c3816bfe7b Polish output capture names 5 years ago
dreis2211 82047a2544 Polish
See gh-17505
5 years ago
Madhura Bhave d590c3ed10 Merge branch '2.1.x'
Closes gh-17486
5 years ago
Madhura Bhave 773dda3d55 Log file location should be evaluated just once
Using a random value for the logfile name caused
the logfile endpoint to return a 404 as the name
was resolved from the environment on every request.
This commit registers a bean for LogFile which is then
used by the logfile endpoint.

Fixes gh-17434
5 years ago
Brian Clozel 2830847344 Optimize reactor operators in actuator support
This commit uses native Reactor operators `Mono.fromCallable` and
`subscribeOn` for better performance and support.

Fixes gh-17452
5 years ago
dreis2211 25586a2e23 Use Assertions.contentOf() where possible
See gh-17444
5 years ago
Andy Wilkinson d93c79316d Align with body method changes in RequestBodySpec
Closes gh-17460
5 years ago
Andy Wilkinson 2816635418 Polish 5 years ago
dreis2211 7c6fd31d06 Use Spring 5 module of Jersey
See gh-17412
5 years ago
Madhura Bhave 39b15af5d6 Polish "Provide links / when using a separate management port"
See gh-17418
5 years ago
HaiTao Zhang c108629311 Provide links for actuators at / when using a separate management port
See gh-17418
5 years ago
Andy Wilkinson e0048f234b Polish 5 years ago
Andy Wilkinson c5cae28261 Add support for plain text thread dumps to the threaddump endpoint
When a request that accepts text/plain is received, the threaddump
endpoint will now return a thread dump in plain text. The format of
this text is modelled after the output produced by JVisualVM when
connecting to a remote process over JMX. Note that this output does
not include all of the information in, for example, JStack's output
as it is not available via Java 8's ThreadInfo API.

Rather than the custom formatting logic, using ThreadInfo's toString()
method was considered but its output is documented as being undefined
and implementation specific. The implementation used while developing
this feature produced output that did not match that of JStack or
JVisualVM and truncated stack traces quite considerably.

At the time of writing the format produced by the endpoint could be
consumed by both Thread Dump Analyzer [1] and https://fastthread.io.

Closes gh-2339

[1] https://github.com/irockel/tda
5 years ago
Phillip Webb a66c4d3096 Unify method visibility of private classes
Apply checkstyle rule to ensure that private and package private
classes do not have unnecessary public methods. Test classes have
also been unified as much as possible to use default scoped
inner-classes.

Closes gh-7316
5 years ago