Class HealthObserver
java.lang.Object
io.helidon.webserver.observe.health.HealthObserver
- All Implemented Interfaces:
RuntimeType.Api<io.helidon.webserver.observe.health.HealthObserverConfig>
,NamedService
,Observer
public class HealthObserver
extends Object
implements Observer, RuntimeType.Api<io.helidon.webserver.observe.health.HealthObserverConfig>
Observer that registers health endpoint, and collects all health checks.
-
Method Summary
Modifier and TypeMethodDescriptionstatic io.helidon.webserver.observe.health.HealthObserverConfig.Builder
builder()
Create a new builder to configure Health observer.static HealthObserver
create
(HealthCheck... healthChecks) Create a health observer, adding the provided checks to the checks discovered viaServiceLoader
andHealthCheckProvider
.static HealthObserver
create
(io.helidon.webserver.observe.health.HealthObserverConfig config) Create a new Health observer using the provided configuration.static HealthObserver
Create a new Health observer customizing its configuration.io.helidon.webserver.observe.health.HealthObserverConfig
Configuration of this observer.void
register
(ServerFeature.ServerFeatureContext featureContext, List<HttpRouting.Builder> observeEndpointRouting, UnaryOperator<String> endpointFunction) Register the observer features, services, and/or filters.type()
Type of this observer, to make sure we do not configure an observer both fromServiceLoader
and using programmatic approach.
-
Method Details
-
create
Create a health observer, adding the provided checks to the checks discovered viaServiceLoader
andHealthCheckProvider
.- Parameters:
healthChecks
- health checks to add- Returns:
- a new observer to register with
ObserveFeature
-
builder
public static io.helidon.webserver.observe.health.HealthObserverConfig.Builder builder()Create a new builder to configure Health observer.- Returns:
- a new builder
-
create
public static HealthObserver create(io.helidon.webserver.observe.health.HealthObserverConfig config) Create a new Health observer using the provided configuration.- Parameters:
config
- configuration- Returns:
- a new observer
-
create
public static HealthObserver create(Consumer<io.helidon.webserver.observe.health.HealthObserverConfig.Builder> consumer) Create a new Health observer customizing its configuration.- Parameters:
consumer
- configuration consumer- Returns:
- a new observer
-
register
public void register(ServerFeature.ServerFeatureContext featureContext, List<HttpRouting.Builder> observeEndpointRouting, UnaryOperator<String> endpointFunction) Description copied from interface:Observer
Register the observer features, services, and/or filters. This is used by the observe feature. Do NOT use this method directly, kindly start withObserveFeature
and register it with the server builder.- Specified by:
register
in interfaceObserver
- Parameters:
featureContext
- access to all routing builders, for cases where this observer needs to register additional components to other socketsobserveEndpointRouting
- routing builders that expose observability endpoints, and this feature must use these to register any endpoints exposed for observabilityendpointFunction
- function to obtain the final endpoint for observers that expose observe endpoints (such as/observe/health
would be provider forhealth
by default)
-
type
Description copied from interface:Observer
Type of this observer, to make sure we do not configure an observer both fromServiceLoader
and using programmatic approach. If it is desired to have more than one observer of the same type, always use programmatic approach- Specified by:
type
in interfaceNamedService
- Specified by:
type
in interfaceObserver
- Returns:
- type of this observer, should match
ObserveProvider.type()
-
prototype
public io.helidon.webserver.observe.health.HealthObserverConfig prototype()Description copied from interface:Observer
Configuration of this observer.- Specified by:
prototype
in interfaceObserver
- Specified by:
prototype
in interfaceRuntimeType.Api<io.helidon.webserver.observe.health.HealthObserverConfig>
- Returns:
- configuration of the observer
-