Commit Graph

839 Commits (09d3bf065524ec9bfab6c25f3f5922d00ff19085)

Author SHA1 Message Date
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 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 02965e9744 Fix javadoc warnings
Fixes gh-19572
5 years ago
dreis2211 b1158bf35d Simplify some Stream API usages
See gh-19291
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 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 2c4a1f1c15 Display @Validated constructor bound properties in configprops endpoint
Fixes gh-19219
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 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
thelproad 65ab82b3cd Remove redundant code
See gh-19000
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