Skip to main content

healthyz

Function healthyz 

Source
pub(crate) async fn healthyz(__arg0: State<Arc<AppState>>) -> impl IntoResponse
Expand description

Check whether the node is healthy.

Healthy means that the node is running and has at least minimal connectivity.

ยงBehavior

Both conditions must be true for 200 OK:

  1. Node must be in Running state (HoprState::Running)
  2. Network must be minimally connected (Health::Orange, Health::Yellow, or Health::Green)

Returns 412 PRECONDITION_FAILED if either condition is false:

  • Node not running (any other HoprState)
  • Node running but network not minimally connected (Health::Unknown or Health::Red)

This endpoint is used by Kubernetes liveness probes to determine if the pod should be restarted.

Note: Currently healthyz and readyz have identical behavior.