-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwait_e2e_stack.sh
More file actions
executable file
·44 lines (36 loc) · 1.26 KB
/
wait_e2e_stack.sh
File metadata and controls
executable file
·44 lines (36 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
set -euo pipefail
timeout_seconds="${1:-180}"
wait_http() {
local name="$1"
local url="$2"
local deadline=$((SECONDS + timeout_seconds))
while (( SECONDS < deadline )); do
if curl -fsS "$url" >/dev/null 2>&1; then
echo "ready: $name"
return 0
fi
sleep 2
done
echo "timed out waiting for $name at $url" >&2
return 1
}
print_debug() {
docker compose ps || true
docker compose logs --no-color --tail=120 || true
}
trap 'print_debug' ERR
wait_http "loki" "http://127.0.0.1:3101/ready"
wait_http "victorialogs" "http://127.0.0.1:9428/health"
wait_http "vmalert" "http://127.0.0.1:8880/api/v1/rules?datasource_type=vlogs"
wait_http "proxy" "http://127.0.0.1:3100/ready"
wait_http "proxy-patterns-autodetect" "http://127.0.0.1:3110/ready"
wait_http "proxy-underscore" "http://127.0.0.1:3102/ready"
wait_http "proxy-native-metadata" "http://127.0.0.1:3106/ready"
wait_http "proxy-translated-metadata" "http://127.0.0.1:3107/ready"
wait_http "proxy-no-metadata" "http://127.0.0.1:3108/ready"
wait_http "proxy-tail" "http://127.0.0.1:3103/ready"
wait_http "tail-ingress" "http://127.0.0.1:3104/ready"
wait_http "proxy-tail-native" "http://127.0.0.1:3105/ready"
wait_http "grafana" "http://127.0.0.1:3002/api/health"
docker compose ps