Health

Check reachability and latency for HTTP, TCP, and DNS targets — before you deploy.

annave health check tests one or more service targets concurrently and reports their status and latency. The check type is auto-detected from the target URI — no flags needed for standard cases.

Usage

bash
annave health check [targets...] [flags]

Flags

FlagShortDefaultDescription
--timeout10sPer-target timeout (e.g. 5s, 30s)
--formatplainOutput format: plain, json, table
--chainfalseStop at first failure — dependency chain mode

Target auto-detection

InputCheck type
https://... or http://...HTTP — GET request, expects 2xx status
tcp://host:portTCP port connectivity
dns://hostDNS resolution via system resolver
host:portTCP (auto-detected from colon + port number)
hostnameDNS (auto-detected when no port and no scheme)

Examples

Check multiple services

bash
annave health check https://api.example.com tcp://redis:6379 dns://internal.corp

With custom timeout

bash
annave health check https://api.example.com --timeout 30s

Dependency chain — stop at first failure

bash
annave health check https://db.internal tcp://cache:6379 https://api.internal --chain

Table output

bash
annave health check https://api.example.com tcp://redis:6379 --format table

Plain output

text
  Health check — 2026-05-16 10:42:07
  summary         3 total  2 up  1 down

  ✓  https://api.example.com                    UP        200 OK  142ms
  ✓  tcp://redis:6379                           UP                  3ms
  ✗  dns://internal.corp                        TIMEOUT   i/o timeout

JSON output shape

json
{
  "checked_at": "2026-05-16T10:42:07Z",
  "total": 3,
  "up": 2,
  "down": 1,
  "results": [
    {
      "target": {
        "name": "https://api.example.com",
        "check_type": "http",
        "timeout_ns": 10000000000
      },
      "status": "up",
      "latency_ns": 142000000,
      "message": "200 OK"
    }
  ]
}

What to watch

  • A timeout result does not cause a non-zero exit code — it is reported as status timeout in output. Only flag script failures by checking if down > 0 in the JSON output.
  • --chain stops at the first target that returns status down or timeout. Remaining targets are not checked.
  • The --timeout flag is clamped to health.timeout_seconds in limits.yaml. The default cap is 10s. Raise it in limits.yaml and rebuild for services with high cold-start latency.
  • Maximum 50 targets per run by default. Change health.max_targets in limits.yaml to raise this.
  • HTTP checks follow redirects. A chain of redirects that returns a final 2xx is reported as up.