40 lines
855 B
Bash
Executable File
40 lines
855 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
endpoints=(
|
|
"Traefik (dashboard)|http://127.0.0.1:8080/api/overview"
|
|
"Growth Service|http://127.0.0.1:4001/health"
|
|
"Billing Service|http://127.0.0.1:4002/health"
|
|
"Platform Service|http://127.0.0.1:4003/health"
|
|
"Tracker Service|http://127.0.0.1:4004/health"
|
|
"Extraction Service|http://127.0.0.1:4005/health"
|
|
"Loki|http://127.0.0.1:3100/ready"
|
|
"Grafana|http://127.0.0.1:3000/api/health"
|
|
)
|
|
|
|
failures=0
|
|
|
|
echo "Health check (local)"
|
|
echo
|
|
|
|
for item in "${endpoints[@]}"; do
|
|
name="${item%%|*}"
|
|
url="${item#*|}"
|
|
|
|
if curl -fsS --max-time 5 "$url" >/dev/null; then
|
|
printf " OK %s\n" "$name"
|
|
else
|
|
printf " FAIL %s (%s)\n" "$name" "$url" >&2
|
|
failures=$((failures + 1))
|
|
fi
|
|
done
|
|
|
|
echo
|
|
|
|
if [[ "$failures" -gt 0 ]]; then
|
|
echo "Result: FAIL ($failures)" >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo "Result: OK"
|