1095 Commits

Author SHA1 Message Date
Andy Wilkinson
b54ff7c45f Merge branch '2.1.x'
Closes gh-17950
2019-08-23 20:34:35 +01:00
Andy Wilkinson
608228d617 Improve handling of non-standard status codes in WebClient metrics
Fixes gh-17695
2019-08-23 20:28:26 +01:00
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
2019-08-22 14:50:10 +01:00
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>
2019-08-21 18:43:25 -07:00
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
2019-08-21 18:43:25 -07:00
Brian Clozel
e7c3ab3e27 Rename WebFlux response body methods
This commit adapts to recent changes in Spring Framework.
See spring-projects/spring-framework#23212
2019-08-20 13:03:24 +02:00
Andy Wilkinson
cc3df98135 Merge branch '2.1.x' 2019-08-19 16:08:25 +01:00
Andy Wilkinson
ab87b2a39b Polish 2019-08-19 16:05:43 +01:00
Stephane Nicoll
6f28f41774 Polish "Simplify some code"
See gh-17860
2019-08-14 08:55:20 +02:00
jason
4bb842343a Simplify some code
See gh-17860
2019-08-14 08:53:02 +02:00
lijuny
d8baefc38a Simplify some code
See gh-17834
2019-08-12 10:31:06 +02:00
lijuny
844a8d8027 Simplify some code
See gh-17832
2019-08-11 10:05:36 +02:00
Stephane Nicoll
71cf0a3ec8 Merge branch '2.1.x'
Closes gh-17812
2019-08-08 14:13:06 +02:00
Stephane Nicoll
994f08d234 Polish "Fix annotation lookup on proxied EndpointExtension"
See gh-17807
2019-08-08 13:58:03 +02:00
Jacques-Etienne Beaudet
9083da2876 Fix annotation lookup on proxied EndpointExtension
See gh-17807
2019-08-08 13:48:21 +02:00
Phillip Webb
105df823ee Polish 2019-08-03 15:42:22 +01:00
Phillip Webb
2cdceb92bf Polish 2019-08-03 14:29:20 +01:00
Phillip Webb
da4f436140 Change SearchStrategy EXHAUSTIVE to TYPE_HIERARCHY
Fixup references following upstream Spring Framework change.
2019-07-31 15:11:43 +01:00
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
2019-07-31 12:44:46 +01:00
Madhura Bhave
61b86ff231 Polish "Add support for configuring logging groups"
See gh-17515

Co-authored-by: Phillip Webb <pwebb@pivotal.io>
2019-07-30 11:28:58 -07:00
HaiTao Zhang
b9047c22e0 Add support for configuring logging groups via endpoint
See gh-17515
2019-07-30 11:13:07 -07:00
Stephane Nicoll
6756385049 Merge branch '2.1.x'
Closes gh-17664
2019-07-29 11:35:11 +02:00
Stephane Nicoll
6356852e2f Polish "Log health check failure with Reactive health indicators"
See gh-17635
2019-07-29 11:25:44 +02:00
Dmytro Nosan
fe1b9c9501 Log health check failure with Reactive health indicators
See gh-17635
2019-07-29 11:18:19 +02:00
dreis2211
eb9527a170 Fix deprecation warnings in spring-boot-actuator
See gh-17660
2019-07-28 15:22:37 +02:00
Phillip Webb
8bc780762a Merge branch '2.1.x' 2019-07-24 11:42:48 +01:00
Phillip Webb
fb1dd8fe93 Merge branch '2.0.x' into 2.1.x 2019-07-24 11:41:32 +01:00
Phillip Webb
913e831f4e Merge '1.5.x' into 2.0.x 2019-07-24 11:39:58 +01:00
Phillip Webb
6c0dbacfce Polish 2019-07-23 15:43:51 +01:00
Stephane Nicoll
94c35ae1de Polish "Make Actuator dedicated ConversionService configurable"
See gh-16449
2019-07-23 12:27:00 +02:00
Stephane Nicoll
be988d7072 Polish "Add HealthIndicator for Hazelcast"
See gh-17499
2019-07-18 15:00:53 +02:00
Dmytro Nosan
fca5a2b824 Add HealthIndicator for Hazelcast
See gh-17499
2019-07-18 14:58:18 +02:00
Phillip Webb
a9ba7080ce Merge branch '2.1.x' 2019-07-17 21:48:42 +01:00
Phillip Webb
fd67f7ba3f Merge branch '1.5.x' into 2.0.x 2019-07-17 21:47:04 +01:00
Stephane Nicoll
56ce2b8e3f Polish "Add metrics support for idle jdbc connections"
See gh-17504
2019-07-17 14:14:47 +02:00
ayudovin
9acc02b5cc Add metrics support for idle jdbc connections
See gh-17504
2019-07-17 14:14:47 +02:00
Phillip Webb
01933f9b06 Merge previously split strings
Merge some string lines that were previously split because of the
90 chars wide formatting.
2019-07-15 00:24:19 +01:00
Phillip Webb
c3816bfe7b Polish output capture names 2019-07-15 00:24:18 +01:00
dreis2211
82047a2544 Polish
See gh-17505
2019-07-14 11:38:40 +02:00
Madhura Bhave
d590c3ed10 Merge branch '2.1.x'
Closes gh-17486
2019-07-10 15:32:22 -07:00
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
2019-07-10 14:46:09 -07:00
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
2019-07-10 12:06:26 +02:00
dreis2211
25586a2e23 Use Assertions.contentOf() where possible
See gh-17444
2019-07-10 06:40:52 +01:00
Andy Wilkinson
d93c79316d Align with body method changes in RequestBodySpec
Closes gh-17460
2019-07-09 12:13:23 +01:00
Andy Wilkinson
2816635418 Polish 2019-07-04 17:51:20 +01:00
Madhura Bhave
39b15af5d6 Polish "Provide links / when using a separate management port"
See gh-17418
2019-07-03 16:19:40 -07:00
HaiTao Zhang
c108629311 Provide links for actuators at / when using a separate management port
See gh-17418
2019-07-03 16:19:40 -07:00
Andy Wilkinson
e0048f234b Polish 2019-07-03 21:59:51 +01:00
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
2019-07-03 21:51:56 +01:00
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
2019-07-03 11:39:47 -07:00