guardrail/services/health-aggregator
Caelum 754faf2f31
fix: remove stray 8.3M Go binary, gitignore service build outputs (#8)
The health-aggregator smoke build left a compiled binary that got committed.
Remove it and add services/.gitignore so `go build` outputs never land in git.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 14:48:03 +03:00
..

health-aggregator

A read-only Go ops service that polls the /health endpoints of the Guardrail services concurrently and serves a single aggregated status. Only issues GETs; no path into the trading loop.

Run

cd services/health-aggregator
go run .                              # defaults: api :8080, price-oracle :8090, exporter :9100
HEALTH_TARGETS="api=http://127.0.0.1:8080/health,oracle=http://127.0.0.1:8090/health" go run .
HEALTH_ADDR=:9000 go run .

Endpoints

Route Description
GET /health Aggregate status (200 if all up, 503 if any down) with per-target up/latency/error.
GET /targets The configured target list.
curl -fsS localhost:8095/health | jq

Each target is checked concurrently with a 5s client timeout; the aggregate is ok only when every target returns 2xx, else degraded.