Interface HealthCheckService
- All Superinterfaces:
org.hyperledger.besu.plugin.services.BesuService
public interface HealthCheckService
extends org.hyperledger.besu.plugin.services.BesuService
This service lets plugins provide custom implementations for Besu's built-in health check
endpoints. Registering a provider for
/liveness or /readiness overrides that
endpoint's default implementation.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceFunctional interface for health check providers.static final classResult of a health check evaluation, including optional diagnostic details.static interfaceFunctional interface for accessing query parameters. -
Method Summary
Modifier and TypeMethodDescriptiongetHealthCheck(String endpoint) Gets the health check provider registered for a specific endpoint.Gets the liveness health check provider if registered.Gets the readiness health check provider if registered.voidregisterHealthCheck(String endpoint, HealthCheckService.HealthCheckProvider provider) Registers a health check provider for one of the built-in endpoints, overriding its default implementation.voidunregisterHealthCheck(String endpoint) Unregisters a health check provider for a specific endpoint.
-
Method Details
-
registerHealthCheck
Registers a health check provider for one of the built-in endpoints, overriding its default implementation. The supported endpoints are/livenessand/readiness.- Parameters:
endpoint- the built-in endpoint path to override (/livenessor/readiness)provider- the health check provider that evaluates health status
-
unregisterHealthCheck
Unregisters a health check provider for a specific endpoint.- Parameters:
endpoint- the health check endpoint path to unregister
-
getHealthCheck
Gets the health check provider registered for a specific endpoint.- Parameters:
endpoint- the health check endpoint path- Returns:
- an optional containing the provider if registered, or empty if not
-
getLivenessCheck
Gets the liveness health check provider if registered.- Returns:
- an optional containing the liveness provider if registered
-
getReadinessCheck
Gets the readiness health check provider if registered.- Returns:
- an optional containing the readiness provider if registered
-