- All Implemented Interfaces:
HealthCheck
By default, this health check has a threshold of 100%, meaning that it will never fail the threshold check.
Also, by default, it will check the root path /
. These defaults can be modified using the
"health.checks.diskSpace.path" property (default "."), and the
"health.checks.diskSpace.thresholdPercent"
property (default 99.999, virtually 100). The threshold should be set to a percent, such as 50 for 50% or
99 for 99%. If disk usage
exceeds this threshold, then the health check will fail.
Unless ephemeral disk space is being used, it is often not sufficient to simply restart a server in the event that that health check fails.
This health check is automatically created and registered through CDI.
This health check can be referred to in properties as diskSpace
. So for example, to exclude this
health check from being exposed, use health.exclude: diskSpace
.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Deprecated.The value will change to "health.checks.diskSpace.path" in a future releasestatic final String
Deprecated.The value will change to "health.checks.diskSpace.thresholdPercent" in future releasestatic final String
Default path on the file system the health check will be executed for.static final double
Default threshold percent, when this check starts reportingHealthCheckResponse.Status.DOWN
. -
Method Summary
Modifier and TypeMethodDescriptionstatic DiskSpaceHealthCheck.Builder
builder()
A new fluent API builder to configure this health check.call()
static DiskSpaceHealthCheck
create()
Create a new disk space health check to use, using defaults for all configurable values.
-
Field Details
-
DEFAULT_PATH
Default path on the file system the health check will be executed for. If you need to check a different path (e.g. application runtime disks are not mounted the same directory as application path), useDiskSpaceHealthCheck.Builder.path(java.nio.file.Path)
. When running within a MicroProfile server, you can configure path using a configuration key "health.checks.diskSpace.path" Defaults to "."- See Also:
-
DEFAULT_THRESHOLD
public static final double DEFAULT_THRESHOLDDefault threshold percent, when this check starts reportingHealthCheckResponse.Status.DOWN
.- See Also:
-
CONFIG_KEY_PATH
Deprecated.The value will change to "health.checks.diskSpace.path" in a future releaseFull configuration key for path, when configured through MicroProfile config.- See Also:
-
CONFIG_KEY_THRESHOLD_PERCENT
Deprecated.The value will change to "health.checks.diskSpace.thresholdPercent" in future releaseFull configuration key for threshold percent, when configured through Microprofile config.- See Also:
-
-
Method Details
-
builder
A new fluent API builder to configure this health check.- Returns:
- builder
-
create
Create a new disk space health check to use, using defaults for all configurable values.- Returns:
- a new health check to register with
HealthSupport.Builder.addLiveness(org.eclipse.microprofile.health.HealthCheck...)
- See Also:
-
call
- Specified by:
call
in interfaceHealthCheck
-