Package io.helidon.nima.observe.health
Class HealthFeature.Builder
java.lang.Object
io.helidon.nima.servicecommon.HelidonFeatureSupport.Builder<HealthFeature.Builder,HealthFeature>
io.helidon.nima.observe.health.HealthFeature.Builder
- All Implemented Interfaces:
Builder<HealthFeature.Builder,,HealthFeature> Supplier<HealthFeature>
- Enclosing class:
HealthFeature
public static class HealthFeature.Builder
extends HelidonFeatureSupport.Builder<HealthFeature.Builder,HealthFeature>
Fluent API builder for
HealthFeature.-
Method Summary
Modifier and TypeMethodDescriptionaddCheck(HealthCheck healthCheck) Add an explicit Health check instance (not discovered throughHealthCheckProvideror whenuseSystemServices(boolean)is set tofalse.addCheck(HealthCheck healthCheck, HealthCheckType type) Add the provided health check using an explicit type (may differ from theHealthCheck.type().build()Build the instance from this builder.Update this instance from configuration.details(boolean details) Whether details should be printed.enabled(boolean enabled) Whether "observe health" should be enabled.useSystemServices(boolean useServices) Whether to use services discovered byServiceLoader.Methods inherited from class io.helidon.nima.servicecommon.HelidonFeatureSupport.Builder
config, crossOriginConfig, restServiceSettings, webContext, webContextConfig
-
Method Details
-
build
Description copied from interface:BuilderBuild the instance from this builder.- Returns:
- instance of the built type
-
enabled
Whether "observe health" should be enabled.- Parameters:
enabled- set tofalseto disable health observer- Returns:
- updated builder
-
details
Whether details should be printed. By default, health only 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
-
config
Update this instance from configuration.- Overrides:
configin classHelidonFeatureSupport.Builder<HealthFeature.Builder,HealthFeature> - Parameters:
config- config located at the node of health support (seeHealthObserveProvider.configKey()).- Returns:
- updated builder
-
addCheck
Add an explicit Health check instance (not discovered throughHealthCheckProvideror whenuseSystemServices(boolean)is set tofalse.- Parameters:
healthCheck- health check to add- Returns:
- updated builder
-
addCheck
Add the provided health check using an explicit type (may differ from theHealthCheck.type().- Parameters:
healthCheck- health check to addtype- type to use- Returns:
- updated builder
-
useSystemServices
Whether to use services discovered byServiceLoader.- Parameters:
useServices- set tofalseto disable discovery- Returns:
- updated builder
-