1178 Commits

Author SHA1 Message Date
Andy Wilkinson
2dce4aa42b Merge branch '2.2.x' into 2.3.x
Closes gh-24009
2020-11-03 14:04:08 +00:00
Andy Wilkinson
30a0ccab02 Remove use of @PostConstruct from main code
When running on Java 11 (where `@PostConstruct` is no longer part of
the JRE) and without a dependency on jakarta-annotation-api,
`@PostContruct` annotions are silently dropped. This leads to obscure and
hard-to-track down changes in the behaviour of our auto-configuration
as the `@PostConstruct`-annotated methods are not invoked.

To allow users to run on Java 11 without having jakarta-annotation-api
on the classpath, this commit removes use of `@PostConstruct` from main
code. A Checkstyle rule has also been added to prevent its usage in
main code from being reintroduced.

Closes gh-23723
2020-11-03 13:59:38 +00:00
Andy Wilkinson
b9516bc77c Await registration of http.server.requests meter
Previously, the test would make an HTTP request and, as soon as the
response was received, it would check the presence and value of the
http.server.requests meter. This create a race condition between the
meter being registered once the response had been flushed and the
meter's presence being checked. If the check won the race, the test
would fail.

This commit updates the test to wait for up to 5 seconds for the
meter to be present and have a count of 1, matching the single request
that has been made.

Fixes gh-23919
2020-10-27 15:54:22 +00:00
Andy Wilkinson
c0bb6ff667 Await registration of http.server.requests meter
Previously, the test would make an HTTP request and, as soon as the
response was received, it would check the presence and value of the
http.server.requests meter. This create a race condition between the
meter being registered once the response had been flushed and the
meter's presence being checked. If the check won the race, the test
would fail.

This commit updates the test to wait for up to 5 seconds for the
meter to be present and have a count of 1, matching the single request
that has been made.

Fixes gh-23863
2020-10-26 14:41:58 +00:00
Stephane Nicoll
f4e822f650 Prevent access to the EMF within the singleton lock
This commit makes sure to defer registration of hibernate statistics
outside of the singleton lock as it can lead to deadlocks when the
EntityManagerFactory is initialized in deferred mode.

Closes gh-23740
2020-10-20 09:59:07 +02:00
Stephane Nicoll
b7a8b0f19b Hacking
See gh-23740
2020-10-20 09:32:40 +02:00
Andy Wilkinson
53f2966b61 Merge branch '2.2.x' into 2.3.x
Closes gh-23305
2020-09-15 12:30:45 +01:00
Andy Wilkinson
5d20660c8a Disable proxyBeanMethods on all management context config classes
Fixes gh-23301
2020-09-15 12:30:32 +01:00
Andy Wilkinson
627ede8bff Remove duplicate jackson-datatype-jsr310 dependency
Closes gh-23123
2020-08-28 12:38:42 +01:00
Phillip Webb
ba2ab3363b Merge branch '2.2.x' into 2.3.x 2020-08-18 15:38:53 -07:00
Phillip Webb
4e76138ebc Update copyright year of changed files 2020-08-18 15:37:59 -07:00
Phillip Webb
ff36f8bab8 Merge branch '2.2.x' into 2.3.x
Closes gh-22989
2020-08-17 16:17:47 -07:00
Phillip Webb
10da595302 Polish 'Order metrics auto-configurations correctly'
See gh-21134
2020-08-17 16:10:18 -07:00
Martin Benda
02b7ec787e Order metrics auto-configurations correctly
Update metrics auto-configurations so that they are auto-configured
after `CompositeMeterRegistryAutoConfiguration` in order to ensure
the `MeterRegistry` bean has been defined.

Prior to this commit, metrics auto-configurations that depended on a
`MeterRegistry` has `@AutoConfigureAfter(MetricsAutoConfiguration.class)`
which is not sufficient since `MetricsAutoConfiguration` does not export
a `MeterRegistry`.

See gh-21134
2020-08-17 16:03:27 -07:00
Stephane Nicoll
df78105a3c Merge branch '2.2.x' into 2.3.x
Closes gh-22930
2020-08-13 11:48:43 +02:00
Stephane Nicoll
f61a632a37 Polish "Fix conditions that lead to auto-configure PushGateway"
See gh-22919
2020-08-13 11:47:43 +02:00
smlc
c355b95f6c Fix conditions that lead to auto-configure PushGateway
See gh-22919
2020-08-13 11:41:49 +02:00
Andy Wilkinson
abf6123bae Upgrade to Kafka 2.5.1
Closes gh-22868
2020-08-11 12:50:15 +01:00
Andy Wilkinson
be32843dab Configure generated snippets as inputs to the Asciidoctor tasks
Closes gh-22819
2020-08-07 11:28:58 +01:00
Madhura Bhave
3f82ca40e2 Merge branch '2.2.x' into 2.3.x
Closes gh-22774
2020-08-06 17:59:30 -07:00
Madhura Bhave
f39f33bb8d Fix documentation related to the health endpoint's inner details
Closes gh-22490
2020-08-06 17:57:56 -07:00
Andy Wilkinson
c40835eba0 Merge branch '2.2.x' into 2.3.x
Closes gh-22746
2020-08-05 17:47:24 +01:00
Andy Wilkinson
71ffb44a3c Remove WebClient's in-memory buffer size limit for endpoint tests
Previously, the endpoints' responses could occasionally exceed
WebClient's in-memory buffer limt, for example if the threads endpoint
was reporting a large number of threads or the threads had large
stacks.

This commit disables WebClient's in-memory buffer size limit so that
the tests passing is not dependent on the size of the endpoints'
responses.

Closes gh-22743
2020-08-05 17:37:44 +01:00
Brian Clozel
8dedeb4c6a Fix missing liveness and readiness indicators
Prior to this commit, the livenessState and readinessState health
indicators would not be configured automatically and would be missing
from the "liveness" and "readiness" health groups, leading to 404s when
hitting the `/actuator/health/liveness` or `/actuator/health/readiness`.

This commit ensures that the health indicators beans have the proper
name and revisits the auto-configuration conditions to reflect that as
well.

Fixes gh-22562
2020-08-01 20:57:34 +02:00
Stephane Nicoll
16aa8fbc88 Fix actuator dependency on Jackson JSR 310 module
This commit harmonizes dependency declarations for Jackson in the
actuator. Both Jackson and JSR 310 are back to optional in the core
actuator module and mandatory when using the auto-configuration.

Closes gh-22624
2020-07-28 16:26:11 +02:00
Andy Wilkinson
ce7210c4f0 Merge branch '2.1.x' into 2.2.x
Closes gh-22563
2020-07-25 09:06:11 +01:00
Nelson Osacky
585aed8f8f Add generated-snippets as output to test goal
The generated snippets were not declared as an output to the
`spring-boot-actuator-autoconfigure` test goal so when the test was
pulled from the cache, it did not contain the `generated-snippets`
directory. This directory is required as an input to the Asciidoctor
plugin.

See gh-22555
2020-07-25 08:26:15 +01:00
Stephane Nicoll
7ed54bda96 Fix typo for management.health.readinessstate.enabled
Closes gh-22560
2020-07-25 07:20:06 +02:00
dreis2211
198131f5e4 Remove redundant compiler arguments in Gradle build files
See gh-22488
2020-07-22 06:42:48 +01:00
Andy Wilkinson
2063c242ae Polish 2020-07-22 06:25:55 +01:00
Brian Clozel
fe807d6c0b Improve liveness/readiness health config
Prior to this commit, the application availability infrastructure
would mix the `AvailabilityState`, the `HealthIndicator` and the
`HealthGroup` concepts and would not align with the rest.

This commit auto-configures the livenessState and readinessState
health indicators with the relevant configuration properties.
Unlike other indicators, they are not enabled by default but might
be in future versions.

This also moves the `management.health.probes.enabled` property
to `management.endpoint.health.probes.enabled` since "probes" here
is not a health indicator but rather a configuration flag for the
health endpoint.

Finally, the probes auto-configuration is refined to automatically
add liveness and readiness indicators for the probes group if
they're not already present.

Closes gh-22107
2020-07-21 16:03:06 +02:00
Andy Wilkinson
dfea2f432a Polish
See gh-21921
2020-07-06 09:41:39 +01:00
Brian Clozel
86d8366ee2 Polish support for reactive Elasticsearch healthcheck
Fixes gh-21042
2020-07-03 15:25:18 +02:00
Aleksander Lech
203878a16f Add support for reactive Elasticsearch healthcheck
Prior to this commit, configuring a reactive Elasticsearch client would
auto-configure an Actuator Health check using a synchronous client, with
the default configuration properties (so tarting localhost:9200).

This would lead to false reports of unhealthy Elasticsearch clusters
when using reactive clients.

This commit reproduces the logic for MongoDB repositories: if a reactive
variant is available, it is selected for the health check
infrastructure.

See gh-21042
2020-07-03 15:16:38 +02:00
Eddú Meléndez
54e0a61b42 Reinstate metrics for Kafka Streams
See gh-21921
2020-07-01 14:03:11 +01:00
Phillip Webb
03b0a373ab Merge branch '2.2.x' into 2.3.x
Closes gh-22063
2020-06-22 23:15:48 -07:00
Phillip Webb
e6eb02603c Polish 'Inherit show-details property in health groups'
Rework the inheritance so that the property metadata JSON more
accurately reflects the default value.

See gh-22022
2020-06-22 23:01:37 -07:00
Leo Li
10de88884f Inherit show-details property in health groups
Update `Group` properties so that the `showDetails` value does not
inherit `Show.NEVER`. Prior to this commit, the `Group` properties
would not correctly inherit a `showDetails` value from the main
`management.endpoint.health.show-details` property.

See gh-22022
2020-06-22 22:54:34 -07: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
Scott Frederick
7a793a11fb Merge branch '2.2.x' into 2.3.x
Fixes gh-21036 in 2.3.1
2020-06-10 13:55:12 -05:00
Scott Frederick
0fa1d0ef2e Handle bind exceptions in management context
This commit updates the logic for handling binding exceptions in the
management context when it is separate from the application context.
The changes allow the exception details to be visible to
DefaultErrorAttributes without causing the servlet container to
detect an error condition.

Fixes gh-21036
2020-06-10 13:53:04 -05: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
Andy Wilkinson
24138c104c Use highlightjs for syntax highlighting in Asciidoctor's HTML output
Closes gh-21701
2020-06-04 20:25:29 +01:00
Andy Wilkinson
daeca9f332 Restore Boot 2.2's compile-scoped dependencies
Fixes gh-21507
2020-06-03 12:55:11 +01:00
Madhura Bhave
d3f72326d0 Merge branch '2.2.x' into 2.3.x
Closes gh-21642
2020-06-01 13:49:59 -07:00
Madhura Bhave
573cb98d90 Make management security configuration back off when SAML present
Fixes gh-21620
2020-06-01 13:39:46 -07:00
Stephane Nicoll
069c31a074 Map connection and read timeouts for New Relic again
Closes gh-21440
2020-05-26 15:20:33 +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