- 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
"helidon.health.diskSpace.path" property (default "."), and the "helidon.health.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 helidon.health.exclude: diskSpace
.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Full configuration key for path, when configured through MicroProfile config.static final String
Full configuration key for threshold percent, when configured through Microprofile config.static 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()
Call a health check.static DiskSpaceHealthCheck
create()
Create a new disk space health check to use, using defaults for all configurable values.name()
Name of this health check, used in output when details are requested.path()
Path of this health check, to support single health-check queries.type()
Type of this health check.
-
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 "helidon.health.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
Full configuration key for path, when configured through MicroProfile config.- See Also:
-
CONFIG_KEY_THRESHOLD_PERCENT
Full 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
- See Also:
-
type
Description copied from interface:HealthCheck
Type of this health check.- Specified by:
type
in interfaceHealthCheck
- Returns:
- type, defaults to
HealthCheckType.LIVENESS
-
name
Description copied from interface:HealthCheck
Name of this health check, used in output when details are requested.- Specified by:
name
in interfaceHealthCheck
- Returns:
- name of this health check, defaults to simple class name
-
path
Description copied from interface:HealthCheck
Path of this health check, to support single health-check queries.- Specified by:
path
in interfaceHealthCheck
- Returns:
- path to use, by default returns
HealthCheck.name()
-
call
Description copied from interface:HealthCheck
Call a health check.- Specified by:
call
in interfaceHealthCheck
- Returns:
- health response
-