Skip to content

Commit 34e0382

Browse files
committed
Move actuator heath code to spring-boot-health
Closes gh-46357
1 parent 5d21b82 commit 34e0382

File tree

140 files changed

+455
-527
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+455
-527
lines changed

documentation/spring-boot-actuator-docs/src/test/java/org/springframework/boot/actuate/docs/health/HealthEndpointDocumentationTests.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@
2828

2929
import org.springframework.boot.actuate.docs.MockMvcEndpointDocumentationTests;
3030
import org.springframework.boot.actuate.endpoint.SecurityContext;
31-
import org.springframework.boot.actuate.health.AdditionalHealthEndpointPath;
32-
import org.springframework.boot.actuate.health.HealthEndpoint;
33-
import org.springframework.boot.actuate.health.HealthEndpointGroup;
34-
import org.springframework.boot.actuate.health.HealthEndpointGroups;
35-
import org.springframework.boot.actuate.health.HttpCodeStatusMapper;
36-
import org.springframework.boot.actuate.health.SimpleHttpCodeStatusMapper;
37-
import org.springframework.boot.actuate.health.SimpleStatusAggregator;
38-
import org.springframework.boot.actuate.health.StatusAggregator;
39-
import org.springframework.boot.actuate.system.DiskSpaceHealthIndicator;
4031
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
32+
import org.springframework.boot.health.actuate.endpoint.AdditionalHealthEndpointPath;
33+
import org.springframework.boot.health.actuate.endpoint.HealthEndpoint;
34+
import org.springframework.boot.health.actuate.endpoint.HealthEndpointGroup;
35+
import org.springframework.boot.health.actuate.endpoint.HealthEndpointGroups;
36+
import org.springframework.boot.health.actuate.endpoint.HttpCodeStatusMapper;
37+
import org.springframework.boot.health.actuate.endpoint.SimpleHttpCodeStatusMapper;
38+
import org.springframework.boot.health.actuate.endpoint.SimpleStatusAggregator;
39+
import org.springframework.boot.health.actuate.endpoint.StatusAggregator;
40+
import org.springframework.boot.health.application.DiskSpaceHealthIndicator;
4141
import org.springframework.boot.health.autoconfigure.registry.HealthContributorNameGenerator;
4242
import org.springframework.boot.health.contributor.CompositeHealthContributor;
4343
import org.springframework.boot.health.contributor.Health;

documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/actuator/endpoints.adoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ with the `key` listed in the following table:
618618
| Checks that a connection to javadoc:javax.sql.DataSource[] can be obtained.
619619

620620
| `diskspace`
621-
| javadoc:org.springframework.boot.actuate.system.DiskSpaceHealthIndicator[]
621+
| javadoc:org.springframework.boot.health.info.DiskSpaceHealthIndicator[]
622622
| Checks for low disk space.
623623

624624
| `elasticsearch`
@@ -662,7 +662,7 @@ with the `key` listed in the following table:
662662
| Checks that a Redis server is up.
663663

664664
| `ssl`
665-
| javadoc:org.springframework.boot.actuate.ssl.SslHealthIndicator[]
665+
| javadoc:org.springframework.boot.health.info.SslHealthIndicator[]
666666
| Checks that SSL certificates are ok.
667667
|===
668668

@@ -679,11 +679,11 @@ Additional javadoc:org.springframework.boot.actuate.health.HealthIndicator[] bea
679679
| Key | Name | Description
680680

681681
| `livenessstate`
682-
| javadoc:org.springframework.boot.actuate.availability.LivenessStateHealthIndicator[]
682+
| javadoc:org.springframework.boot.health.application.LivenessStateHealthIndicator[]
683683
| Exposes the "`Liveness`" application availability state.
684684

685685
| `readinessstate`
686-
| javadoc:org.springframework.boot.actuate.availability.ReadinessStateHealthIndicator[]
686+
| javadoc:org.springframework.boot.health.application.ReadinessStateHealthIndicator[]
687687
| Exposes the "`Readiness`" application availability state.
688688
|===
689689

@@ -928,7 +928,7 @@ Applications deployed on Kubernetes can provide information about their internal
928928
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.
929929

930930
By default, Spring Boot manages your xref:features/spring-application.adoc#features.spring-application.application-availability[Application Availability] state.
931-
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[].
931+
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[].
932932
These indicators are shown on the global health endpoint (`"/actuator/health"`).
933933
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"`.
934934

@@ -1255,7 +1255,7 @@ The `info` endpoint publishes information about your process, see javadoc:org.sp
12551255
[[actuator.endpoints.info.ssl-information]]
12561256
=== SSL Information
12571257

1258-
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.
1258+
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.
12591259

12601260

12611261

documentation/spring-boot-docs/src/main/java/org/springframework/boot/docs/howto/actuator/maphealthindicatorstometrics/MyHealthMetricsExportConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import io.micrometer.core.instrument.Gauge;
2020
import io.micrometer.core.instrument.MeterRegistry;
2121

22-
import org.springframework.boot.actuate.health.HealthEndpoint;
22+
import org.springframework.boot.health.actuate.endpoint.HealthEndpoint;
2323
import org.springframework.boot.health.contributor.Status;
2424
import org.springframework.context.annotation.Configuration;
2525

documentation/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/howto/actuator/maphealthindicatorstometrics/MyHealthMetricsExportConfiguration.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ package org.springframework.boot.docs.howto.actuator.maphealthindicatorstometric
1818

1919
import io.micrometer.core.instrument.Gauge
2020
import io.micrometer.core.instrument.MeterRegistry
21-
import org.springframework.boot.actuate.health.HealthEndpoint
21+
import org.springframework.boot.health.actuate.endpoint.HealthEndpoint
2222
import org.springframework.boot.health.contributor.Status
2323
import org.springframework.context.annotation.Configuration
2424

documentation/spring-boot-docs/src/test/java/org/springframework/boot/docs/howto/actuator/maphealthindicatorstometrics/MetricsHealthMicrometerExportTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
import org.junit.jupiter.api.Test;
2323

2424
import org.springframework.beans.factory.annotation.Autowired;
25-
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
2625
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
26+
import org.springframework.boot.health.autoconfigure.actuate.endpoint.HealthEndpointAutoConfiguration;
2727
import org.springframework.boot.health.autoconfigure.contributor.HealthContributorAutoConfiguration;
2828
import org.springframework.boot.health.autoconfigure.registry.HealthContributorRegistryAutoConfiguration;
2929
import org.springframework.boot.health.contributor.Health;

integration-test/spring-boot-actuator-integration-tests/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ description = "Spring Boot Actuator Integration Tests"
2424

2525
dependencies {
2626
testImplementation(project(":module:spring-boot-actuator"))
27+
testImplementation(project(":module:spring-boot-actuator-autoconfigure"))
2728
testImplementation(project(":core:spring-boot-autoconfigure"))
2829
testImplementation(project(":module:spring-boot-health"))
2930
testImplementation(project(":module:spring-boot-http-converter"))
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
import org.springframework.boot.actuate.autoconfigure.beans.BeansEndpointAutoConfiguration;
3232
import org.springframework.boot.actuate.autoconfigure.context.ShutdownEndpointAutoConfiguration;
3333
import org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration;
34-
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
3534
import org.springframework.boot.actuate.web.exchanges.InMemoryHttpExchangeRepository;
3635
import org.springframework.boot.autoconfigure.AutoConfigurations;
3736
import org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration;
37+
import org.springframework.boot.health.autoconfigure.actuate.endpoint.HealthEndpointAutoConfiguration;
3838
import org.springframework.boot.health.autoconfigure.contributor.HealthContributorAutoConfiguration;
3939
import org.springframework.boot.health.autoconfigure.registry.HealthContributorRegistryAutoConfiguration;
4040
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
import org.junit.jupiter.api.Test;
2020

2121
import org.springframework.boot.SpringBootConfiguration;
22-
import org.springframework.boot.actuate.health.HealthEndpointWebExtension;
23-
import org.springframework.boot.actuate.health.ReactiveHealthEndpointWebExtension;
2422
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
2523
import org.springframework.boot.context.annotation.UserConfigurations;
24+
import org.springframework.boot.health.actuate.endpoint.HealthEndpointWebExtension;
25+
import org.springframework.boot.health.actuate.endpoint.ReactiveHealthEndpointWebExtension;
2626
import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner;
2727
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
2828

integration-test/spring-boot-actuator-integration-tests/src/test/java/org/springframework/boot/actuate/health/HealthEndpointWebIntegrationTests.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
import org.springframework.boot.actuate.endpoint.web.test.WebEndpointTest;
2828
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
2929
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
30+
import org.springframework.boot.health.actuate.endpoint.HealthEndpoint;
31+
import org.springframework.boot.health.actuate.endpoint.HealthEndpointGroups;
32+
import org.springframework.boot.health.actuate.endpoint.HealthEndpointWebExtension;
33+
import org.springframework.boot.health.actuate.endpoint.ReactiveHealthEndpointWebExtension;
3034
import org.springframework.boot.health.autoconfigure.registry.HealthContributorNameGenerator;
3135
import org.springframework.boot.health.contributor.CompositeHealthContributor;
3236
import org.springframework.boot.health.contributor.CompositeReactiveHealthContributor;

0 commit comments

Comments
 (0)