Files
errors.bitreport.pt/scripts/examples/hub_public_smoke.sh
T
Peter Spark 8767e40bb6 docs(ops): hub parity tooling — HTTP contracts, runbooks, Prometheus
Add canonical HTTP_CONTRACTS with curl for hub + ingest endpoints, operator
runbooks for ingest debugging and five common hub flows, and Grafana/Prometheus
scraping notes. Extend ERROR_MONITORING_PUBLIC_API with stats + curl examples;
align purge and resolve-by-pattern docs with the Fastify implementation.
Add optional smoke scripts under scripts/examples/.

Paperclip-Agent: 5d084b36-f38f-42a5-a92a-520005afda4f
Paperclip-Issue: BIT-736
Paperclip-Run: ad2c5129-df54-44aa-afd4-6f9f7486c1a1
Made-with: Cursor
2026-04-02 20:36:57 +00:00

23 lines
853 B
Bash
Executable File

#!/usr/bin/env bash
# Optional smoke checks against the public hub API (read + health).
# Usage:
# export ER_API_BASE=https://errors.bitreport.pt
# export ERROR_RESOLVE_API_KEY=...
# ./scripts/examples/hub_public_smoke.sh
set -euo pipefail
: "${ER_API_BASE:?set ER_API_BASE (e.g. https://errors.bitreport.pt)}"
: "${ERROR_RESOLVE_API_KEY:?set ERROR_RESOLVE_API_KEY or ERROR_REPORTING_API_KEY}"
curl -sf --max-time 30 "${ER_API_BASE}/health" >/dev/null
curl -sf --max-time 30 -G "${ER_API_BASE}/api/error-monitoring/recent-errors" \
--data-urlencode "api_key=${ERROR_RESOLVE_API_KEY}" \
--data-urlencode "status=open,investigating" \
--data-urlencode "limit=1" >/dev/null
curl -sf --max-time 60 -G "${ER_API_BASE}/api/error-monitoring/stats" \
--data-urlencode "api_key=${ERROR_RESOLVE_API_KEY}" >/dev/null
echo "hub_public_smoke: ok"