﻿# cyoda health — readiness probe

`cyoda health` sends an HTTP GET to `http://127.0.0.1:/readyz` and exits 0 if the server responds with HTTP 200. Any non-200 response or connection …

<p class="cyoda-help-pinned"><em>cyoda-go version <a href="https://github.com/Cyoda/cyoda-go/releases/tag/v0.8.4">0.8.4</a></em>

# cli.health

## NAME

cli.health — probe the admin listener's `/readyz` endpoint.

## SYNOPSIS

`cyoda health`

## DESCRIPTION

`cyoda health` sends an HTTP GET to `http://127.0.0.1:<port>/readyz` and exits 0 if the server responds with HTTP 200. Any non-200 response or connection error causes exit 1.

The probe uses a hard-coded 2-second HTTP client timeout. This timeout is load-bearing: a deadlocked readiness handler looks identical to "server accepts the connection then hangs" from the client's perspective. Without a timeout, Docker's `HEALTHCHECK` would inherit the deadlock and never mark the container unhealthy.

The port is read from `CYODA_ADMIN_PORT` (default: `9091`). The admin listener always binds to `127.0.0.1` from the probe's perspective — `cyoda health` is designed to run inside the same container or on the same host as the server.

Despite the command name, this probes `/readyz` on the admin listener, not `GET /health` on the API listener. The two mirror the same underlying flag — `200`/`ready` while healthy, `503` once a panic has been recovered in engine or store work and the node's state is unverified, latched until the node is replaced (a panic in a probe or a metrics scrape is contained with a ticket but does not latch) — but `/health` is a plain JSON summary for humans and simple scripts, not the deployment probe.

Primary consumers:

- **Docker Compose** — `HEALTHCHECK` stanza in the service definition.
- **Helm chart** — `readinessProbe` invokes `cyoda health` before the pod is marked ready.

## OPTIONS

`cyoda health` accepts no flags.

## ENVIRONMENT VARIABLES

- `CYODA_ADMIN_PORT` — Admin listener port to probe (default: `9091`).

## EXIT CODES

- `0` — Server responded HTTP 200. Instance is ready.
- `1` — Connection failed, timed out, or server returned a non-200 status.

## EXAMPLES

```
# Basic probe (uses CYODA_ADMIN_PORT or default 9091)
cyoda health

# Probe a server on a non-default admin port
CYODA_ADMIN_PORT=19091 cyoda health

# Use in a shell script
if cyoda health; then
  echo "server is ready"
else
  echo "server not ready" >&2
  exit 1
fi
```

## SEE ALSO

- telemetry

## See also

- [`cyoda help telemetry`](/help/telemetry/) — cyoda-go integrates the OpenTelemetry Go SDK (`go.opentelemetry.io/otel`). The
**metric scrape pipeline is always on**: at startup the binary creates a meter
provider with an OpenTelemetry → Prometheus exporter and serves it at
`:9091/metrics`, regardless of `CYODA_OTEL_ENABLED`. No collector is required to
scrape metrics.

## Raw formats

- [`/help/cli/health.json`](/help/cli/health.json) — full descriptor (matches `GET /help/{topic}` envelope)
- [`/help/cli/health.md`](/help/cli/health.md) — body only