forked from mtusi2026/mtusi2026lab6
feat(lab6): add observability and SLO burn-rate alerts
This commit is contained in:
Executable
+45
@@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
project_root=$(CDPATH='' cd -- "$(dirname -- "$0")/.." && pwd)
|
||||
cd "$project_root"
|
||||
|
||||
env_file=${ENV_FILE:-.env}
|
||||
compose() {
|
||||
if [ -f "$env_file" ]; then
|
||||
docker compose --env-file "$env_file" "$@"
|
||||
else
|
||||
docker compose "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
# Останавливаем consumers до рестарта устойчивых зависимостей. PostgreSQL,
|
||||
# MinIO и RabbitMQ используют named volumes; Redis остаётся rebuildable cache.
|
||||
compose stop worker dispatcher
|
||||
compose restart postgres redis minio broker
|
||||
compose up -d --wait postgres redis minio broker
|
||||
|
||||
# Повторный bootstrap приватного bucket/policy/user обязан быть идемпотентным.
|
||||
compose run --rm minio-bootstrap >/dev/null
|
||||
|
||||
# Dispatcher восстановит все DB jobs без publish marker; worker продолжит
|
||||
# durable queue. Фоновые процессы не имеют HTTP readiness endpoint.
|
||||
compose up -d --no-deps dispatcher worker
|
||||
|
||||
# up восстанавливает желаемое число реплик, включая ранее вручную остановленную.
|
||||
compose up -d --no-deps api
|
||||
compose restart api
|
||||
compose up -d --wait --no-deps api
|
||||
|
||||
# Статический frontend возвращается до публичной точки входа.
|
||||
compose restart frontend
|
||||
compose up -d --wait --no-deps frontend
|
||||
|
||||
# Публичная точка входа перезапускается последней, когда API и frontend готовы.
|
||||
compose restart load-balancer
|
||||
compose up -d --wait --no-deps load-balancer
|
||||
|
||||
# Telemetry storage uses separate named volumes; restart the signal path without
|
||||
# deleting history. Business readiness never depends on these services.
|
||||
compose restart loki tempo otel-collector prometheus grafana
|
||||
compose up -d --wait --no-deps loki tempo otel-collector prometheus grafana
|
||||
Reference in New Issue
Block a user