Skip to content

Latest commit

 

History

History
61 lines (43 loc) · 1.2 KB

File metadata and controls

61 lines (43 loc) · 1.2 KB

API

Load local ports first:

set -a
test -f .env && . ./.env
set +a

API_GATEWAY_PORT="${API_GATEWAY_PORT:-8080}"

Base URL:

http://localhost:${API_GATEWAY_PORT}

Endpoints

Method Path What it returns
GET /healthz simple API health check
GET /targets configured target list
GET /status target state, latency, percentiles, and availability
GET /targets/{target_url} per-target detail for one URL
GET /uptime-summary lifetime success, failure, and availability
GET /uptime-summary-windowed?window=5m Prometheus-backed uptime window
GET /metrics Prometheus metrics for the API gateway

Commands

Health:

curl -fsS "http://localhost:${API_GATEWAY_PORT}/healthz"

Targets:

curl -fsS "http://localhost:${API_GATEWAY_PORT}/targets" | python3 -m json.tool

Status:

curl -fsS "http://localhost:${API_GATEWAY_PORT}/status" | python3 -m json.tool

Windowed uptime:

curl -fsS "http://localhost:${API_GATEWAY_PORT}/uptime-summary-windowed?window=5m" | python3 -m json.tool

Metrics:

curl -fsS "http://localhost:${API_GATEWAY_PORT}/metrics"