forked from mtusi2026/mtusi2026lab6
ЛР 6 — БВТ2301 — Курлова — на 5 (трек 1 «Цена наблюдаемости»)
Перенесён минимум lab5 без изменения API и добавлена наблюдаемость: - OTel SDK в API и worker: traces, metrics, logs по OTLP; W3C trace context API -> outbox -> RabbitMQ -> worker (producer/consumer spans, retry в той же трассе); - OTel Collector (memory_limiter, scrub, batch, ограниченные очереди, профиль tail sampling), Prometheus, Loki, Tempo, Grafana с provisioning, dashboard и 6 alert rules с runbooks; - проверки: наблюдаемость и приватность, инциденты A/B/C, насыщение worker, переполнение очереди exporter, эксперимент трека 1 (4 конфигурации x 3 прогона); - CI job со сборкой и запуском стенда; REPORT.md с доказательствами в evidence/.
This commit is contained in:
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
# Creates a local .env and random credentials in secrets/ (both are git-ignored). Prints no secret values.
|
||||
# Safe to repeat: existing files are kept, so running it on a live stand does not change its passwords.
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
[ -f .env ] || cp .env.example .env
|
||||
umask 077
|
||||
mkdir -p secrets
|
||||
cd secrets
|
||||
|
||||
put() { # put <file> <value>
|
||||
[ -f "$1" ] || printf '%s' "$2" > "$1"
|
||||
}
|
||||
random() { python3 -c "import secrets;print(secrets.token_urlsafe(24),end='')"; }
|
||||
|
||||
put postgres_password "$(random)"
|
||||
put minio_root_user messenger_root
|
||||
put minio_root_password "$(random)"
|
||||
put s3_access_key_id messenger_app
|
||||
put s3_secret_access_key "$(random)"
|
||||
put rabbitmq_password "$(random)"
|
||||
put grafana_admin_password "$(random)"
|
||||
put cache_url valkey://valkey:6379/0
|
||||
put database_url "postgresql://messenger:$(cat postgres_password)@postgres:5432/messenger"
|
||||
put broker_url "amqp://messenger:$(cat rabbitmq_password)@rabbitmq:5672/messenger"
|
||||
# Containers run under other uids and read these through Docker secrets (file bind mounts in Compose).
|
||||
chmod 644 ./*
|
||||
echo "secrets ready in secrets/ (.env: $( [ -f ../.env ] && echo present ))"
|
||||
Reference in New Issue
Block a user