java.lang.Object
io.helidon.reactive.servicecommon.HelidonRestServiceSupport.Builder<HealthSupport.Builder,HealthSupport>
io.helidon.reactive.health.HealthSupport.Builder
- All Implemented Interfaces:
Builder<HealthSupport.Builder,,HealthSupport> Supplier<HealthSupport>
- Enclosing class:
HealthSupport
public static final class HealthSupport.Builder
extends HelidonRestServiceSupport.Builder<HealthSupport.Builder,HealthSupport>
Fluent API builder for
HealthSupport.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConfig key within the confighealthsection controlling whether health is enabled.static final StringConfig key within the confighealthsection indicating health check implementation classes to exclude.static final StringConfig key within the confighealthsection indicating health checks to exclude.static final StringConfig key for thehealthsection.static final StringConfig key within the confighealthsection indicating health checks to include.static final StringConfig key within the confighealthsection controlling the timeout for calculating the health report when clients access the health endpoint. -
Method Summary
Modifier and TypeMethodDescriptionadd(HealthCheck healthCheck) Add health check(s).add(HealthCheck... healthChecks) Add health check.add(Collection<HealthCheck> healthChecks) Add health check(s).addExcluded(String healthCheckName) Add a health check to a black list.addExcluded(Collection<String> names) Add health checks to a black list.addExcludedClass(Class<?> aClass) A class may be excluded from invoking health checks on it.addIncluded(String healthCheckName) Add a health check to a white list (in caseHealthSupport.includeAllis set tofalse.addIncluded(Collection<String> names) Add health checks to a white list (in caseHealthSupport.includeAllis set tofalse.addLiveness(Collection<HealthCheck> healthChecks) Deprecated, for removal: This API element is subject to removal in a future version.addLiveness(HealthCheck... healthChecks) Deprecated, for removal: This API element is subject to removal in a future version.useadd(io.helidon.health.HealthCheck...)instead, as we will remove dependency on MP health checks in the futureaddReadiness(Collection<HealthCheck> healthChecks) Deprecated, for removal: This API element is subject to removal in a future version.useadd(java.util.Collection)instead, as we will remove dependency on MP health checks in the futureaddReadiness(HealthCheck... healthChecks) Deprecated, for removal: This API element is subject to removal in a future version.useadd(io.helidon.health.HealthCheck...)instead, as we will remove dependency on MP health checks in the futureaddStartup(Collection<HealthCheck> healthChecks) Deprecated, for removal: This API element is subject to removal in a future version.useadd(java.util.Collection)instead, as we will remove dependency on MP health checks in the futureaddStartup(HealthCheck... healthChecks) Deprecated, for removal: This API element is subject to removal in a future version.useadd(io.helidon.health.HealthCheck...)instead, as we will remove dependency on MP health checks in the futurebuild()Build the instance from this builder.Update this builder from configuration.details(boolean details) Whether details should be printed.enabled(boolean enabled) HealthSupport can be disabled by invoking this method.Deprecated.usetimeout(Duration)insteadConfigure overall timeout of health check call.Methods inherited from class io.helidon.reactive.servicecommon.HelidonRestServiceSupport.Builder
config, crossOriginConfig, restServiceSettings, webContext, webContextConfig
-
Field Details
-
HEALTH_CONFIG_KEY
Config key for thehealthsection.- See Also:
-
ENABLED_CONFIG_KEY
Config key within the confighealthsection controlling whether health is enabled.- See Also:
-
INCLUDE_CONFIG_KEY
Config key within the confighealthsection indicating health checks to include.- See Also:
-
EXCLUDE_CONFIG_KEY
Config key within the confighealthsection indicating health checks to exclude.- See Also:
-
EXCLUDE_CLASSES_CONFIG_KEY
Config key within the confighealthsection indicating health check implementation classes to exclude.- See Also:
-
TIMEOUT_CONFIG_KEY
Config key within the confighealthsection controlling the timeout for calculating the health report when clients access the health endpoint.- See Also:
-
-
Method Details
-
build
Description copied from interface:BuilderBuild the instance from this builder.- Returns:
- instance of the built type
-
addIncluded
Add a health check to a white list (in caseHealthSupport.includeAllis set tofalse.- Parameters:
healthCheckName- name of a health check to include- Returns:
- updated builder instance
-
addIncluded
Add health checks to a white list (in caseHealthSupport.includeAllis set tofalse.- Parameters:
names- names of health checks to include- Returns:
- updated builder instance
-
addExcluded
Add a health check to a black list. Health check results that match by name with a blacklisted records will not be part of the result.- Parameters:
healthCheckName- name of a health check to exclude- Returns:
- updated builder instance
-
addExcluded
Add health checks to a black list. Health check results that match by name with a blacklisted records will not be part of the result.- Parameters:
names- names of health checks to exclude- Returns:
- updated builder instance
-
config
Update this builder from configuration.- Overrides:
configin classHelidonRestServiceSupport.Builder<HealthSupport.Builder,HealthSupport> - Parameters:
config- node located on this component's configuration- Returns:
- updated builder instance
-
timeout
Deprecated.usetimeout(Duration)insteadConfigure overall timeout of health check call.- Parameters:
timeout- timeout valueunit- timeout time unit- Returns:
- updated builder instance
-
timeout
Configure overall timeout of health check call.- Parameters:
timeout- timeout value- Returns:
- updated builder instance
-
addExcludedClass
A class may be excluded from invoking health checks on it. This allows configurable approach to disabling broken health-checks.- Parameters:
aClass- class to ignore (any health check instance of this class will be ignored)- Returns:
- updated builder instance
-
addLiveness
@Deprecated(since="4.0.0", forRemoval=true) public HealthSupport.Builder addLiveness(HealthCheck... healthChecks) Deprecated, for removal: This API element is subject to removal in a future version.useadd(io.helidon.health.HealthCheck...)instead, as we will remove dependency on MP health checks in the futureAdd liveness health check(s).- Parameters:
healthChecks- health check(s) to add- Returns:
- updated builder instance
-
addLiveness
@Deprecated(since="4.0.0", forRemoval=true) public HealthSupport.Builder addLiveness(Collection<HealthCheck> healthChecks) Deprecated, for removal: This API element is subject to removal in a future version.useadd(java.util.Collection)instead, as we will remove dependency on MP health checks in the futureAdd liveness health check(s).- Parameters:
healthChecks- health checks to add- Returns:
- updated builder instance
-
addReadiness
@Deprecated(since="4.0.0", forRemoval=true) public HealthSupport.Builder addReadiness(HealthCheck... healthChecks) Deprecated, for removal: This API element is subject to removal in a future version.useadd(io.helidon.health.HealthCheck...)instead, as we will remove dependency on MP health checks in the futureAdd readiness health check(s).- Parameters:
healthChecks- health checks to add- Returns:
- updated builder instance
-
addReadiness
@Deprecated(since="4.0.0", forRemoval=true) public HealthSupport.Builder addReadiness(Collection<HealthCheck> healthChecks) Deprecated, for removal: This API element is subject to removal in a future version.useadd(java.util.Collection)instead, as we will remove dependency on MP health checks in the futureAdd readiness health check(s).- Parameters:
healthChecks- health checks to add- Returns:
- updated builder instance
-
addStartup
@Deprecated(since="4.0.0", forRemoval=true) public HealthSupport.Builder addStartup(HealthCheck... healthChecks) Deprecated, for removal: This API element is subject to removal in a future version.useadd(io.helidon.health.HealthCheck...)instead, as we will remove dependency on MP health checks in the futureAdd start-up health check(s).- Parameters:
healthChecks- health checks to add- Returns:
- updated builder instance
-
addStartup
@Deprecated(since="4.0.0", forRemoval=true) public HealthSupport.Builder addStartup(Collection<HealthCheck> healthChecks) Deprecated, for removal: This API element is subject to removal in a future version.useadd(java.util.Collection)instead, as we will remove dependency on MP health checks in the futureAdd start-up health check(s).- Parameters:
healthChecks- health checks to add- Returns:
- updated builder instance
-
add
Add health check(s).- Parameters:
healthCheck- health check to add- Returns:
- updated builder instance
-
add
Add health check.- Parameters:
healthChecks- health checks to add- Returns:
- updated builder instance
-
add
Add health check(s).- Parameters:
healthChecks- health checks to add- Returns:
- updated builder instance
-
enabled
HealthSupport can be disabled by invoking this method.- Parameters:
enabled- whether to enable the health support (defaults totrue)- Returns:
- updated builder instance
-
details
Whether details should be printed. Set totrueby default (to be backward compatible). Without details, returns aHttp.Status.NO_CONTENT_204for success,Http.Status.SERVICE_UNAVAILABLE_503for health down, andHttp.Status.INTERNAL_SERVER_ERROR_500in case of error with no entity. When details are enabled, health returnsHttp.Status.OK_200for success, same codes otherwise and a JSON entity with detailed information about each health check executed.- Parameters:
details- set totrueto enable details- Returns:
- updated builder
-
add(java.util.Collection)instead, as we will remove dependency on MP health checks in the future