mcl_core_health_handler (mcl_core v1.0.0)
View SourceCowboy handler — GET /health.
Returns 200 + JSON when the service is ok; 503 + JSON for {degraded, _} or {down, _}. Podman's HEALTHCHECK and Kubernetes-style liveness probes consume this.
Summary
Functions
The JSON body for a health verdict. Every state lists the provider grants, so a service still inside its waiting window answers ok and says which procedure is not granted yet and why; every state also lists the advertise loop's last outcome per procedure (last successful advertise age), so a dead advertise loop cannot hide behind ok + failed_publishes: 0 -- zero is exactly what a loop that makes no attempts produces (issue #5). Every state also carries the boot claim's state (mcl_core_claim:status/0), so a claim the realm holds as pending is visible to its operator here, and the subscription set's own report (declared, running, last failure per topic), so a subscriber that will not start is visible without reading a log -- and, through the verdict, rather than behind an ok (mcl-om#41).
Functions
-spec body(mcl_core_service:health(), map(), [map()], [map()], map(), map(), non_neg_integer()) -> map().
The JSON body for a health verdict. Every state lists the provider grants, so a service still inside its waiting window answers ok and says which procedure is not granted yet and why; every state also lists the advertise loop's last outcome per procedure (last successful advertise age), so a dead advertise loop cannot hide behind ok + failed_publishes: 0 -- zero is exactly what a loop that makes no attempts produces (issue #5). Every state also carries the boot claim's state (mcl_core_claim:status/0), so a claim the realm holds as pending is visible to its operator here, and the subscription set's own report (declared, running, last failure per topic), so a subscriber that will not start is visible without reading a log -- and, through the verdict, rather than behind an ok (mcl-om#41).