java.lang.Object
io.helidon.servicecommon.rest.HelidonRestServiceSupport.Builder<HealthSupport.Builder,HealthSupport>
io.helidon.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
Modifier and TypeFieldDescriptionstatic final String
Config key within the confighealth
section controlling whether health is enabled.static final String
Config key within the confighealth
section indicating health check implementation classes to exclude.static final String
Config key within the confighealth
section indicating health checks to exclude.static final String
Config key for thehealth
section.static final String
Config key within the confighealth
section indicating health checks to include.static final String
Config key within the confighealth
section controlling the timeout for calculating the health report when clients access the health endpoint. -
Method Summary
Modifier and TypeMethodDescriptionaddExcluded
(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.includeAll
is set tofalse
.addIncluded
(Collection<String> names) Add health checks to a white list (in caseHealthSupport.includeAll
is set tofalse
.addLiveness
(Collection<HealthCheck> healthChecks) Add liveness health check(s).addLiveness
(HealthCheck... healthChecks) Add liveness health check(s).addReadiness
(Collection<HealthCheck> healthChecks) Add readiness health check(s).addReadiness
(HealthCheck... healthChecks) Add readiness health check(s).addStartup
(Collection<HealthCheck> healthChecks) Add start-up health check(s).addStartup
(HealthCheck... healthChecks) Add start-up health check(s).build()
Build the instance from this builder.Update this builder from configuration.enabled
(boolean enabled) HealthSupport can be disabled by invoking this method.Configure overall timeout of health check call.Methods inherited from class io.helidon.servicecommon.rest.HelidonRestServiceSupport.Builder
config, crossOriginConfig, crossOriginConfig, restServiceSettings, webContext, webContextConfig
-
Field Details
-
HEALTH_CONFIG_KEY
Config key for thehealth
section.- See Also:
-
ENABLED_CONFIG_KEY
Config key within the confighealth
section controlling whether health is enabled.- See Also:
-
INCLUDE_CONFIG_KEY
Config key within the confighealth
section indicating health checks to include.- See Also:
-
EXCLUDE_CONFIG_KEY
Config key within the confighealth
section indicating health checks to exclude.- See Also:
-
EXCLUDE_CLASSES_CONFIG_KEY
Config key within the confighealth
section indicating health check implementation classes to exclude.- See Also:
-
TIMEOUT_CONFIG_KEY
Config key within the confighealth
section controlling the timeout for calculating the health report when clients access the health endpoint.- See Also:
-
-
Method Details
-
build
Description copied from interface:Builder
Build the instance from this builder.- Returns:
- instance of the built type
-
addIncluded
Add a health check to a white list (in caseHealthSupport.includeAll
is 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.includeAll
is 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:
config
in classHelidonRestServiceSupport.Builder<HealthSupport.Builder,
HealthSupport> - Parameters:
config
- node located on this component's configuration- Returns:
- updated builder instance
-
timeout
Configure overall timeout of health check call.- Parameters:
timeout
- timeout valueunit
- timeout time unit- 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
Add liveness health check(s).- Parameters:
healthChecks
- health check(s) to add- Returns:
- updated builder instance
-
addLiveness
Add liveness health check(s).- Parameters:
healthChecks
- health checks to add- Returns:
- updated builder instance
-
addReadiness
Add readiness health check(s).- Parameters:
healthChecks
- health checks to add- Returns:
- updated builder instance
-
addReadiness
Add readiness health check(s).- Parameters:
healthChecks
- health checks to add- Returns:
- updated builder instance
-
addStartup
Add start-up health check(s).- Parameters:
healthChecks
- health checks to add- Returns:
- updated builder instance
-
addStartup
Add start-up 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
-