Move actuator heath code to spring-boot-health

Closes gh-46357
This commit is contained in:
Phillip Webb
2025-10-14 21:51:24 -07:00
parent 5d21b822ab
commit 34e0382858
140 changed files with 455 additions and 527 deletions
@@ -28,16 +28,16 @@ import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.docs.MockMvcEndpointDocumentationTests;
import org.springframework.boot.actuate.endpoint.SecurityContext;
import org.springframework.boot.actuate.health.AdditionalHealthEndpointPath;
import org.springframework.boot.actuate.health.HealthEndpoint;
import org.springframework.boot.actuate.health.HealthEndpointGroup;
import org.springframework.boot.actuate.health.HealthEndpointGroups;
import org.springframework.boot.actuate.health.HttpCodeStatusMapper;
import org.springframework.boot.actuate.health.SimpleHttpCodeStatusMapper;
import org.springframework.boot.actuate.health.SimpleStatusAggregator;
import org.springframework.boot.actuate.health.StatusAggregator;
import org.springframework.boot.actuate.system.DiskSpaceHealthIndicator;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.health.actuate.endpoint.AdditionalHealthEndpointPath;
import org.springframework.boot.health.actuate.endpoint.HealthEndpoint;
import org.springframework.boot.health.actuate.endpoint.HealthEndpointGroup;
import org.springframework.boot.health.actuate.endpoint.HealthEndpointGroups;
import org.springframework.boot.health.actuate.endpoint.HttpCodeStatusMapper;
import org.springframework.boot.health.actuate.endpoint.SimpleHttpCodeStatusMapper;
import org.springframework.boot.health.actuate.endpoint.SimpleStatusAggregator;
import org.springframework.boot.health.actuate.endpoint.StatusAggregator;
import org.springframework.boot.health.application.DiskSpaceHealthIndicator;
import org.springframework.boot.health.autoconfigure.registry.HealthContributorNameGenerator;
import org.springframework.boot.health.contributor.CompositeHealthContributor;
import org.springframework.boot.health.contributor.Health;
@@ -618,7 +618,7 @@ with the `key` listed in the following table:
| Checks that a connection to javadoc:javax.sql.DataSource[] can be obtained.
| `diskspace`
| javadoc:org.springframework.boot.actuate.system.DiskSpaceHealthIndicator[]
| javadoc:org.springframework.boot.health.info.DiskSpaceHealthIndicator[]
| Checks for low disk space.
| `elasticsearch`
@@ -662,7 +662,7 @@ with the `key` listed in the following table:
| Checks that a Redis server is up.
| `ssl`
| javadoc:org.springframework.boot.actuate.ssl.SslHealthIndicator[]
| javadoc:org.springframework.boot.health.info.SslHealthIndicator[]
| Checks that SSL certificates are ok.
|===
@@ -679,11 +679,11 @@ Additional javadoc:org.springframework.boot.actuate.health.HealthIndicator[] bea
| Key | Name | Description
| `livenessstate`
| javadoc:org.springframework.boot.actuate.availability.LivenessStateHealthIndicator[]
| javadoc:org.springframework.boot.health.application.LivenessStateHealthIndicator[]
| Exposes the "`Liveness`" application availability state.
| `readinessstate`
| javadoc:org.springframework.boot.actuate.availability.ReadinessStateHealthIndicator[]
| javadoc:org.springframework.boot.health.application.ReadinessStateHealthIndicator[]
| Exposes the "`Readiness`" application availability state.
|===
@@ -928,7 +928,7 @@ Applications deployed on Kubernetes can provide information about their internal
Depending on https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/[your Kubernetes configuration], the kubelet calls those probes and reacts to the result.
By default, Spring Boot manages your xref:features/spring-application.adoc#features.spring-application.application-availability[Application Availability] state.
If deployed in a Kubernetes environment, actuator gathers the "`Liveness`" and "`Readiness`" information from the javadoc:org.springframework.boot.availability.ApplicationAvailability[] interface and uses that information in dedicated xref:actuator/endpoints.adoc#actuator.endpoints.health.auto-configured-health-indicators[health indicators]: javadoc:org.springframework.boot.actuate.availability.LivenessStateHealthIndicator[] and javadoc:org.springframework.boot.actuate.availability.ReadinessStateHealthIndicator[].
If deployed in a Kubernetes environment, actuator gathers the "`Liveness`" and "`Readiness`" information from the javadoc:org.springframework.boot.availability.ApplicationAvailability[] interface and uses that information in dedicated xref:actuator/endpoints.adoc#actuator.endpoints.health.auto-configured-health-indicators[health indicators]: javadoc:org.springframework.boot.health.application.LivenessStateHealthIndicator[] and javadoc:org.springframework.boot.health.application.ReadinessStateHealthIndicator[].
These indicators are shown on the global health endpoint (`"/actuator/health"`).
They are also exposed as separate HTTP Probes by using xref:actuator/endpoints.adoc#actuator.endpoints.health.groups[health groups]: `"/actuator/health/liveness"` and `"/actuator/health/readiness"`.
@@ -1255,7 +1255,7 @@ The `info` endpoint publishes information about your process, see javadoc:org.sp
[[actuator.endpoints.info.ssl-information]]
=== SSL Information
The `info` endpoint publishes information about your SSL certificates (that are configured through xref:features/ssl.adoc#features.ssl.bundles[SSL Bundles]), see javadoc:org.springframework.boot.info.SslInfo[] for more details. This endpoint reuses the "warning threshold" property of javadoc:org.springframework.boot.actuate.ssl.SslHealthIndicator[]: if an SSL certificate will be invalid within the time span defined by this threshold, it will trigger a warning. See the `management.health.ssl.certificate-validity-warning-threshold` property.
The `info` endpoint publishes information about your SSL certificates (that are configured through xref:features/ssl.adoc#features.ssl.bundles[SSL Bundles]), see javadoc:org.springframework.boot.info.SslInfo[] for more details. This endpoint reuses the "warning threshold" property of javadoc:org.springframework.boot.health.info.SslHealthIndicator[]: if an SSL certificate will be invalid within the time span defined by this threshold, it will trigger a warning. See the `management.health.ssl.certificate-validity-warning-threshold` property.
@@ -19,7 +19,7 @@ package org.springframework.boot.docs.howto.actuator.maphealthindicatorstometric
import io.micrometer.core.instrument.Gauge;
import io.micrometer.core.instrument.MeterRegistry;
import org.springframework.boot.actuate.health.HealthEndpoint;
import org.springframework.boot.health.actuate.endpoint.HealthEndpoint;
import org.springframework.boot.health.contributor.Status;
import org.springframework.context.annotation.Configuration;
@@ -18,7 +18,7 @@ package org.springframework.boot.docs.howto.actuator.maphealthindicatorstometric
import io.micrometer.core.instrument.Gauge
import io.micrometer.core.instrument.MeterRegistry
import org.springframework.boot.actuate.health.HealthEndpoint
import org.springframework.boot.health.actuate.endpoint.HealthEndpoint
import org.springframework.boot.health.contributor.Status
import org.springframework.context.annotation.Configuration
@@ -22,8 +22,8 @@ import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.health.autoconfigure.actuate.endpoint.HealthEndpointAutoConfiguration;
import org.springframework.boot.health.autoconfigure.contributor.HealthContributorAutoConfiguration;
import org.springframework.boot.health.autoconfigure.registry.HealthContributorRegistryAutoConfiguration;
import org.springframework.boot.health.contributor.Health;
@@ -24,6 +24,7 @@ description = "Spring Boot Actuator Integration Tests"
dependencies {
testImplementation(project(":module:spring-boot-actuator"))
testImplementation(project(":module:spring-boot-actuator-autoconfigure"))
testImplementation(project(":core:spring-boot-autoconfigure"))
testImplementation(project(":module:spring-boot-health"))
testImplementation(project(":module:spring-boot-http-converter"))
@@ -31,10 +31,10 @@ import org.springframework.boot.actuate.audit.InMemoryAuditEventRepository;
import org.springframework.boot.actuate.autoconfigure.beans.BeansEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.context.ShutdownEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.web.exchanges.InMemoryHttpExchangeRepository;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration;
import org.springframework.boot.health.autoconfigure.actuate.endpoint.HealthEndpointAutoConfiguration;
import org.springframework.boot.health.autoconfigure.contributor.HealthContributorAutoConfiguration;
import org.springframework.boot.health.autoconfigure.registry.HealthContributorRegistryAutoConfiguration;
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
@@ -19,10 +19,10 @@ package org.springframework.boot.actuate.autoconfigure.endpoint.web;
import org.junit.jupiter.api.Test;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.actuate.health.HealthEndpointWebExtension;
import org.springframework.boot.actuate.health.ReactiveHealthEndpointWebExtension;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.context.annotation.UserConfigurations;
import org.springframework.boot.health.actuate.endpoint.HealthEndpointWebExtension;
import org.springframework.boot.health.actuate.endpoint.ReactiveHealthEndpointWebExtension;
import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner;
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
@@ -27,6 +27,10 @@ import org.springframework.boot.actuate.endpoint.ApiVersion;
import org.springframework.boot.actuate.endpoint.web.test.WebEndpointTest;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
import org.springframework.boot.health.actuate.endpoint.HealthEndpoint;
import org.springframework.boot.health.actuate.endpoint.HealthEndpointGroups;
import org.springframework.boot.health.actuate.endpoint.HealthEndpointWebExtension;
import org.springframework.boot.health.actuate.endpoint.ReactiveHealthEndpointWebExtension;
import org.springframework.boot.health.autoconfigure.registry.HealthContributorNameGenerator;
import org.springframework.boot.health.contributor.CompositeHealthContributor;
import org.springframework.boot.health.contributor.CompositeReactiveHealthContributor;
@@ -19,6 +19,13 @@ package org.springframework.boot.actuate.health;
import java.util.function.Predicate;
import org.springframework.boot.actuate.endpoint.SecurityContext;
import org.springframework.boot.health.actuate.endpoint.AdditionalHealthEndpointPath;
import org.springframework.boot.health.actuate.endpoint.HealthEndpointGroup;
import org.springframework.boot.health.actuate.endpoint.HealthEndpointGroups;
import org.springframework.boot.health.actuate.endpoint.HttpCodeStatusMapper;
import org.springframework.boot.health.actuate.endpoint.SimpleHttpCodeStatusMapper;
import org.springframework.boot.health.actuate.endpoint.SimpleStatusAggregator;
import org.springframework.boot.health.actuate.endpoint.StatusAggregator;
/**
* Test implementation of {@link HealthEndpointGroups}.
@@ -31,7 +31,6 @@ dependencies {
implementation("tools.jackson.core:jackson-databind")
optional(project(":module:spring-boot-health"))
optional(project(":module:spring-boot-web-server"))
optional("io.micrometer:micrometer-core")
optional("io.projectreactor:reactor-core")
@@ -1,24 +0,0 @@
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Auto-configuration that extends health endpoints so that they can be used as
* availability probes.
*/
@NullMarked
package org.springframework.boot.actuate.autoconfigure.availability;
import org.jspecify.annotations.NullMarked;
@@ -1,23 +0,0 @@
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Auto-configuration for actuator ssl concerns.
*/
@NullMarked
package org.springframework.boot.actuate.autoconfigure.ssl;
import org.jspecify.annotations.NullMarked;
@@ -1,23 +0,0 @@
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Auto-configuration for actuator system concerns.
*/
@NullMarked
package org.springframework.boot.actuate.autoconfigure.system;
import org.jspecify.annotations.NullMarked;
@@ -24,33 +24,6 @@
"description": "Whether to skip SSL verification for Cloud Foundry actuator endpoint security calls.",
"defaultValue": false
},
{
"name": "management.endpoint.health.probes.add-additional-paths",
"type": "java.lang.Boolean",
"description": "Whether to make the liveness and readiness health groups available on the main server port.",
"defaultValue": false
},
{
"name": "management.endpoint.health.probes.enabled",
"type": "java.lang.Boolean",
"description": "Whether to enable liveness and readiness probes.",
"defaultValue": true
},
{
"name": "management.endpoint.health.status.order",
"defaultValue": [
"DOWN",
"OUT_OF_SERVICE",
"UP",
"UNKNOWN"
]
},
{
"name": "management.endpoint.health.validate-group-membership",
"type": "java.lang.Boolean",
"description": "Whether to validate health group membership on startup. Validation fails if a group includes or excludes a health contributor that does not exist.",
"defaultValue": true
},
{
"name": "management.endpoints.access.default",
"type": "org.springframework.boot.actuate.endpoint.Access",
@@ -99,60 +72,6 @@
"health"
]
},
{
"name": "management.health.defaults.enabled",
"type": "java.lang.Boolean",
"description": "Whether to enable default health indicators.",
"defaultValue": true
},
{
"name": "management.health.diskspace.enabled",
"type": "java.lang.Boolean",
"description": "Whether to enable disk space health check.",
"defaultValue": true
},
{
"name": "management.health.influxdb.enabled",
"type": "java.lang.Boolean",
"deprecation": {
"level": "error",
"reason": "InfluxDB support has been removed."
}
},
{
"name": "management.health.livenessstate.enabled",
"type": "java.lang.Boolean",
"description": "Whether to enable liveness state health check.",
"defaultValue": false
},
{
"name": "management.health.ping.enabled",
"type": "java.lang.Boolean",
"description": "Whether to enable ping health check.",
"defaultValue": true
},
{
"name": "management.health.probes.enabled",
"type": "java.lang.Boolean",
"description": "Whether to enable liveness and readiness probes.",
"defaultValue": false,
"deprecation": {
"level": "error",
"replacement": "management.endpoint.health.probes.enabled"
}
},
{
"name": "management.health.readinessstate.enabled",
"type": "java.lang.Boolean",
"description": "Whether to enable readiness state health check.",
"defaultValue": false
},
{
"name": "management.health.ssl.enabled",
"type": "java.lang.Boolean",
"description": "Whether to enable SSL certificate health check.",
"defaultValue": true
},
{
"name": "management.httpexchanges.recording.enabled",
"type": "java.lang.Boolean",
@@ -482,28 +401,6 @@
"name": "any"
}
]
},
{
"name": "management.health.status.order",
"values": [
{
"value": "UNKNOWN"
},
{
"value": "UP"
},
{
"value": "DOWN"
},
{
"value": "OUT_OF_SERVICE"
}
],
"providers": [
{
"name": "any"
}
]
}
]
}
@@ -1,3 +0,0 @@
# Failure Analyzers
org.springframework.boot.diagnostics.FailureAnalyzer=\
org.springframework.boot.actuate.autoconfigure.health.NoSuchHealthContributorFailureAnalyzer
@@ -1,7 +1,5 @@
org.springframework.boot.actuate.autoconfigure.audit.AuditAutoConfiguration
org.springframework.boot.actuate.autoconfigure.audit.AuditEventsEndpointAutoConfiguration
org.springframework.boot.actuate.autoconfigure.availability.AvailabilityHealthContributorAutoConfiguration
org.springframework.boot.actuate.autoconfigure.availability.AvailabilityProbesAutoConfiguration
org.springframework.boot.actuate.autoconfigure.beans.BeansEndpointAutoConfiguration
org.springframework.boot.actuate.autoconfigure.condition.ConditionsReportEndpointAutoConfiguration
org.springframework.boot.actuate.autoconfigure.context.ShutdownEndpointAutoConfiguration
@@ -11,7 +9,6 @@ org.springframework.boot.actuate.autoconfigure.endpoint.jackson.JacksonEndpointA
org.springframework.boot.actuate.autoconfigure.endpoint.jmx.JmxEndpointAutoConfiguration
org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration
org.springframework.boot.actuate.autoconfigure.env.EnvironmentEndpointAutoConfiguration
org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration
org.springframework.boot.actuate.autoconfigure.info.InfoContributorAutoConfiguration
org.springframework.boot.actuate.autoconfigure.info.InfoEndpointAutoConfiguration
org.springframework.boot.actuate.autoconfigure.logging.LogFileWebEndpointAutoConfiguration
@@ -20,9 +17,7 @@ org.springframework.boot.actuate.autoconfigure.management.HeapDumpWebEndpointAut
org.springframework.boot.actuate.autoconfigure.management.ThreadDumpEndpointAutoConfiguration
org.springframework.boot.actuate.autoconfigure.sbom.SbomEndpointAutoConfiguration
org.springframework.boot.actuate.autoconfigure.scheduling.ScheduledTasksEndpointAutoConfiguration
org.springframework.boot.actuate.autoconfigure.ssl.SslHealthContributorAutoConfiguration
org.springframework.boot.actuate.autoconfigure.startup.StartupEndpointAutoConfiguration
org.springframework.boot.actuate.autoconfigure.system.DiskSpaceHealthContributorAutoConfiguration
org.springframework.boot.actuate.autoconfigure.web.exchanges.HttpExchangesEndpointAutoConfiguration
org.springframework.boot.actuate.autoconfigure.web.mappings.MappingsEndpointAutoConfiguration
org.springframework.boot.actuate.autoconfigure.web.server.ManagementContextAutoConfiguration
-1
View File
@@ -27,7 +27,6 @@ description = "Spring Boot Actuator"
dependencies {
api(project(":core:spring-boot"))
optional(project(":module:spring-boot-health"))
optional("com.github.ben-manes.caffeine:caffeine")
optional("com.google.code.findbugs:jsr305")
optional("com.zaxxer:HikariCP")
@@ -1,23 +0,0 @@
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Actuator support for system-related concerns.
*/
@NullMarked
package org.springframework.boot.actuate.system;
import org.jspecify.annotations.NullMarked;
@@ -34,8 +34,8 @@ import org.springframework.boot.actuate.endpoint.web.PathMapper;
import org.springframework.boot.actuate.endpoint.web.WebOperation;
import org.springframework.boot.actuate.endpoint.web.annotation.EndpointWebExtension;
import org.springframework.boot.actuate.endpoint.web.annotation.WebEndpointDiscoverer;
import org.springframework.boot.actuate.health.HealthEndpoint;
import org.springframework.boot.cloudfoundry.autoconfigure.actuate.endpoint.CloudFoundryWebEndpointDiscoverer.CloudFoundryWebEndpointDiscovererRuntimeHints;
import org.springframework.boot.health.actuate.endpoint.HealthEndpoint;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ImportRuntimeHints;
import org.springframework.core.annotation.MergedAnnotations;
@@ -29,7 +29,6 @@ import org.springframework.beans.BeansException;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnAvailableEndpoint;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.info.InfoEndpointAutoConfiguration;
import org.springframework.boot.actuate.endpoint.ExposableEndpoint;
import org.springframework.boot.actuate.endpoint.invoke.ParameterValueMapper;
@@ -37,8 +36,6 @@ import org.springframework.boot.actuate.endpoint.web.EndpointMapping;
import org.springframework.boot.actuate.endpoint.web.EndpointMediaTypes;
import org.springframework.boot.actuate.endpoint.web.ExposableWebEndpoint;
import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints;
import org.springframework.boot.actuate.health.HealthEndpoint;
import org.springframework.boot.actuate.health.ReactiveHealthEndpointWebExtension;
import org.springframework.boot.actuate.info.GitInfoContributor;
import org.springframework.boot.actuate.info.InfoContributor;
import org.springframework.boot.actuate.info.InfoEndpoint;
@@ -55,6 +52,8 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplicat
import org.springframework.boot.cloud.CloudPlatform;
import org.springframework.boot.cloudfoundry.autoconfigure.actuate.endpoint.CloudFoundryWebEndpointDiscoverer;
import org.springframework.boot.cloudfoundry.autoconfigure.actuate.endpoint.servlet.CloudFoundryInfoEndpointWebExtension;
import org.springframework.boot.health.actuate.endpoint.HealthEndpoint;
import org.springframework.boot.health.actuate.endpoint.ReactiveHealthEndpointWebExtension;
import org.springframework.boot.info.GitProperties;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
@@ -78,7 +77,8 @@ import org.springframework.web.server.WebFilter;
* @author Madhura Bhave
* @since 4.0.0
*/
@AutoConfiguration(after = { HealthEndpointAutoConfiguration.class, InfoEndpointAutoConfiguration.class })
@AutoConfiguration(after = InfoEndpointAutoConfiguration.class,
afterName = "org.springframework.boot.health.autoconfigure.actuate.endpoint.HealthEndpointAutoConfiguration")
@ConditionalOnBooleanProperty(name = "management.cloudfoundry.enabled", matchIfMissing = true)
@ConditionalOnWebApplication(type = Type.REACTIVE)
@ConditionalOnCloudPlatform(CloudPlatform.CLOUD_FOUNDRY)
@@ -25,10 +25,10 @@ import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
import org.springframework.boot.actuate.endpoint.annotation.Selector;
import org.springframework.boot.actuate.endpoint.annotation.Selector.Match;
import org.springframework.boot.actuate.endpoint.web.WebEndpointResponse;
import org.springframework.boot.actuate.health.HealthDescriptor;
import org.springframework.boot.actuate.health.HealthEndpoint;
import org.springframework.boot.actuate.health.ReactiveHealthEndpointWebExtension;
import org.springframework.boot.cloudfoundry.autoconfigure.actuate.endpoint.EndpointCloudFoundryExtension;
import org.springframework.boot.health.actuate.endpoint.HealthDescriptor;
import org.springframework.boot.health.actuate.endpoint.HealthEndpoint;
import org.springframework.boot.health.actuate.endpoint.ReactiveHealthEndpointWebExtension;
/**
* Reactive {@link EndpointExtension @EndpointExtension} for the {@link HealthEndpoint}
@@ -26,7 +26,6 @@ import org.jspecify.annotations.Nullable;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnAvailableEndpoint;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.info.InfoEndpointAutoConfiguration;
import org.springframework.boot.actuate.endpoint.ExposableEndpoint;
import org.springframework.boot.actuate.endpoint.invoke.ParameterValueMapper;
@@ -34,8 +33,6 @@ import org.springframework.boot.actuate.endpoint.web.EndpointMapping;
import org.springframework.boot.actuate.endpoint.web.EndpointMediaTypes;
import org.springframework.boot.actuate.endpoint.web.ExposableWebEndpoint;
import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints;
import org.springframework.boot.actuate.health.HealthEndpoint;
import org.springframework.boot.actuate.health.HealthEndpointWebExtension;
import org.springframework.boot.actuate.info.GitInfoContributor;
import org.springframework.boot.actuate.info.InfoContributor;
import org.springframework.boot.actuate.info.InfoEndpoint;
@@ -51,6 +48,8 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplicat
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
import org.springframework.boot.cloud.CloudPlatform;
import org.springframework.boot.cloudfoundry.autoconfigure.actuate.endpoint.CloudFoundryWebEndpointDiscoverer;
import org.springframework.boot.health.actuate.endpoint.HealthEndpoint;
import org.springframework.boot.health.actuate.endpoint.HealthEndpointWebExtension;
import org.springframework.boot.info.GitProperties;
import org.springframework.boot.restclient.RestTemplateBuilder;
import org.springframework.context.ApplicationContext;
@@ -78,8 +77,9 @@ import org.springframework.web.servlet.DispatcherServlet;
* @author Madhura Bhave
* @since 4.0.0
*/
@AutoConfiguration(after = { HealthEndpointAutoConfiguration.class, InfoEndpointAutoConfiguration.class },
afterName = "org.springframework.boot.servlet.autoconfigure.actuate.web.ServletManagementContextAutoConfiguration")
@AutoConfiguration(after = InfoEndpointAutoConfiguration.class, afterName = {
"org.springframework.boot.health.autoconfigure.actuate.endpoint.HealthEndpointAutoConfiguration",
"org.springframework.boot.servlet.autoconfigure.actuate.web.ServletManagementContextAutoConfiguration" })
@ConditionalOnBooleanProperty(name = "management.cloudfoundry.enabled", matchIfMissing = true)
@ConditionalOnWebApplication(type = Type.SERVLET)
@ConditionalOnClass(DispatcherServlet.class)
@@ -23,10 +23,10 @@ import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
import org.springframework.boot.actuate.endpoint.annotation.Selector;
import org.springframework.boot.actuate.endpoint.annotation.Selector.Match;
import org.springframework.boot.actuate.endpoint.web.WebEndpointResponse;
import org.springframework.boot.actuate.health.HealthDescriptor;
import org.springframework.boot.actuate.health.HealthEndpoint;
import org.springframework.boot.actuate.health.HealthEndpointWebExtension;
import org.springframework.boot.cloudfoundry.autoconfigure.actuate.endpoint.EndpointCloudFoundryExtension;
import org.springframework.boot.health.actuate.endpoint.HealthDescriptor;
import org.springframework.boot.health.actuate.endpoint.HealthEndpoint;
import org.springframework.boot.health.actuate.endpoint.HealthEndpointWebExtension;
/**
* {@link EndpointExtension @EndpointExtension} for the {@link HealthEndpoint} that always
@@ -39,9 +39,9 @@ import org.springframework.boot.actuate.endpoint.web.ExposableWebEndpoint;
import org.springframework.boot.actuate.endpoint.web.PathMapper;
import org.springframework.boot.actuate.endpoint.web.WebOperation;
import org.springframework.boot.actuate.endpoint.web.annotation.EndpointWebExtension;
import org.springframework.boot.actuate.health.HealthEndpoint;
import org.springframework.boot.actuate.health.HealthEndpointGroups;
import org.springframework.boot.cloudfoundry.autoconfigure.actuate.endpoint.CloudFoundryWebEndpointDiscoverer.CloudFoundryWebEndpointDiscovererRuntimeHints;
import org.springframework.boot.health.actuate.endpoint.HealthEndpoint;
import org.springframework.boot.health.actuate.endpoint.HealthEndpointGroups;
import org.springframework.boot.health.registry.HealthContributorRegistry;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
@@ -35,7 +35,6 @@ import reactor.netty.http.HttpResources;
import org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.info.InfoContributorAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.info.InfoEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementContextAutoConfiguration;
@@ -50,6 +49,7 @@ import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
import org.springframework.boot.autoconfigure.info.ProjectInfoAutoConfiguration;
import org.springframework.boot.cloudfoundry.autoconfigure.actuate.endpoint.servlet.CloudFoundryInfoEndpointWebExtension;
import org.springframework.boot.health.autoconfigure.actuate.endpoint.HealthEndpointAutoConfiguration;
import org.springframework.boot.health.autoconfigure.contributor.HealthContributorAutoConfiguration;
import org.springframework.boot.health.autoconfigure.registry.HealthContributorRegistryAutoConfiguration;
import org.springframework.boot.http.converter.autoconfigure.HttpMessageConvertersAutoConfiguration;
@@ -260,7 +260,10 @@ class CloudFoundryReactiveActuatorAutoConfigurationTests {
"vcap.application.cf_api:https://my-cloud-controller.com")
.run((context) -> {
Collection<ExposableWebEndpoint> endpoints = getHandlerMapping(context).getEndpoints();
ExposableWebEndpoint endpoint = endpoints.iterator().next();
ExposableWebEndpoint endpoint = endpoints.stream()
.filter((candidate) -> candidate.getEndpointId().toLowerCaseString().equals("health"))
.findFirst()
.get();
assertThat(endpoint.getOperations()).hasSize(2);
WebOperation webOperation = findOperationWithRequestPath(endpoint, "health");
assertThat(webOperation).extracting("invoker")
@@ -23,15 +23,15 @@ import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementContextAutoConfiguration;
import org.springframework.boot.actuate.endpoint.ApiVersion;
import org.springframework.boot.actuate.endpoint.web.WebEndpointResponse;
import org.springframework.boot.actuate.health.CompositeHealthDescriptor;
import org.springframework.boot.actuate.health.HealthDescriptor;
import org.springframework.boot.actuate.health.IndicatedHealthDescriptor;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
import org.springframework.boot.health.actuate.endpoint.CompositeHealthDescriptor;
import org.springframework.boot.health.actuate.endpoint.HealthDescriptor;
import org.springframework.boot.health.actuate.endpoint.IndicatedHealthDescriptor;
import org.springframework.boot.health.autoconfigure.actuate.endpoint.HealthEndpointAutoConfiguration;
import org.springframework.boot.health.autoconfigure.contributor.HealthContributorAutoConfiguration;
import org.springframework.boot.health.autoconfigure.registry.HealthContributorRegistryAutoConfiguration;
import org.springframework.boot.health.contributor.Health;
@@ -25,7 +25,6 @@ import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementContextAutoConfiguration;
import org.springframework.boot.actuate.endpoint.ApiVersion;
import org.springframework.boot.actuate.endpoint.EndpointId;
@@ -38,6 +37,7 @@ import org.springframework.boot.actuate.endpoint.web.WebOperation;
import org.springframework.boot.actuate.endpoint.web.WebOperationRequestPredicate;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
import org.springframework.boot.health.autoconfigure.actuate.endpoint.HealthEndpointAutoConfiguration;
import org.springframework.boot.health.autoconfigure.contributor.HealthContributorAutoConfiguration;
import org.springframework.boot.health.autoconfigure.registry.HealthContributorRegistryAutoConfiguration;
import org.springframework.boot.http.converter.autoconfigure.HttpMessageConvertersAutoConfiguration;
@@ -22,14 +22,14 @@ import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementContextAutoConfiguration;
import org.springframework.boot.actuate.endpoint.ApiVersion;
import org.springframework.boot.actuate.health.CompositeHealthDescriptor;
import org.springframework.boot.actuate.health.HealthDescriptor;
import org.springframework.boot.actuate.health.IndicatedHealthDescriptor;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
import org.springframework.boot.health.actuate.endpoint.CompositeHealthDescriptor;
import org.springframework.boot.health.actuate.endpoint.HealthDescriptor;
import org.springframework.boot.health.actuate.endpoint.IndicatedHealthDescriptor;
import org.springframework.boot.health.autoconfigure.actuate.endpoint.HealthEndpointAutoConfiguration;
import org.springframework.boot.health.autoconfigure.contributor.HealthContributorAutoConfiguration;
import org.springframework.boot.health.autoconfigure.registry.HealthContributorRegistryAutoConfiguration;
import org.springframework.boot.health.contributor.Health;
@@ -22,13 +22,13 @@ import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.info.InfoContributorAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.info.InfoEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementContextAutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
import org.springframework.boot.autoconfigure.info.ProjectInfoAutoConfiguration;
import org.springframework.boot.health.autoconfigure.actuate.endpoint.HealthEndpointAutoConfiguration;
import org.springframework.boot.http.converter.autoconfigure.HttpMessageConvertersAutoConfiguration;
import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration;
import org.springframework.boot.restclient.autoconfigure.RestTemplateAutoConfiguration;
+6
View File
@@ -17,6 +17,7 @@
plugins {
id "java-library"
id "org.springframework.boot.auto-configuration"
id "org.springframework.boot.configuration-properties"
id "org.springframework.boot.deployed"
id "org.springframework.boot.optional-dependencies"
}
@@ -29,6 +30,7 @@ dependencies {
compileOnly("com.google.code.findbugs:jsr305")
optional(project(":core:spring-boot-autoconfigure"))
optional(project(":module:spring-boot-actuator-autoconfigure"))
optional("io.projectreactor:reactor-core")
optional("com.fasterxml.jackson.core:jackson-annotations")
@@ -36,10 +38,14 @@ dependencies {
testImplementation(project(":test-support:spring-boot-test-support"))
testImplementation("io.projectreactor:reactor-test")
testImplementation("tools.jackson.core:jackson-databind")
testImplementation("org.springframework.security:spring-security-core")
testImplementation("org.springframework:spring-web")
testImplementation("org.springframework:spring-webflux")
testCompileOnly("com.google.code.findbugs:jsr305")
testRuntimeOnly("ch.qos.logback:logback-classic")
testRuntimeOnly("jakarta.servlet:jakarta.servlet-api")
}
tasks.named("compileTestJava") {
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import org.jspecify.annotations.Nullable;
@@ -27,7 +27,7 @@ import org.springframework.util.StringUtils;
*
* @author Phillip Webb
* @author Madhura Bhave
* @since 2.6.0
* @since 4.0.0
*/
public final class AdditionalHealthEndpointPath {
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import java.util.Map;
import java.util.TreeMap;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import java.util.Iterator;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import com.fasterxml.jackson.annotation.JsonUnwrapped;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import java.time.Duration;
import java.util.Map;
@@ -41,7 +41,7 @@ import org.springframework.boot.health.registry.ReactiveHealthContributorRegistr
* @author Andy Wilkinson
* @author Stephane Nicoll
* @author Scott Frederick
* @since 2.0.0
* @since 4.0.0
*/
@Endpoint(id = "health")
public class HealthEndpoint extends HealthEndpointSupport<Health, HealthDescriptor> {
@@ -58,7 +58,6 @@ public class HealthEndpoint extends HealthEndpointSupport<Health, HealthDescript
* @param groups the health endpoint groups
* @param slowContributorLoggingThreshold duration after which slow health indicator
* logging should occur
* @since 4.0.0
*/
public HealthEndpoint(HealthContributorRegistry registry,
@Nullable ReactiveHealthContributorRegistry fallbackRegistry, HealthEndpointGroups groups,
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import org.jspecify.annotations.Nullable;
@@ -28,7 +28,7 @@ import org.springframework.boot.health.contributor.HealthContributor;
*
* @author Phillip Webb
* @author Madhura Bhave
* @since 2.2.0
* @since 4.0.0
*/
public interface HealthEndpointGroup {
@@ -71,7 +71,6 @@ public interface HealthEndpointGroup {
* Return an additional path that can be used to map the health group to an
* alternative location.
* @return the additional health path or {@code null}
* @since 2.6.0
*/
@Nullable AdditionalHealthEndpointPath getAdditionalPath();
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import java.util.LinkedHashSet;
import java.util.Map;
@@ -29,7 +29,7 @@ import org.springframework.util.Assert;
* A collection of {@link HealthEndpointGroup groups} for use with a health endpoint.
*
* @author Phillip Webb
* @since 2.2.0
* @since 4.0.0
*/
public interface HealthEndpointGroups {
@@ -57,7 +57,6 @@ public interface HealthEndpointGroups {
* with that path is found.
* @param path the additional path
* @return the matching {@link HealthEndpointGroup} or {@code null}
* @since 2.6.0
*/
default @Nullable HealthEndpointGroup get(AdditionalHealthEndpointPath path) {
Assert.notNull(path, "'path' must not be null");
@@ -76,7 +75,6 @@ public interface HealthEndpointGroups {
* {@link WebServerNamespace}.
* @param namespace the {@link WebServerNamespace}
* @return the matching groups
* @since 2.6.0
*/
default Set<HealthEndpointGroup> getAllWithAdditionalPath(WebServerNamespace namespace) {
Assert.notNull(namespace, "'namespace' must not be null");
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
/**
* Hook that allows for custom modification of {@link HealthEndpointGroups} &mdash; for
@@ -22,7 +22,7 @@ package org.springframework.boot.actuate.health;
*
* @author Phillip Webb
* @author Brian Clozel
* @since 2.3.0
* @since 4.0.0
*/
@FunctionalInterface
public interface HealthEndpointGroupsPostProcessor {
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import java.time.Duration;
import java.time.Instant;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import java.time.Duration;
import java.util.Arrays;
@@ -47,7 +47,7 @@ import org.springframework.context.annotation.ImportRuntimeHints;
* @author Madhura Bhave
* @author Stephane Nicoll
* @author Scott Frederick
* @since 2.0.0
* @since 4.0.0
*/
@EndpointWebExtension(endpoint = HealthEndpoint.class)
@ImportRuntimeHints(HealthEndpointWebExtensionRuntimeHints.class)
@@ -60,7 +60,6 @@ public class HealthEndpointWebExtension extends HealthEndpointSupport<Health, He
* @param groups the health endpoint groups
* @param slowContributorLoggingThreshold duration after which slow health indicator
* logging should occur
* @since 4.0.0
*/
public HealthEndpointWebExtension(HealthContributorRegistry registry,
@Nullable ReactiveHealthContributorRegistry fallbackRegistry, HealthEndpointGroups groups,
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import org.jspecify.annotations.Nullable;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import org.springframework.boot.health.contributor.Status;
@@ -23,14 +23,13 @@ import org.springframework.boot.health.contributor.Status;
*
* @author Stephane Nicoll
* @author Phillip Webb
* @since 2.2.0
* @since 4.0.0
*/
@FunctionalInterface
public interface HttpCodeStatusMapper {
/**
* An {@link HttpCodeStatusMapper} instance using default mappings.
* @since 2.3.0
*/
HttpCodeStatusMapper DEFAULT = new SimpleHttpCodeStatusMapper();
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import java.util.Map;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import java.time.Duration;
import java.util.Arrays;
@@ -45,7 +45,7 @@ import org.springframework.context.annotation.ImportRuntimeHints;
* @author Stephane Nicoll
* @author Phillip Webb
* @author Scott Frederick
* @since 2.0.0
* @since 4.0.0
*/
@EndpointWebExtension(endpoint = HealthEndpoint.class)
@ImportRuntimeHints(HealthEndpointWebExtensionRuntimeHints.class)
@@ -59,7 +59,6 @@ public class ReactiveHealthEndpointWebExtension
* @param groups the health endpoint groups
* @param slowContributorLoggingThreshold duration after which slow health indicator
* logging should occur
* @since 4.0.0
*/
public ReactiveHealthEndpointWebExtension(ReactiveHealthContributorRegistry registry,
@Nullable HealthContributorRegistry fallbackRegistry, HealthEndpointGroups groups,
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import java.util.Collections;
import java.util.HashMap;
@@ -33,7 +33,7 @@ import org.springframework.util.CollectionUtils;
*
* @author Stephane Nicoll
* @author Phillip Webb
* @since 2.2.0
* @since 4.0.0
*/
public class SimpleHttpCodeStatusMapper implements HttpCodeStatusMapper {
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import java.util.ArrayList;
import java.util.Arrays;
@@ -35,7 +35,7 @@ import org.springframework.util.ObjectUtils;
* {@link StatusAggregator} backed by an ordered status list.
*
* @author Phillip Webb
* @since 2.2.0
* @since 4.0.0
*/
public class SimpleStatusAggregator implements StatusAggregator {
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import java.util.Arrays;
import java.util.LinkedHashSet;
@@ -30,7 +30,7 @@ import org.springframework.boot.health.contributor.Status;
* {@link Health#getStatus()} into one state for the entire system.
*
* @author Phillip Webb
* @since 2.2.0
* @since 4.0.0
*/
@FunctionalInterface
public interface StatusAggregator {
@@ -38,7 +38,6 @@ public interface StatusAggregator {
/**
* Return {@link StatusAggregator} instance using default ordering rules.
* @return a {@code StatusAggregator} with default ordering rules.
* @since 2.3.0
*/
static StatusAggregator getDefault() {
return SimpleStatusAggregator.INSTANCE;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import java.util.Map;
import java.util.Set;
@@ -15,9 +15,9 @@
*/
/**
* Actuator support for ssl concerns.
* Actuator endpoint for health.
*/
@NullMarked
package org.springframework.boot.actuate.ssl;
package org.springframework.boot.health.actuate.endpoint;
import org.jspecify.annotations.NullMarked;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.availability;
package org.springframework.boot.health.application;
import java.util.EnumSet;
import java.util.HashMap;
@@ -37,7 +37,7 @@ import org.springframework.util.Assert;
*
* @author Phillip Webb
* @author Brian Clozel
* @since 2.3.0
* @since 4.0.0
*/
public class AvailabilityStateHealthIndicator extends AbstractHealthIndicator {
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.system;
package org.springframework.boot.health.application;
import java.io.File;
@@ -35,7 +35,7 @@ import org.springframework.util.unit.DataSize;
* @author Mattias Severson
* @author Andy Wilkinson
* @author Stephane Nicoll
* @since 2.0.0
* @since 4.0.0
*/
public class DiskSpaceHealthIndicator extends AbstractHealthIndicator {
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.availability;
package org.springframework.boot.health.application;
import org.springframework.boot.availability.ApplicationAvailability;
import org.springframework.boot.availability.AvailabilityState;
@@ -26,7 +26,7 @@ import org.springframework.boot.health.contributor.Status;
* A {@link HealthIndicator} that checks the {@link LivenessState} of the application.
*
* @author Brian Clozel
* @since 2.3.0
* @since 4.0.0
*/
public class LivenessStateHealthIndicator extends AvailabilityStateHealthIndicator {
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.availability;
package org.springframework.boot.health.application;
import org.springframework.boot.availability.ApplicationAvailability;
import org.springframework.boot.availability.AvailabilityState;
@@ -27,7 +27,7 @@ import org.springframework.boot.health.contributor.Status;
*
* @author Brian Clozel
* @author Phillip Webb
* @since 2.3.0
* @since 4.0.0
*/
public class ReadinessStateHealthIndicator extends AvailabilityStateHealthIndicator {
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.ssl;
package org.springframework.boot.health.application;
import java.time.Duration;
import java.time.Instant;
@@ -39,7 +39,7 @@ import org.springframework.util.Assert;
*
* @author Jonatan Ivanov
* @author Young Jae You
* @since 3.4.0
* @since 4.0.0
*/
public class SslHealthIndicator extends AbstractHealthIndicator {
@@ -15,9 +15,9 @@
*/
/**
* Actuator support for application availability concerns.
* Health indicators providing information about an application.
*/
@NullMarked
package org.springframework.boot.actuate.availability;
package org.springframework.boot.health.application;
import org.jspecify.annotations.NullMarked;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.autoconfigure.health;
package org.springframework.boot.health.autoconfigure.actuate.endpoint;
import java.util.Collection;
import java.util.function.Predicate;
@@ -23,10 +23,10 @@ import org.jspecify.annotations.Nullable;
import org.springframework.boot.actuate.endpoint.SecurityContext;
import org.springframework.boot.actuate.endpoint.Show;
import org.springframework.boot.actuate.health.AdditionalHealthEndpointPath;
import org.springframework.boot.actuate.health.HealthEndpointGroup;
import org.springframework.boot.actuate.health.HttpCodeStatusMapper;
import org.springframework.boot.actuate.health.StatusAggregator;
import org.springframework.boot.health.actuate.endpoint.AdditionalHealthEndpointPath;
import org.springframework.boot.health.actuate.endpoint.HealthEndpointGroup;
import org.springframework.boot.health.actuate.endpoint.HttpCodeStatusMapper;
import org.springframework.boot.health.actuate.endpoint.StatusAggregator;
/**
* Auto-configured {@link HealthEndpointGroup} backed by {@link HealthProperties}.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.autoconfigure.health;
package org.springframework.boot.health.autoconfigure.actuate.endpoint;
import java.util.ArrayList;
import java.util.Collections;
@@ -34,20 +34,20 @@ import org.springframework.beans.factory.BeanFactoryUtils;
import org.springframework.beans.factory.ListableBeanFactory;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.annotation.BeanFactoryAnnotationUtils;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointProperties.Group;
import org.springframework.boot.actuate.autoconfigure.health.HealthProperties.Status;
import org.springframework.boot.actuate.endpoint.EndpointId;
import org.springframework.boot.actuate.endpoint.Show;
import org.springframework.boot.actuate.endpoint.web.AdditionalPathsMapper;
import org.springframework.boot.actuate.endpoint.web.WebServerNamespace;
import org.springframework.boot.actuate.health.AdditionalHealthEndpointPath;
import org.springframework.boot.actuate.health.HealthEndpoint;
import org.springframework.boot.actuate.health.HealthEndpointGroup;
import org.springframework.boot.actuate.health.HealthEndpointGroups;
import org.springframework.boot.actuate.health.HttpCodeStatusMapper;
import org.springframework.boot.actuate.health.SimpleHttpCodeStatusMapper;
import org.springframework.boot.actuate.health.SimpleStatusAggregator;
import org.springframework.boot.actuate.health.StatusAggregator;
import org.springframework.boot.health.actuate.endpoint.AdditionalHealthEndpointPath;
import org.springframework.boot.health.actuate.endpoint.HealthEndpoint;
import org.springframework.boot.health.actuate.endpoint.HealthEndpointGroup;
import org.springframework.boot.health.actuate.endpoint.HealthEndpointGroups;
import org.springframework.boot.health.actuate.endpoint.HttpCodeStatusMapper;
import org.springframework.boot.health.actuate.endpoint.SimpleHttpCodeStatusMapper;
import org.springframework.boot.health.actuate.endpoint.SimpleStatusAggregator;
import org.springframework.boot.health.actuate.endpoint.StatusAggregator;
import org.springframework.boot.health.autoconfigure.actuate.endpoint.HealthEndpointProperties.Group;
import org.springframework.boot.health.autoconfigure.actuate.endpoint.HealthProperties.Status;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.util.CollectionUtils;
@@ -14,10 +14,8 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.autoconfigure.availability;
package org.springframework.boot.health.autoconfigure.actuate.endpoint;
import org.springframework.boot.actuate.availability.LivenessStateHealthIndicator;
import org.springframework.boot.actuate.availability.ReadinessStateHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.availability.ApplicationAvailabilityAutoConfiguration;
@@ -25,7 +23,9 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProp
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.availability.ApplicationAvailability;
import org.springframework.boot.health.contributor.Health;
import org.springframework.boot.health.application.LivenessStateHealthIndicator;
import org.springframework.boot.health.application.ReadinessStateHealthIndicator;
import org.springframework.boot.health.autoconfigure.application.AvailabilityHealthContributorAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.core.env.Environment;
@@ -34,11 +34,11 @@ import org.springframework.core.env.Environment;
*
* @author Brian Clozel
* @author Phillip Webb
* @since 2.3.0
* @since 4.0.0
*/
@AutoConfiguration(after = { AvailabilityHealthContributorAutoConfiguration.class,
ApplicationAvailabilityAutoConfiguration.class })
@ConditionalOnClass(Health.class)
@ConditionalOnClass(name = "org.springframework.boot.actuate.endpoint.annotation.Endpoint")
@ConditionalOnBooleanProperty(name = "management.endpoint.health.probes.enabled", matchIfMissing = true)
public final class AvailabilityProbesAutoConfiguration {
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.autoconfigure.availability;
package org.springframework.boot.health.autoconfigure.actuate.endpoint;
import java.util.Arrays;
import java.util.HashSet;
@@ -23,10 +23,10 @@ import java.util.Set;
import org.jspecify.annotations.Nullable;
import org.springframework.boot.actuate.endpoint.SecurityContext;
import org.springframework.boot.actuate.health.AdditionalHealthEndpointPath;
import org.springframework.boot.actuate.health.HealthEndpointGroup;
import org.springframework.boot.actuate.health.HttpCodeStatusMapper;
import org.springframework.boot.actuate.health.StatusAggregator;
import org.springframework.boot.health.actuate.endpoint.AdditionalHealthEndpointPath;
import org.springframework.boot.health.actuate.endpoint.HealthEndpointGroup;
import org.springframework.boot.health.actuate.endpoint.HttpCodeStatusMapper;
import org.springframework.boot.health.actuate.endpoint.StatusAggregator;
/**
* {@link HealthEndpointGroup} used to support availability probes.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.autoconfigure.availability;
package org.springframework.boot.health.autoconfigure.actuate.endpoint;
import java.util.ArrayList;
import java.util.Collections;
@@ -30,10 +30,10 @@ import org.jspecify.annotations.Nullable;
import org.springframework.boot.actuate.endpoint.EndpointId;
import org.springframework.boot.actuate.endpoint.web.AdditionalPathsMapper;
import org.springframework.boot.actuate.endpoint.web.WebServerNamespace;
import org.springframework.boot.actuate.health.AdditionalHealthEndpointPath;
import org.springframework.boot.actuate.health.HealthEndpoint;
import org.springframework.boot.actuate.health.HealthEndpointGroup;
import org.springframework.boot.actuate.health.HealthEndpointGroups;
import org.springframework.boot.health.actuate.endpoint.AdditionalHealthEndpointPath;
import org.springframework.boot.health.actuate.endpoint.HealthEndpoint;
import org.springframework.boot.health.actuate.endpoint.HealthEndpointGroup;
import org.springframework.boot.health.actuate.endpoint.HealthEndpointGroups;
import org.springframework.util.Assert;
/**
@@ -14,10 +14,10 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.autoconfigure.availability;
package org.springframework.boot.health.autoconfigure.actuate.endpoint;
import org.springframework.boot.actuate.health.HealthEndpointGroups;
import org.springframework.boot.actuate.health.HealthEndpointGroupsPostProcessor;
import org.springframework.boot.health.actuate.endpoint.HealthEndpointGroups;
import org.springframework.boot.health.actuate.endpoint.HealthEndpointGroupsPostProcessor;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.core.env.Environment;
@@ -14,13 +14,13 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.autoconfigure.availability;
package org.springframework.boot.health.autoconfigure.actuate.endpoint;
import org.springframework.boot.actuate.endpoint.SecurityContext;
import org.springframework.boot.actuate.health.AdditionalHealthEndpointPath;
import org.springframework.boot.actuate.health.HealthEndpointGroup;
import org.springframework.boot.actuate.health.HttpCodeStatusMapper;
import org.springframework.boot.actuate.health.StatusAggregator;
import org.springframework.boot.health.actuate.endpoint.AdditionalHealthEndpointPath;
import org.springframework.boot.health.actuate.endpoint.HealthEndpointGroup;
import org.springframework.boot.health.actuate.endpoint.HttpCodeStatusMapper;
import org.springframework.boot.health.actuate.endpoint.StatusAggregator;
import org.springframework.util.Assert;
/**
@@ -14,14 +14,14 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.autoconfigure.health;
package org.springframework.boot.health.autoconfigure.actuate.endpoint;
import java.util.Collections;
import java.util.Set;
import org.jspecify.annotations.Nullable;
import org.springframework.boot.actuate.health.HealthEndpointGroups;
import org.springframework.boot.health.actuate.endpoint.HealthEndpointGroups;
import org.springframework.boot.health.registry.HealthContributorNameValidator;
import org.springframework.util.Assert;
@@ -14,16 +14,16 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.autoconfigure.health;
package org.springframework.boot.health.autoconfigure.actuate.endpoint;
import org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnAvailableEndpoint;
import org.springframework.boot.actuate.health.HealthEndpoint;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.health.contributor.Health;
import org.springframework.boot.health.actuate.endpoint.HealthEndpoint;
import org.springframework.boot.health.autoconfigure.registry.HealthContributorRegistryAutoConfiguration;
import org.springframework.context.annotation.Import;
/**
@@ -33,11 +33,10 @@ import org.springframework.context.annotation.Import;
* @author Stephane Nicoll
* @author Phillip Webb
* @author Scott Frederick
* @since 2.0.0
* @since 4.0.0
*/
@AutoConfiguration(
afterName = "org.springframework.boot.health.autoconfigure.registry.HealthContributorRegistryAutoConfiguration")
@ConditionalOnClass(Health.class)
@AutoConfiguration(after = HealthContributorRegistryAutoConfiguration.class)
@ConditionalOnClass(name = "org.springframework.boot.actuate.endpoint.annotation.Endpoint")
@ConditionalOnBean(type = "org.springframework.boot.health.registry.HealthContributorRegistry")
@ConditionalOnAvailableEndpoint(HealthEndpoint.class)
@EnableConfigurationProperties(HealthEndpointProperties.class)
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.autoconfigure.health;
package org.springframework.boot.health.autoconfigure.actuate.endpoint;
import java.util.Set;
@@ -24,15 +24,15 @@ import org.springframework.beans.BeansException;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.beans.factory.SmartInitializingSingleton;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.boot.actuate.health.HealthEndpoint;
import org.springframework.boot.actuate.health.HealthEndpointGroups;
import org.springframework.boot.actuate.health.HealthEndpointGroupsPostProcessor;
import org.springframework.boot.actuate.health.HttpCodeStatusMapper;
import org.springframework.boot.actuate.health.SimpleHttpCodeStatusMapper;
import org.springframework.boot.actuate.health.SimpleStatusAggregator;
import org.springframework.boot.actuate.health.StatusAggregator;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.health.actuate.endpoint.HealthEndpoint;
import org.springframework.boot.health.actuate.endpoint.HealthEndpointGroups;
import org.springframework.boot.health.actuate.endpoint.HealthEndpointGroupsPostProcessor;
import org.springframework.boot.health.actuate.endpoint.HttpCodeStatusMapper;
import org.springframework.boot.health.actuate.endpoint.SimpleHttpCodeStatusMapper;
import org.springframework.boot.health.actuate.endpoint.SimpleStatusAggregator;
import org.springframework.boot.health.actuate.endpoint.StatusAggregator;
import org.springframework.boot.health.contributor.HealthContributors;
import org.springframework.boot.health.registry.HealthContributorRegistry;
import org.springframework.boot.health.registry.ReactiveHealthContributorRegistry;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.autoconfigure.health;
package org.springframework.boot.health.autoconfigure.actuate.endpoint;
import java.time.Duration;
import java.util.LinkedHashMap;
@@ -24,15 +24,15 @@ import java.util.Set;
import org.jspecify.annotations.Nullable;
import org.springframework.boot.actuate.endpoint.Show;
import org.springframework.boot.actuate.health.HealthEndpoint;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.health.actuate.endpoint.HealthEndpoint;
/**
* Configuration properties for {@link HealthEndpoint}.
*
* @author Phillip Webb
* @author Leo Li
* @since 2.0.0
* @since 4.0.0
*/
@ConfigurationProperties("management.endpoint.health")
public class HealthEndpointProperties extends HealthProperties {
@@ -14,18 +14,18 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.autoconfigure.health;
package org.springframework.boot.health.autoconfigure.actuate.endpoint;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnAvailableEndpoint;
import org.springframework.boot.actuate.autoconfigure.endpoint.expose.EndpointExposure;
import org.springframework.boot.actuate.health.HealthEndpoint;
import org.springframework.boot.actuate.health.HealthEndpointGroups;
import org.springframework.boot.actuate.health.ReactiveHealthEndpointWebExtension;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
import org.springframework.boot.health.actuate.endpoint.HealthEndpoint;
import org.springframework.boot.health.actuate.endpoint.HealthEndpointGroups;
import org.springframework.boot.health.actuate.endpoint.ReactiveHealthEndpointWebExtension;
import org.springframework.boot.health.registry.HealthContributorRegistry;
import org.springframework.boot.health.registry.ReactiveHealthContributorRegistry;
import org.springframework.context.annotation.Bean;
@@ -14,18 +14,18 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.autoconfigure.health;
package org.springframework.boot.health.autoconfigure.actuate.endpoint;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnAvailableEndpoint;
import org.springframework.boot.actuate.autoconfigure.endpoint.expose.EndpointExposure;
import org.springframework.boot.actuate.health.HealthEndpoint;
import org.springframework.boot.actuate.health.HealthEndpointGroups;
import org.springframework.boot.actuate.health.HealthEndpointWebExtension;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
import org.springframework.boot.health.actuate.endpoint.HealthEndpoint;
import org.springframework.boot.health.actuate.endpoint.HealthEndpointGroups;
import org.springframework.boot.health.actuate.endpoint.HealthEndpointWebExtension;
import org.springframework.boot.health.registry.HealthContributorRegistry;
import org.springframework.boot.health.registry.ReactiveHealthContributorRegistry;
import org.springframework.context.annotation.Bean;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.autoconfigure.health;
package org.springframework.boot.health.autoconfigure.actuate.endpoint;
import java.util.ArrayList;
import java.util.HashMap;
@@ -34,7 +34,7 @@ import org.springframework.util.CollectionUtils;
*
* @author Stephane Nicoll
* @author Phillip Webb
* @since 2.2.0
* @since 4.0.0
*/
public abstract class HealthProperties {
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.autoconfigure.health;
package org.springframework.boot.health.autoconfigure.actuate.endpoint;
import java.util.Collections;
import java.util.LinkedHashSet;
@@ -14,11 +14,11 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.autoconfigure.health;
package org.springframework.boot.health.autoconfigure.actuate.endpoint;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointConfiguration.HealthEndpointGroupMembershipValidator.NoSuchHealthContributorException;
import org.springframework.boot.diagnostics.AbstractFailureAnalyzer;
import org.springframework.boot.diagnostics.FailureAnalysis;
import org.springframework.boot.health.autoconfigure.actuate.endpoint.HealthEndpointConfiguration.HealthEndpointGroupMembershipValidator.NoSuchHealthContributorException;
/**
* An {@link AbstractFailureAnalyzer} that performs analysis of failures caused by a
@@ -15,9 +15,9 @@
*/
/**
* Auto-configuration for actuator health concerns.
* Auto-configuration for health actuator endpoints.
*/
@NullMarked
package org.springframework.boot.actuate.autoconfigure.health;
package org.springframework.boot.health.autoconfigure.actuate.endpoint;
import org.jspecify.annotations.NullMarked;
@@ -14,11 +14,8 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.autoconfigure.availability;
package org.springframework.boot.health.autoconfigure.application;
import org.springframework.boot.actuate.availability.AvailabilityStateHealthIndicator;
import org.springframework.boot.actuate.availability.LivenessStateHealthIndicator;
import org.springframework.boot.actuate.availability.ReadinessStateHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.availability.ApplicationAvailabilityAutoConfiguration;
@@ -26,6 +23,9 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProp
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.availability.ApplicationAvailability;
import org.springframework.boot.health.application.AvailabilityStateHealthIndicator;
import org.springframework.boot.health.application.LivenessStateHealthIndicator;
import org.springframework.boot.health.application.ReadinessStateHealthIndicator;
import org.springframework.boot.health.contributor.Health;
import org.springframework.context.annotation.Bean;
@@ -34,7 +34,7 @@ import org.springframework.context.annotation.Bean;
* {@link AvailabilityStateHealthIndicator}.
*
* @author Brian Clozel
* @since 2.3.2
* @since 4.0.0
*/
@AutoConfiguration(after = ApplicationAvailabilityAutoConfiguration.class)
@ConditionalOnClass(Health.class)
@@ -14,15 +14,16 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.autoconfigure.system;
package org.springframework.boot.health.autoconfigure.application;
import org.springframework.boot.actuate.system.DiskSpaceHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.health.application.DiskSpaceHealthIndicator;
import org.springframework.boot.health.autoconfigure.contributor.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.health.autoconfigure.contributor.HealthContributorAutoConfiguration;
import org.springframework.boot.health.contributor.Health;
import org.springframework.context.annotation.Bean;
@@ -32,10 +33,9 @@ import org.springframework.context.annotation.Bean;
*
* @author Mattias Severson
* @author Andy Wilkinson
* @since 2.0.0
* @since 4.0.0
*/
@AutoConfiguration(
beforeName = "org.springframework.boot.health.autoconfigure.contributor.HealthContributorAutoConfiguration")
@AutoConfiguration(before = HealthContributorAutoConfiguration.class)
@ConditionalOnClass(Health.class)
@ConditionalOnEnabledHealthIndicator("diskspace")
@EnableConfigurationProperties(DiskSpaceHealthIndicatorProperties.class)
@@ -14,12 +14,12 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.autoconfigure.system;
package org.springframework.boot.health.autoconfigure.application;
import java.io.File;
import org.springframework.boot.actuate.system.DiskSpaceHealthIndicator;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.health.application.DiskSpaceHealthIndicator;
import org.springframework.util.Assert;
import org.springframework.util.unit.DataSize;
@@ -28,7 +28,7 @@ import org.springframework.util.unit.DataSize;
*
* @author Andy Wilkinson
* @author Stephane Nicoll
* @since 1.2.0
* @since 4.0.0
*/
@ConfigurationProperties("management.health.diskspace")
public class DiskSpaceHealthIndicatorProperties {
@@ -14,15 +14,16 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.autoconfigure.ssl;
package org.springframework.boot.health.autoconfigure.application;
import org.springframework.boot.actuate.ssl.SslHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.health.application.SslHealthIndicator;
import org.springframework.boot.health.autoconfigure.contributor.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.health.autoconfigure.contributor.HealthContributorAutoConfiguration;
import org.springframework.boot.health.contributor.Health;
import org.springframework.boot.info.SslInfo;
import org.springframework.boot.ssl.SslBundles;
@@ -32,10 +33,9 @@ import org.springframework.context.annotation.Bean;
* {@link EnableAutoConfiguration Auto-configuration} for {@link SslHealthIndicator}.
*
* @author Jonatan Ivanov
* @since 3.4.0
* @since 4.0.0
*/
@AutoConfiguration(
beforeName = "org.springframework.boot.health.autoconfigure.contributor.HealthContributorAutoConfiguration")
@AutoConfiguration(before = HealthContributorAutoConfiguration.class)
@ConditionalOnClass(Health.class)
@ConditionalOnEnabledHealthIndicator("ssl")
@EnableConfigurationProperties(SslHealthIndicatorProperties.class)
@@ -14,18 +14,18 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.autoconfigure.ssl;
package org.springframework.boot.health.autoconfigure.application;
import java.time.Duration;
import org.springframework.boot.actuate.ssl.SslHealthIndicator;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.health.application.SslHealthIndicator;
/**
* External configuration properties for {@link SslHealthIndicator}.
*
* @author Jonatan Ivanov
* @since 3.4.0
* @since 4.0.0
*/
@ConfigurationProperties("management.health.ssl")
public class SslHealthIndicatorProperties {
@@ -14,10 +14,7 @@
* limitations under the License.
*/
/**
* Actuator health indicator and endpoints.
*/
@NullMarked
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.autoconfigure.application;
import org.jspecify.annotations.NullMarked;
@@ -41,7 +41,6 @@ abstract class AbstractCompositeHealthContributorConfiguration<C, I extends C, B
* Creates a {@code AbstractCompositeHealthContributorConfiguration} that will use the
* given {@code indicatorFactory} to create health indicator instances.
* @param indicatorFactory the function to create health indicators
* @since 3.0.0
*/
protected AbstractCompositeHealthContributorConfiguration(Function<B, I> indicatorFactory) {
this.indicatorFactory = indicatorFactory;
@@ -53,7 +52,6 @@ abstract class AbstractCompositeHealthContributorConfiguration<C, I extends C, B
* @param beanFactory the bean factory from which the beans are retrieved
* @param beanType the type of the beans that are retrieved
* @return the contributor
* @since 3.4.3
*/
protected final C createContributor(ConfigurableListableBeanFactory beanFactory, Class<B> beanType) {
return createContributor(SimpleAutowireCandidateResolver.resolveAutowireCandidates(beanFactory, beanType));
@@ -34,6 +34,7 @@ import org.springframework.boot.health.registry.HealthContributorNameValidator;
import org.springframework.boot.health.registry.HealthContributorRegistry;
import org.springframework.boot.health.registry.ReactiveHealthContributorRegistry;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* {@link EnableAutoConfiguration Auto-configuration} for
@@ -58,6 +59,7 @@ public final class HealthContributorRegistryAutoConfiguration {
return new DefaultHealthContributorRegistry(nameValidators, nameGenerator.registrar(contributorBeans));
}
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(Flux.class)
static class ReactiveHealthContributorRegistryConfiguration {
@@ -0,0 +1,110 @@
{
"groups": [],
"properties": [
{
"name": "management.endpoint.health.probes.add-additional-paths",
"type": "java.lang.Boolean",
"description": "Whether to make the liveness and readiness health groups available on the main server port.",
"defaultValue": false
},
{
"name": "management.endpoint.health.probes.enabled",
"type": "java.lang.Boolean",
"description": "Whether to enable liveness and readiness probes.",
"defaultValue": true
},
{
"name": "management.endpoint.health.status.order",
"defaultValue": [
"DOWN",
"OUT_OF_SERVICE",
"UP",
"UNKNOWN"
]
},
{
"name": "management.endpoint.health.validate-group-membership",
"type": "java.lang.Boolean",
"description": "Whether to validate health group membership on startup. Validation fails if a group includes or excludes a health contributor that does not exist.",
"defaultValue": true
},
{
"name": "management.health.defaults.enabled",
"type": "java.lang.Boolean",
"description": "Whether to enable default health indicators.",
"defaultValue": true
},
{
"name": "management.health.diskspace.enabled",
"type": "java.lang.Boolean",
"description": "Whether to enable disk space health check.",
"defaultValue": true
},
{
"name": "management.health.influxdb.enabled",
"type": "java.lang.Boolean",
"deprecation": {
"level": "error",
"reason": "InfluxDB support has been removed."
}
},
{
"name": "management.health.livenessstate.enabled",
"type": "java.lang.Boolean",
"description": "Whether to enable liveness state health check.",
"defaultValue": false
},
{
"name": "management.health.ping.enabled",
"type": "java.lang.Boolean",
"description": "Whether to enable ping health check.",
"defaultValue": true
},
{
"name": "management.health.probes.enabled",
"type": "java.lang.Boolean",
"description": "Whether to enable liveness and readiness probes.",
"defaultValue": false,
"deprecation": {
"level": "error",
"replacement": "management.endpoint.health.probes.enabled"
}
},
{
"name": "management.health.readinessstate.enabled",
"type": "java.lang.Boolean",
"description": "Whether to enable readiness state health check.",
"defaultValue": false
},
{
"name": "management.health.ssl.enabled",
"type": "java.lang.Boolean",
"description": "Whether to enable SSL certificate health check.",
"defaultValue": true
}
],
"hints": [
{
"name": "management.health.status.order",
"values": [
{
"value": "UNKNOWN"
},
{
"value": "UP"
},
{
"value": "DOWN"
},
{
"value": "OUT_OF_SERVICE"
}
],
"providers": [
{
"name": "any"
}
]
}
]
}
@@ -0,0 +1,3 @@
# Failure Analyzers
org.springframework.boot.diagnostics.FailureAnalyzer=\
org.springframework.boot.health.autoconfigure.actuate.endpoint.NoSuchHealthContributorFailureAnalyzer
@@ -1,2 +1,7 @@
org.springframework.boot.health.autoconfigure.actuate.endpoint.AvailabilityProbesAutoConfiguration
org.springframework.boot.health.autoconfigure.actuate.endpoint.HealthEndpointAutoConfiguration
org.springframework.boot.health.autoconfigure.application.AvailabilityHealthContributorAutoConfiguration
org.springframework.boot.health.autoconfigure.application.DiskSpaceHealthContributorAutoConfiguration
org.springframework.boot.health.autoconfigure.application.SslHealthContributorAutoConfiguration
org.springframework.boot.health.autoconfigure.contributor.HealthContributorAutoConfiguration
org.springframework.boot.health.autoconfigure.registry.HealthContributorRegistryAutoConfiguration
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import org.junit.jupiter.api.Test;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import java.util.Collections;
import java.util.LinkedHashMap;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import java.util.Collections;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import java.time.Duration;
import java.util.Collections;
@@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.endpoint.ApiVersion;
import org.springframework.boot.actuate.endpoint.SecurityContext;
import org.springframework.boot.actuate.endpoint.web.WebServerNamespace;
import org.springframework.boot.actuate.health.HealthEndpointSupport.Result;
import org.springframework.boot.health.actuate.endpoint.HealthEndpointSupport.Result;
import org.springframework.boot.health.contributor.Health;
import org.springframework.boot.health.contributor.Status;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import java.time.Duration;
import java.util.Collections;
@@ -26,7 +26,7 @@ import org.jspecify.annotations.Nullable;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.actuate.health.HealthEndpointSupport.Result;
import org.springframework.boot.health.actuate.endpoint.HealthEndpointSupport.Result;
import org.springframework.boot.health.contributor.CompositeHealthContributor;
import org.springframework.boot.health.contributor.Health;
import org.springframework.boot.health.contributor.HealthContributor;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import java.util.Set;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import java.time.Duration;
import java.util.Collections;
@@ -29,7 +29,7 @@ import org.springframework.boot.actuate.endpoint.ApiVersion;
import org.springframework.boot.actuate.endpoint.SecurityContext;
import org.springframework.boot.actuate.endpoint.web.WebEndpointResponse;
import org.springframework.boot.actuate.endpoint.web.WebServerNamespace;
import org.springframework.boot.actuate.health.HealthEndpointSupport.Result;
import org.springframework.boot.health.actuate.endpoint.HealthEndpointSupport.Result;
import org.springframework.boot.health.contributor.CompositeHealthContributor;
import org.springframework.boot.health.contributor.Health;
import org.springframework.boot.health.contributor.HealthContributor;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import org.junit.jupiter.api.Test;
import tools.jackson.databind.MapperFeature;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import java.time.Duration;
import java.util.Collections;
@@ -29,7 +29,7 @@ import reactor.core.publisher.Mono;
import org.springframework.boot.actuate.endpoint.ApiVersion;
import org.springframework.boot.actuate.endpoint.SecurityContext;
import org.springframework.boot.actuate.endpoint.web.WebEndpointResponse;
import org.springframework.boot.actuate.health.HealthEndpointSupport.Result;
import org.springframework.boot.health.actuate.endpoint.HealthEndpointSupport.Result;
import org.springframework.boot.health.contributor.CompositeReactiveHealthContributor;
import org.springframework.boot.health.contributor.Health;
import org.springframework.boot.health.contributor.ReactiveHealthContributor;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import java.time.Duration;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import java.util.LinkedHashMap;
import java.util.Map;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import org.junit.jupiter.api.Test;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import java.util.Arrays;
import java.util.LinkedHashMap;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
package org.springframework.boot.health.actuate.endpoint;
import java.util.function.Predicate;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.availability;
package org.springframework.boot.health.application;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

Some files were not shown because too many files have changed in this diff Show More