forked from mtusi2026/mtusi2026lab6
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a14da96aa | ||
|
|
a5c650bcf5 | ||
|
|
0355ba13d2 | ||
|
|
71254d3389 | ||
|
|
5c3c4a9d0d |
@@ -0,0 +1,6 @@
|
|||||||
|
* text=auto
|
||||||
|
*.sh text eol=lf
|
||||||
|
*.py text eol=lf
|
||||||
|
*.yaml text eol=lf
|
||||||
|
*.sql text eol=lf
|
||||||
|
*.cmd text eol=crlf
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
FROM python:3.11.10-slim-bookworm@sha256:840e180ebcc6e5c8efab209c43f5e40fd2af98cb49db5c7103c90539c56bb30e
|
||||||
|
WORKDIR /app
|
||||||
|
# Приложение работает без прав root.
|
||||||
|
RUN groupadd -r appuser && useradd -r -g appuser appuser
|
||||||
|
COPY requirements.lock.txt .
|
||||||
|
RUN pip install --no-cache-dir -r requirements.lock.txt
|
||||||
|
COPY src/ src/
|
||||||
|
COPY migrations/ migrations/
|
||||||
|
USER appuser
|
||||||
|
HEALTHCHECK --interval=2s --timeout=2s --start-period=10s --retries=3 CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8080/health/ready',timeout=1)"
|
||||||
|
EXPOSE 8080
|
||||||
|
CMD ["python", "-m", "uvicorn", "src.app:app", "--host", "0.0.0.0", "--port", "8080", "--timeout-graceful-shutdown", "8", "--timeout-keep-alive", "2", "--no-access-log"]
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# Build pinned upstream releases and verify archive checksums.
|
||||||
|
FROM golang:1.24.6-bookworm@sha256:ab1d1823abb55a9504d2e3e003b75b36dbeb1cbcc4c92593d85a84ee46becc6c AS build
|
||||||
|
WORKDIR /build
|
||||||
|
ADD --checksum=sha256:8819e3e7817e46b7b3798f8f200ead208562e571563c2e040352378031abe9f2 https://github.com/minio/minio/archive/07c3a429bfed433e49018cb0f78a52145d4bedeb.tar.gz /tmp/minio.tar.gz
|
||||||
|
RUN tar -xzf /tmp/minio.tar.gz --strip-components=1 && CGO_ENABLED=0 go build -trimpath -o /out/minio .
|
||||||
|
WORKDIR /build-mc
|
||||||
|
ADD --checksum=sha256:526ec538e7f83e4bfa631788129b08ec85898ca572ce0523ebf9a597946bea27 https://github.com/minio/mc/archive/refs/tags/RELEASE.2025-04-16T18-13-26Z.tar.gz /tmp/mc.tar.gz
|
||||||
|
RUN tar -xzf /tmp/mc.tar.gz --strip-components=1 && CGO_ENABLED=0 go build -trimpath -o /out/mc .
|
||||||
|
FROM debian:bookworm-20251020-slim@sha256:78d2f66e0fec9e5a39fb2c72ea5e052b548df75602b5215ed01a17171529f706
|
||||||
|
LABEL org.opencontainers.image.source="https://github.com/minio/minio" org.opencontainers.image.revision="07c3a429bfed433e49018cb0f78a52145d4bedeb"
|
||||||
|
COPY --from=build /build/LICENSE /usr/share/doc/minio/LICENSE
|
||||||
|
COPY --from=build /build-mc/LICENSE /usr/share/doc/mc/LICENSE
|
||||||
|
COPY --from=build /out/minio /out/mc /usr/bin/
|
||||||
|
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||||
|
COPY infra/s3-entrypoint.sh /usr/local/bin/s3-entrypoint.sh
|
||||||
|
ENTRYPOINT ["/bin/sh","/usr/local/bin/s3-entrypoint.sh"]
|
||||||
|
CMD ["server","/data"]
|
||||||
@@ -1,37 +1,255 @@
|
|||||||
# Отчёт — лабораторная 6
|
# Лабораторная №6. Наблюдаемость: OpenTelemetry и Grafana
|
||||||
|
|
||||||
- Автор, группа: TODO
|
**Ляхонов Сергей, БВТ2301. Цель: оценка 5, трек 2 — SLO и обнаружение инцидентов.**
|
||||||
- Целевая оценка; выбранный трек 5, если нужен: TODO
|
|
||||||
- Commit/PR: TODO после публикации
|
Основа №6: `470d9d6`; перенесённая собственная база №5: `9dd2a03`. Измерения выполнены заново 27 ноября 2026 года. Commit/версии/лимиты измеренного стенда — `evidence/environment.json`, identities и сохранность материалов — `evidence/audit.json`. Измерения №5 не используются как результаты №6.
|
||||||
- Использованные источники, библиотеки и помощь ИИ: TODO
|
|
||||||
|
|
||||||
## Запуск из чистого clone
|
## Запуск из чистого clone
|
||||||
|
|
||||||
TODO: версии runtime/образов, prerequisites, команды создания локальных secrets/.env, build, миграций, запуска, ожидания готовности, тестов и остановки. Указать необходимые действия оператора. Не вставлять секреты. Отдельно указать безопасную остановку и команду намеренного удаления учебных данных.
|
Нужны Docker Linux engine, Compose v2 и локальный Python 3.11+ для инструментов. Проверено: Windows, Docker Desktop 4.49.0, Engine 28.5.1, Compose 2.40.3; i5-1340P, 16 логических CPU, 15.6 GiB RAM host; Docker VM — 16 CPU / 7.57 GiB RAM. Это общий host с оставленными контейнерами предыдущей работы, не выделенная benchmark-машина.
|
||||||
|
|
||||||
## Архитектура и решения
|
PowerShell, из корня №6:
|
||||||
|
|
||||||
TODO: схема процессов/хранилищ, источник истины, транзакционные границы, ограничения. Что перенесено из lab5, что изменено в этой работе. Соответствие переменных из .env.example реальной конфигурации.
|
```powershell
|
||||||
|
python -X utf8 scripts/bootstrap.py
|
||||||
|
python -m venv .venv
|
||||||
|
.venv/Scripts/python -m pip install -r requirements-dev.txt
|
||||||
|
docker compose -p lyakhonov-lab6 config --quiet
|
||||||
|
docker compose -p lyakhonov-lab6 build api s3
|
||||||
|
docker compose -p lyakhonov-lab6 up -d --no-build
|
||||||
|
python -X utf8 scripts/wait_ready.py --telemetry
|
||||||
|
python -X utf8 scripts/check_contract.py
|
||||||
|
.venv/Scripts/python -X utf8 scripts/validate_openapi.py
|
||||||
|
python -X utf8 tests/smoke.py --base-url http://127.0.0.1:8086
|
||||||
|
python -X utf8 student-tests/signals.py
|
||||||
|
python -X utf8 student-tests/resilience.py
|
||||||
|
python -X utf8 student-tests/incidents.py
|
||||||
|
python -X utf8 student-tests/bounds.py
|
||||||
|
python -X utf8 student-tests/worker_db_failure.py
|
||||||
|
python -X utf8 student-tests/telemetry_persistence.py
|
||||||
|
python -X utf8 student-tests/slo_research.py --domain both --repeats 2
|
||||||
|
```
|
||||||
|
|
||||||
|
Публичным Python-командам соответствуют `make check`, `make validate`, `make test BASE_URL=...`. На Linux путь venv — `.venv/bin/python`. Windows driver public resilience использует `.cmd`; Linux hooks — `scripts/restart.sh` и `scripts/stop-one.sh` (дать executable bit). Локальный bootstrap создаёт **только отсутствующие** secrets и `.env`, существующие значения не меняет. Фактический шаблон настроек — `lab6.env.example`; нормативный `.env.example` сохранён.
|
||||||
|
|
||||||
|
API: `http://127.0.0.1:8086`. Grafana: `http://127.0.0.1:3006/d/messenger-lab6`; для синтетического локального стенда включён анонимный Viewer. Admin password находится только в `secrets/grafana_password`. При конфликте портов задайте `LAB6_PORT`/`GRAFANA_PORT`; тестам — `BASE_URL`/`GRAFANA_URL`. Внутренние порты API, БД, S3, брокера, Collector/backends не публикуются.
|
||||||
|
|
||||||
|
`migrate` применяет версионированные SQL под advisory lock в одной транзакции. `bucket-init` повторяемо создаёт приватный bucket и ограниченного пользователя; broker bootstrap читает пароль из file secret. Durable queue объявляется producer/consumer. Grafana datasources/dashboard и Prometheus rules provisioned из Git, ручной импорт не нужен. Повторный `up -d` допустим. `up --wait` не используется из-за поведения Compose 2.40 с background services без healthcheck.
|
||||||
|
|
||||||
|
Безопасная остановка с сохранением данных: `docker compose -p lyakhonov-lab6 down`. Намеренное удаление данных **только №6**, если они больше не нужны: `docker compose -p lyakhonov-lab6 down -v`. При persistence/failover volumes не удаляются.
|
||||||
|
|
||||||
|
Чистый экспорт: `python -X utf8 scripts/reproduce.py`. Он экспортирует Git HEAD, генерирует новые secrets, уникальные project/images/volumes и свободные loopback-порты, выполняет build/bootstrap/provisioning/readiness/smoke и проверку реальных сигналов. Затем удаляет только свои временные ресурсы; абсолютный путь temp проверяется перед удалением. Доказательство — `evidence/reproduction.json`.
|
||||||
|
|
||||||
|
## Архитектура и перенос
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
flowchart LR
|
||||||
|
client --> lb[HAProxy]
|
||||||
|
lb --> api[2 API replicas]
|
||||||
|
api --> db[(PostgreSQL)]
|
||||||
|
api --> s3[(Private S3 staging)]
|
||||||
|
db --> dispatch[Outbox dispatcher]
|
||||||
|
dispatch --> broker[RabbitMQ]
|
||||||
|
broker --> worker[2 workers]
|
||||||
|
worker --> s3
|
||||||
|
worker --> db
|
||||||
|
api --> collector[OTel Collector]
|
||||||
|
dispatch --> collector
|
||||||
|
worker --> collector
|
||||||
|
collector --> prom[(Prometheus)]
|
||||||
|
collector --> loki[(Loki)]
|
||||||
|
collector --> tempo[(Tempo)]
|
||||||
|
diagnostics[Durable backlog exporter] --> prom
|
||||||
|
prom --> grafana[Grafana]
|
||||||
|
loki --> grafana
|
||||||
|
tempo --> grafana
|
||||||
|
```
|
||||||
|
|
||||||
|
Перенесены исходники, миграции, зависимости, Dockerfiles, необходимые конфиги и собственные совместимые проверки. Сохранены Argon2id, PostgreSQL-сессии/ACL, keyset pagination, общая транзакционная идемпотентность, необязательный Redis-кэш профилей, durable staging, outbox, confirms/manual ack, lease/fencing, retry/replay и cleanup. Thumbnail: JPEG до 256×256 без увеличения, crop: JPEG 128×128, optimized: WebP до 1280×1280; orientation применяется, alpha на белом, EXIF удаляется. Параметры v1 — JPEG 85/WebP 82, v2 — 90/88; уменьшение каждого файла не обещается.
|
||||||
|
|
||||||
|
Версии pipeline сохранены как собственное расширение №5, не исследовательский трек №6. Локальные команды `python -m src.operator failed`, `replay UUID`, `upgrade UUID --version 2` выполняются внутри worker и не меняют обязательный API. Старые final-объекты автоматически не удаляются.
|
||||||
|
|
||||||
|
OpenAPI №5/№6 отличается только title/version; jobs schema, состояния, smoke/resilience совпадают. Исходные contracts/tests/examples/fixtures и Markdown задания №6 сохранены. История №6 не заменялась историей №5. Новые элементы: `007_trace_context.sql`, SDK-инструментация, durable carrier, producer/consumer spans, Collector/backends, provisioning/dashboard/alerts, собственные сценарии и отчёт. Общий app image собирается только сервисом api: это устраняет найденный конфликт параллельного экспорта одного тега. Shell-файлам закреплён LF.
|
||||||
|
|
||||||
|
Окончательное исправление учёта ошибок worker: исключение БД при COMMIT результата помечается retry и не приводит к ack; это отдельно проверено блокировкой attachment_variants, восстановлением после lease и SHA-256 четырёх объектов. Серии SLO измеряли исходный runtime commit `0355ba1`; эта правка редкой ошибки DB publication и добавление постоянного queue label не меняют исследованные SQL-message/worker-stop пути. Финальный runtime дополнительно прошёл smoke/сигналы/границы; чистый Git-экспорт также прошёл build/bootstrap/readiness/smoke/сигналы, его временные ресурсы удалены (evidence/reproduction.json, cleanup.json).
|
||||||
|
|
||||||
|
До 202 исходник устойчиво записан в S3 staging, attachment/job — в общей DB-транзакции. Общей транзакции S3/DB/RabbitMQ нет. Повтор публикации после неопределённого confirm безопасен; ack — после устойчивого эффекта. At-least-once не означает exactly-once. Lease/fencing защищают manifest; до 5 попыток с backoff/jitter, replay аудируется. Orphan/failed staging retention 86400 s, ready staging удаляется после безопасной публикации. Единственные DB/LB/S3/broker и один host остаются точками отказа.
|
||||||
|
|
||||||
|
## Инфраструктура и настройки
|
||||||
|
|
||||||
|
Все сервисы — в отдельной Compose-сети проекта №6. Каждый persistent volume имеет prefix проекта.
|
||||||
|
|
||||||
|
| Service / роль | Версия | CPU / RAM limit | Хранение / готовность |
|
||||||
|
|---|---|---|---|
|
||||||
|
| api ×2 | Python 3.11.10, FastAPI 0.115.0, OTel 1.38.0 | 0.5 / 640 MiB каждый | Stateless; DB+S3 readiness |
|
||||||
|
| lb | HAProxy 3.0.6-alpine | 0.5 / 128 MiB | HTTP readiness каждой API |
|
||||||
|
| db | PostgreSQL 16.6-alpine | 1 / 512 MiB | postgres_data; pg_isready |
|
||||||
|
| redis | 7.4.1-alpine | 0.25 / 128 MiB | Только cache, maxmemory 64 MiB, без обязательных данных |
|
||||||
|
| s3 | MinIO revision 07c3a429… | 1 / 768 MiB | s3_data; API проверяет staging |
|
||||||
|
| broker | RabbitMQ 4.1.0-alpine | 0.75 / 512 MiB | broker_data; diagnostics ping |
|
||||||
|
| worker ×2 | Собственный app image | 0.75 / 768 MiB каждый | Prefetch 1, subprocess timeout 60 s, lease 90 s, shutdown grace 95 s |
|
||||||
|
| dispatcher / staging-cleaner | Собственный app image | 0.5 / 0.25 CPU соответственно, 256 MiB каждый | Durable state в DB, SIGTERM, restart unless-stopped |
|
||||||
|
| diagnostics | Собственный app image | 0.25 / 128 MiB | Внутренний exporter DB backlog и SLI cohorts |
|
||||||
|
| otel-collector | contrib 0.137.0 | 0.5 / 256 MiB | Limiter/batch/ограниченные временные очереди |
|
||||||
|
| prometheus | 3.7.3 | 0.5 / 384 MiB | metrics_data; retention 24 h / 512 MB |
|
||||||
|
| loki | 3.5.7 | 0.5 / 384 MiB | logs_data; filesystem/TSDB v13, retention 24 h |
|
||||||
|
| tempo | 2.9.0 | 0.5 / 384 MiB | traces_data; WAL/blocks, retention 24 h |
|
||||||
|
| grafana | 12.2.1 | 0.5 / 384 MiB | grafana_data; provisioning |
|
||||||
|
|
||||||
|
Полные digests Python/Go/Debian и SHA-256 архивов MinIO/mc закреплены в Dockerfiles. Другие upstream образы закреплены release tags, Python зависимости — requirements.lock.txt. Сборка MinIO/mc из закреплённых официальных исходников с checksum повторно прошла; latest не используется.
|
||||||
|
|
||||||
|
Credentials передаются через files: DATABASE_URL_FILE, BROKER_URL_FILE, S3_ACCESS_KEY_FILE/S3_SECRET_KEY_FILE; последние соответствуют логическим S3 credentials нормативного `.env.example`. SESSION_STORE фактически PostgreSQL, CACHE_URL — только профили, API_REPLICAS/WORKER_CONCURRENCY — количество контейнеров. Остальные лимиты показаны в compose.yaml. Приложение работает без root.
|
||||||
|
|
||||||
|
Readiness не зависит от telemetry, Redis или worker/broker; сообщения продолжают работать без них, принятые jobs ждут worker. S3 критичен для синхронного upload: его отказ снимает API с LB. HAProxy 503 этого периода может быть HTML без API headers; это отдельно учитывается в собственном fault polling.
|
||||||
|
|
||||||
|
## Telemetry
|
||||||
|
|
||||||
|
SDK/semantic conventions 1.38.0/0.59b0, OTLP HTTP/protobuf на Collector. Ресурсы: service.name=messenger-api/messenger-worker/messenger-dispatcher, service.version=1.6.0, service.instance.id, deployment.environment.name=lab. Sampling parent-based 100%; TRACE_SAMPLE_RATIO/TELEMETRY_ENABLED настраиваются, исследование цены sampling не заявляется.
|
||||||
|
|
||||||
|
| Сигнал | Реальные имена / единицы |
|
||||||
|
|---|---|
|
||||||
|
| HTTP requests / duration | messenger_http_requests_total, messenger_http_duration_seconds_bucket; method/route template/status_class; seconds |
|
||||||
|
| Jobs / duration | messenger_jobs_total, messenger_job_duration_seconds_bucket; job_type/outcome=success/retry/failed; seconds |
|
||||||
|
| Time to ready | messenger_ready_duration_seconds_bucket; seconds от DB created_at до COMMIT ready, только завершённые |
|
||||||
|
| Durable backlog | messenger_queue_depth, messenger_queue_oldest_seconds; queue=attachment.process.v1; все queued/processing, включая outbox; jobs / seconds |
|
||||||
|
| DB / worker | messenger_db_pool_used/waiting, messenger_worker_busy/capacity; connections / workers |
|
||||||
|
| CPU/RAM процесса | messenger_process_cpu_seconds_total, messenger_process_maxrss_bytes; CPU time / high-water RSS |
|
||||||
|
| Когорты accepted uploads | messenger_ready_window_bad/total{window=...}; включают ещё не ready и failed |
|
||||||
|
|
||||||
|
API/worker/dispatcher signals идут через Collector; отдельный внутренний exporter backlog/SLI опрашивает PostgreSQL и scrape-ится Prometheus. Resource labels ограничены service/version/instance/environment. user/chat/message/attachment/request IDs, filename и raw URL не используются в labels метрик.
|
||||||
|
|
||||||
|
Buckets секунд: .005, .01, .025, .05, .1, .25, .5, 1, 2, 5, 10, 20, 30, 60, 120, +Inf. Dashboard считает p50/p95/p99 через `histogram_quantile(q,sum by(le)(rate(..._bucket[1m])))`, агрегируя buckets реплик, без усреднения percentiles. Запросы/единицы сохранены в dashboard JSON. DB used=pool_size−pool_available, waiting=requests_waiting; busy/capacity — на каждый worker. Container CPU%/cgroup memory дополнительно собираются редкими docker stats snapshots.
|
||||||
|
|
||||||
|
Логи содержат native timestamp/severity/resource и JSON event/trace_id/span_id. request_id связывает ошибку с HTTP; входящий X-Request-Id принимается только как UUID. Тела, пароли, Authorization, изображения/query strings не экспортируются; SQL parameters не захватываются. Технические job ID/S3 keys в traces допустимы для синтетических данных и нужны для диагностики. Ручные spans не записывают текст exception/stack автоматически.
|
||||||
|
|
||||||
|
Upload carrier устойчиво сохраняется в DB job. Dispatcher извлекает его, создаёт producer span, inject W3C traceparent/tracestate в разрешённые поля envelope. Worker извлекает carrier до бизнес-валидации и создаёт consumer span. Carrier не участвует в сравнении логического задания. Retry — новые producer/consumer spans той же причинной цепочки и attempt/outcome в логе; broker redelivery не создаёт новый job ID. DB/S3 — реальные client spans. Transform span включает длительность image subprocess.
|
||||||
|
|
||||||
|
SDK span/log queues по 256 элементов, batch ≤64, export timeout 2 s. Collector limiter 160 MiB/spike 32 MiB, batch ≤256, OTLP queues по 128 batch-запросов, 2 consumers, timeout 2 s, retries ≤15 s. Очереди в памяти, crash Collector может потерять telemetry. После исчерпания retry сигналы отбрасываются; ошибки export и RAM измерены. Prometheus хранит метрики, Loki — логи, Tempo — трассы, Grafana только запрашивает их. Native Loki OTLP требует structured metadata/schema v13; устаревший Loki exporter не используется.
|
||||||
|
|
||||||
## Доказательства критериев
|
## Доказательства критериев
|
||||||
|
|
||||||
| Критерий README | Команда/сценарий | Наблюдаемый результат | Файл доказательства |
|
| Критерий | Команда / сценарий | Наблюдение | Доказательство |
|
||||||
|---|---|---|---|
|
|---|---|---|---|
|
||||||
| Публичный smoke | make test | TODO | TODO |
|
| Контракт | check_contract.py; validate_openapi.py | Структура, OpenAPI 3.1 / JSON Schema | evidence/structure.txt, validation.txt |
|
||||||
| Остальные пункты уровня 3 | TODO | TODO | TODO |
|
| Минимум №5 + telemetry | public smoke | Сессии, ACL, pagination, идемпотентность, 202→ready, байты original/thumbnail | evidence/smoke-telemetry.txt |
|
||||||
| Все пункты уровня 4, если заявлен | TODO | TODO | TODO |
|
| Сигналы/provisioning | signals.py | Свежие метрики, API/producer/consumer/S3/DB graph и связанные логи | evidence/signals.json; infra/grafana/ |
|
||||||
| Выбранный трек 5, если заявлен | TODO | TODO | TODO |
|
| Labels/секреты | signals.py | Допустимые labels, отсутствие созданных tokens/password/body в полученной telemetry | evidence/signals-run.txt |
|
||||||
|
| Конкурентные/negative | signals.py | 24 повтора → 1 ID, 409 mismatch, 415 corrupt, 404 ACL; SHA всех вариантов | evidence/signals.json |
|
||||||
|
| Изображения | unittest test_images.py | Размеры/байты, orientation/alpha/small images | evidence/images-unit.txt |
|
||||||
|
| Persistence | resilience.py | Реальные API/DB/S3/broker/cache restart с volumes, прежняя сессия/данные/файл | evidence/resilience.json |
|
||||||
|
| Failover | resilience.py | Public twice; отдельно каждая API, по 20 подтверждений оставшейся | evidence/resilience.json |
|
||||||
|
| Границы HTTP | bounds.py | 10 MiB+1 реальных bytes, 40041001 pixels до decode, MIME/name, sender spoof, semantic replay | evidence/bounds.json |
|
||||||
|
| SQL failure worker | worker_db_failure.py | Ошибка публикации → retry, lease recovery, ready и все checksums | evidence/worker-db-failure.json |
|
||||||
|
| История сигналов | telemetry_persistence.py | Новые ID storage containers с теми же volumes, прежние traces/logs/historical metrics | evidence/telemetry-persistence.json |
|
||||||
|
| Контекст включая retry | incidents.py | S3 stop → повтор в том же trace → ready | evidence/incidents.json |
|
||||||
|
| Percentiles/pool/worker/backlog | Dashboard + signals/incidents | Реальные histogram/gauge и запросы | infra/grafana/dashboards/messenger.json |
|
||||||
|
| SLO/alerts | Rules + incidents.py | HighAPIErrorRate/QueueLag firing, затем resolved | infra/otel/alerts.yaml; evidence/incidents.json |
|
||||||
|
| Два диагноза | worker stop / SQL lock | Backlog без consumers; отдельно медленный SQL/503 | evidence/incidents.json; RUNBOOK.md |
|
||||||
|
| Backend telemetry down | Tempo stop | Завершены 10 сообщений/10 upload, ограниченные queues/RAM, export failures | evidence/incidents.json |
|
||||||
|
| Трек 2 | slo_research.py | Короткий/длительный инцидент, multi-window burn, время реакции, контроль | evidence/slo-*.json |
|
||||||
|
| Чистый экспорт | reproduce.py | Новые secrets/project/images/volumes/ports, build/smoke/signals, cleanup | evidence/reproduction.json |
|
||||||
|
| Финальный аудит | audit.py | Задание, secrets, identities, №4/№5 | evidence/audit.json |
|
||||||
|
|
||||||
TODO: добавить отдельную строку для каждого заявленного критерия. PASS без команды и наблюдения не является доказательством. Проверка инфраструктурного hook требует подтверждения, какие реальные процессы/хранилища перезапущены.
|
Фактический разбор уровня 4: при остановке worker росли age/depth и срабатывал QueueLag, после запуска принятая работа достигла ready. При SQL lock сохранены 132 ответа 503: server span 2039 ms, ошибочный INSERT 2002 ms с LockNotAvailable; прочие DB spans занимали единицы миллисекунд. Это локализует задержку в SQL lock, а не в вычислении HTTP handler. Retry при S3 outage виден в трёх consumer spans одной цепочки. Во время восстановления S3 отдельно учтены три HAProxy 503; они не скрыты и не считаются API-контрактными ответами.
|
||||||
|
|
||||||
## Эксперименты и отказы
|
При отключённом Tempo завершены 10 сообщений и 10 upload. Максимальная наблюдённая очередь exporter — 48 при лимите 128, Collector memory — 64.20–64.71 MiB при cgroup limit 256 MiB. В логах Collector подсчитано **245 окончательно отброшенных spans** по dropped_items; send_failed_spans — отдельный счётчик неуспешных отправок и не подменяет точный подсчёт потерь. Полнота telemetry при таком отказе не обещается, бизнес-результаты сохраняются. Метод подсчёта: `python -X utf8 scripts/enrich_incidents.py`, evidence/incidents.json. [Семантика exporter helper](https://github.com/open-telemetry/opentelemetry-collector/blob/v0.137.0/exporter/exporterhelper/internal/queue_sender.go).
|
||||||
|
|
||||||
TODO: гипотеза, hardware/лимиты, версии, объём данных, профиль нагрузки, concurrency/arrival rate, длительность/прогрев, повторы, успешные RPS, ошибки, p50/p95/p99, CPU/RAM. Сохранить raw summary без tokens и объяснить ограничения измерения.
|
## Методика и результаты трека 2
|
||||||
|
|
||||||
| Воздействие | Что ожидаем | Что наблюдали | Время восстановления / потеря данных |
|
Гипотеза: два окна burn rate вместе с for подавляют четырёхсекундное воздействие и обнаруживают длительное нарушение; сигналы отличают остановленных consumers от SQL contention. API SLO: ≥99% бизнес-запросов без 5xx за 2 min. Ready SLO: ≥95% accepted uploads публикуют ready за ≤5 s, когорта acceptance 2 min с задержкой оценки 5 s. Pending/failed — bad. Все формулы, thresholds и пошаговая диагностика — [RUNBOOK.md](RUNBOOK.md).
|
||||||
| --- | --- | --- | --- |
|
|
||||||
| TODO | TODO | TODO | TODO |
|
|
||||||
|
|
||||||
## Ограничения и следующие шаги
|
Окна ускорены для учебного эксперимента: Fast 15 s/1 min, for 15 s; Slow 30 s/2 min, for 30 s. API burn thresholds 14.4/6 относительно error budget 1%; ready — 6/3 относительно 5%. Это не production 30-дневный SLO. 5 s — локальный проверяемый бюджет fixture при свободных worker; timeout smoke 60 s — отдельная величина.
|
||||||
|
|
||||||
TODO: какие отказы выдерживаются и какие нет; что не реализовано; где учебное упрощение; какое улучшение подтверждено, а какое пока гипотеза.
|
В каждом повторе отдельные синтетические пользователи/чат. Шесть message threads с периодом 3 s, сдвиг старта 0.5 s: цель 2 POST/s. Если запрос дольше периода, клиент не накапливает неограниченную очередь; offered rate зависит от latency. Для worker-домена дополнительно один upload thread раз в 2 s: PNG 320×200, 111817 bytes. Каждый accepted ID после серии проверяется ready. Retry POST нет. Это не тест максимального throughput и не исправляет coordinated omission.
|
||||||
|
|
||||||
|
Текст сообщения — 21 ASCII byte, JSON body — 33 bytes; в четырёх сериях подтверждены 1752 сообщения, 304 HTTP-отказа при контролируемой блокировке и ноль сетевых ошибок. Принято 258 файлов (28 848 786 исходных bytes, без HTTP headers), все отдельно найдены ready. В когортах прогрева worker принято 37 файлов: p50 0.347 s, p95 0.475 s; один файл пересёк начало fault, p99 5.758 s. Это подтверждает разумный запас локального бюджета 5 s для 95% нормального профиля, но не даёт production SLA. API 99% — выбранная учебная policy с budget 1%, а не статистически доказанная доступность при любых отказах.
|
||||||
|
|
||||||
|
Фазы: 35 s прогрева, краткое воздействие 4 s, 40 s наблюдения, длительное 75 s, 100 s восстановления. SQL fault — отдельная транзакция с ACCESS EXCLUSIVE lock только messages; lock_timeout API 2 s, readiness SELECT доступен. Fault backend application_name=lab6-fault-lock, верхний предел pg_sleep 180 s, завершение адресное. Worker fault — остановка двух собственных контейнеров и запуск тех же ID. Каждый домен повторяется дважды. Реальные границы фаз и duration команд сохранены, идеальное расписание не подставляется вместо измерений.
|
||||||
|
|
||||||
|
Successful RPS и p50/p95/p99 вычисляются только по успешным сообщениям; ошибки HTTP/сети сохранены отдельно. CPU% (100%=1 CPU), cgroup memory — редкие snapshots, не точный RSS и не гарантированный пик. Detection — первое наблюдённое firing после начала воздействия, resolved — первое отсутствие firing после восстановления; sampling запросов добавляет несколько секунд дискретизации. Отсутствие alert в active list считается локальным resolved; внешняя доставка не нужна.
|
||||||
|
|
||||||
|
<!-- RESULTS BEGIN -->
|
||||||
|
|
||||||
|
| Домен / повтор | Alert | Detection, s | Resolved после restore, s | Firing samples в контроле/всплеске |
|
||||||
|
|---|---|---:|---:|---:|
|
||||||
|
| db / 1 | APIBurnFast | 34.25 | 24.87 | 0 |
|
||||||
|
| db / 1 | APIBurnSlow | 46.43 | 42.61 | 0 |
|
||||||
|
| db / 2 | APIBurnFast | 37.90 | 22.45 | 0 |
|
||||||
|
| db / 2 | APIBurnSlow | 53.15 | 37.67 | 0 |
|
||||||
|
| worker / 1 | ReadyBurnFast | 47.26 | 29.54 | 0 |
|
||||||
|
| worker / 1 | ReadyBurnSlow | 56.27 | 41.71 | 0 |
|
||||||
|
| worker / 2 | ReadyBurnFast | 48.06 | 29.12 | 0 |
|
||||||
|
| worker / 2 | ReadyBurnSlow | 60.24 | 44.52 | 0 |
|
||||||
|
|
||||||
|
| Домен / повтор / фаза | Успешно / ошибок | Successful RPS | p50 / p95 / p99 успешных, ms |
|
||||||
|
|---|---:|---:|---|
|
||||||
|
| db / 1 / warmup | 71 / 0 | 2.000 | 24.29 / 35.45 / 94.13 |
|
||||||
|
| db / 1 / brief | 4 / 5 | 0.911 | 587.72 / 1584.18 / 1584.18 |
|
||||||
|
| db / 1 / brief_recovery | 80 / 0 | 1.975 | 15.41 / 34.74 / 73.91 |
|
||||||
|
| db / 1 / sustained | 4 / 147 | 0.053 | 718.40 / 1667.39 / 1667.39 |
|
||||||
|
| db / 1 / recovery | 200 / 0 | 2.000 | 46.39 / 87.16 / 106.44 |
|
||||||
|
| db / 2 / warmup | 71 / 0 | 2.000 | 56.02 / 86.91 / 98.69 |
|
||||||
|
| db / 2 / brief | 4 / 5 | 0.904 | 602.96 / 1617.47 / 1617.47 |
|
||||||
|
| db / 2 / brief_recovery | 80 / 0 | 1.975 | 45.89 / 81.36 / 103.57 |
|
||||||
|
| db / 2 / sustained | 4 / 147 | 0.053 | 721.87 / 1722.02 / 1722.02 |
|
||||||
|
| db / 2 / recovery | 200 / 0 | 1.979 | 38.53 / 82.10 / 126.41 |
|
||||||
|
| worker / 1 / warmup | 73 / 0 | 2.015 | 35.22 / 80.82 / 93.79 |
|
||||||
|
| worker / 1 / brief | 10 / 0 | 2.033 | 32.91 / 102.72 / 102.72 |
|
||||||
|
| worker / 1 / brief_recovery | 82 / 0 | 1.977 | 38.94 / 72.20 / 93.37 |
|
||||||
|
| worker / 1 / sustained | 152 / 0 | 1.997 | 28.73 / 86.48 / 107.05 |
|
||||||
|
| worker / 1 / recovery | 200 / 0 | 1.959 | 26.15 / 64.13 / 88.88 |
|
||||||
|
| worker / 2 / warmup | 73 / 0 | 2.016 | 20.96 / 34.77 / 75.24 |
|
||||||
|
| worker / 2 / brief | 10 / 0 | 2.014 | 14.38 / 64.67 / 64.67 |
|
||||||
|
| worker / 2 / brief_recovery | 82 / 0 | 1.979 | 22.29 / 34.63 / 88.24 |
|
||||||
|
| worker / 2 / sustained | 152 / 0 | 1.994 | 23.34 / 35.17 / 75.37 |
|
||||||
|
| worker / 2 / recovery | 200 / 0 | 1.964 | 23.70 / 40.03 / 81.73 |
|
||||||
|
|
||||||
|
Максимум суммы редких snapshots: CPU **241.0%**, cgroup memory **1754.1 MiB**. Это не непрерывно измеренные пики.
|
||||||
|
|
||||||
|
За worker-серии принято и отдельно найдено ready **258** вложений.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
CSV агрегатов: `evidence/slo-alerts.csv`, `evidence/slo-performance.csv`. Красная область — фактическое воздействие с плановой длительностью, точки и линии — измеренные ответы/сигналы.
|
||||||
|
|
||||||
|
В измеренном контроле и кратких всплесках оцениваются только наблюдённые firing samples; это не статистическая оценка production false-positive rate. Подробные фазы/ошибки/снимки находятся в исходных JSON.
|
||||||
|
|
||||||
|
| Worker повтор | Ready / ошибок upload | Completed images/s | p50 / p95 / p99 ready, s | ≤5 s |
|
||||||
|
|---|---:|---:|---|---:|
|
||||||
|
| 1 | 129 / 0 | 0.493 | 0.40 / 66.15 / 75.68 | 89 |
|
||||||
|
| 2 | 129 / 0 | 0.493 | 0.38 / 66.14 / 75.79 | 89 |
|
||||||
|
|
||||||
|
<!-- RESULTS END -->
|
||||||
|
|
||||||
|
Пересчёт таблиц использует фактические границы фаз и время завершения HTTP-ответов; исходная группировка по стартовой фазе/плановому периоду также сохранена в JSON. Ready latency дополнительно вычисляется по DB timestamps created_at/updated_at для всех принятых в серии вложений; это DB-граница публикации, а не polling latency клиента. Для графиков/агрегатов:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
.venv/Scripts/python -m pip install -r requirements-research.lock.txt
|
||||||
|
python -X utf8 scripts/summarize.py
|
||||||
|
.venv/Scripts/python -X utf8 scripts/plot_results.py
|
||||||
|
.venv/Scripts/python -X utf8 -m unittest discover -s student-tests -p test_images.py
|
||||||
|
```
|
||||||
|
|
||||||
|
В проверенном профиле гипотеза поддержана: multi-window burn alerts подавили краткие всплески, обнаружили длительные нарушения и перешли в resolved. Для диагноза пригодны разные сигналы: SQL spans локализовали contention, возраст backlog и отсутствие consumers — остановку worker. Runbook сопоставлен с этими сохранёнными наблюдениями; независимая проверка другим человеком не выполнялась. Пересоздание telemetry-хранилищ проверяет штатный stop/recreate с volumes, а не потерю питания.
|
||||||
|
|
||||||
|
В завершение подтверждены 17 provisioned panels / 19 действительных PromQL-запросов в Grafana (`evidence/final-ui-and-isolation.json`). Чистый экспорт commit a5c650b прошёл build (2.84 s, с доступным Docker cache), bootstrap/up (31.88 s), readiness (33.49 s), smoke (2.97 s) и сигналы (10.12 s). Это проверка чистого исходного Git-экспорта, не полностью пустого Docker cache. Отдельные images/volumes/network/containers/temp directory удалены; проверки отсутствия — `evidence/cleanup.json`.
|
||||||
|
|
||||||
|
## Отклонения и границы проверенной модели
|
||||||
|
|
||||||
|
Первый retry experiment не воспроизвёл отказ: Compose start worker также запускал S3. Исправлен собственный driver, запускающий только выбранные IDs. Далее strict public Client остановился на переходных API/LB 503 после восстановления S3. Собственный GET polling теперь сохраняет эти ответы с источником API/LB и конечным deadline; public tests не менялись. Первичные неуспешные прогоны сохранены в incidents-*-run.txt и не считаются PASS.
|
||||||
|
|
||||||
|
API SLI охватывает запросы, дошедшие до SDK, не отказ LB/host и не его собственные 503. Поэтому в исследовании используется SQL lock, а не полное отключение БД; для end-to-end availability нужен внешний probe/метрики LB. Ready histogram содержит только завершённые операции, поэтому SLO дополнен всеми accepted cohorts. Без новых поступлений burn alerts не заменяют QueueLag. Один файл сильно меняет ratio малой когорты; 4xx не считаются отказом сервиса.
|
||||||
|
|
||||||
|
Исходники/Git №4 и №5 имеют прежние commits и чистый status. Их контейнеры/образы/настройки/данные командами управления не адресовались. Read-only аудит обнаружил, что четыре существующих background containers №5 сохраняют ID, но самостоятельно перезапускаются: unless-stopped, RestartCount около 100, в логах PoolTimeout при старой остановленной БД. Это согласуется с существующей restart policy после запуска общего Docker engine. **Постоянство StartedAt предыдущего стенда не заявляется**; его работу не исправляли и не останавливали. Наблюдения — `evidence/previous-runtime-observation.json`.
|
||||||
|
|
||||||
|
Проверены локальные процессные отказы с сохранёнными volumes. Потеря диска/host, multi-node HA, длительный soak и статистически надёжная частота редких false positives не проверены. 100% sampling и 24 h retention выбраны для небольшой учебной нагрузки; долгосрочная ёмкость ingest/disk не исследована. History растёт в ходе профиля; health/background/check traffic также есть в telemetry. Нет утверждений о максимуме производительности или промышленном SLA.
|
||||||
|
|
||||||
|
## Источники и ИИ
|
||||||
|
|
||||||
|
- README/COURSE/contracts/tests текущей №6; собственные исходники №5, без переноса измерений.
|
||||||
|
- [Collector configuration](https://opentelemetry.io/docs/collector/configuration/), [Python log pipeline](https://opentelemetry-python.readthedocs.io/en/latest/sdk/_logs.export.html), [W3C Trace Context](https://www.w3.org/TR/trace-context/).
|
||||||
|
- [Prometheus histograms](https://prometheus.io/docs/practices/histograms/), [Loki structured metadata](https://grafana.com/docs/loki/latest/get-started/labels/structured-metadata/), [Loki schema](https://grafana.com/docs/loki/latest/operations/storage/schema/).
|
||||||
|
- [Tempo configuration](https://grafana.com/docs/tempo/latest/configuration/), [Grafana Tempo datasource](https://grafana.com/docs/grafana/latest/datasources/tempo/configure-tempo-data-source/).
|
||||||
|
- [MinIO pinned source](https://github.com/minio/minio/tree/07c3a429bfed433e49018cb0f78a52145d4bedeb), [mc release](https://github.com/minio/mc/tree/RELEASE.2025-04-16T18-13-26Z).
|
||||||
|
|
||||||
|
Codex использован для анализа, переноса, инструментации/инфраструктуры, проверок, экспериментов и отчёта. PASS относится только к выполненным командам и сохранённым наблюдениям. Автор должен понимать код и воспроизводить диагностику на защите.
|
||||||
|
|||||||
+35
@@ -0,0 +1,35 @@
|
|||||||
|
# Диагностика мессенджера №6
|
||||||
|
|
||||||
|
Стенд с синтетическими данными: API `http://127.0.0.1:8086`, Grafana `http://127.0.0.1:3006/d/messenger-lab6`. В Grafana доступен анонимный Viewer, административный пароль находится только в `secrets/grafana_password`. Внутренние порты хранилищ не публикуются. Время в сохранённых сигналах — UTC, в графиках эксперимента — секунды от начала.
|
||||||
|
|
||||||
|
Начните с dashboard, выберите интервал инцидента. В Explore доступны Prometheus, Loki, Tempo. Не начинайте с Docker logs: сначала запишите гипотезу по сохранённым сигналам, затем проверьте её состоянием контейнеров в `evidence/`.
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
1. Проверьте долю отказов: `sum(rate(messenger_http_requests_total{status_class="5xx"}[30s])) / clamp_min(sum(rate(messenger_http_requests_total[30s])),0.001)`. Это бизнес-запросы, health исключён. 4xx не расходуют бюджет доступности.
|
||||||
|
2. Разложите duration по `route`, а также `messenger_db_pool_used` и `messenger_db_pool_waiting`. Счётчики показывают запросы, duration histogram — секунды. Высокая занятость pool и медленные/ошибочные SQL spans указывают на БД; медленный server span без медленного DB/S3 child требует проверки самого handler.
|
||||||
|
3. Найдите ошибки в Loki: `{service_name="messenger-api"} |= "http.completed" | json | status >= 500`. Из JSON возьмите `trace_id`, откройте его в Tempo. HTTP-клиент также получает `X-Trace-Id`; `X-Request-Id` связывает ошибку и лог.
|
||||||
|
4. Для исследованной блокировки таблицы messages ожидаются ошибочные SQL spans около двух секунд, server 503 и насыщение pool. Сравните с `evidence/incidents.json`: диагноз не должен опираться только на сам факт HTTP 503.
|
||||||
|
5. После устранения причины проверьте новые успешные сообщения, падение error ratio, отсутствие соответствующего alert в `/api/v1/alerts`. Resolved здесь означает исчезновение активного экземпляра alert; наружная доставка не настроена.
|
||||||
|
|
||||||
|
## Ready
|
||||||
|
|
||||||
|
1. Сравните `messenger_queue_depth` и `messenger_queue_oldest_seconds`. Это все незавершённые durable jobs из PostgreSQL, включая outbox/processing, а не только ready-сообщения RabbitMQ. Старейший возраст — секунды, глубина — jobs.
|
||||||
|
2. Проверьте `messenger_worker_busy` / `messenger_worker_capacity` и свежесть рядов. При остановке worker последний gauge может некоторое время оставаться в scrape: отсутствие свежих `job.processed` и рост backlog существеннее старого нуля busy.
|
||||||
|
3. В Loki: `{service_name="messenger-worker"} |= "job.processed" | json`. `outcome=retry` при живых worker требует просмотра S3/DB child spans. Отсутствие consumer spans и логов при продолжающихся `job.published` указывает на неработающих consumers.
|
||||||
|
4. Возьмите trace ID upload и найдите `attachment.publish` → `attachment.consume` → `attachment.transform_and_publish`, S3 и SQL. Повторы — новые producer/consumer spans в том же trace, с номером управляемой попытки в логе. Дубликат может дать `job.duplicate`, не новый результат.
|
||||||
|
5. Восстановите только соответствующие контейнеры №6. В тестах используется `docker start` по ID, найденным через `docker compose -p lyakhonov-lab6 ps -aq worker`: Compose 2.40 может при `start worker` также запустить зависимости и преждевременно снять отдельный отказ S3.
|
||||||
|
6. Проверьте уменьшение backlog до нуля, ready для каждого принятого ID и доступность всех вариантов, затем resolved QueueLag/ReadyBurn. Один HTTP 202 этого не доказывает.
|
||||||
|
|
||||||
|
## Telemetry backend
|
||||||
|
|
||||||
|
Если бизнес-ошибок нет, а trace отсутствует, проверьте `otelcol_exporter_queue_size`, `otelcol_exporter_send_failed_spans_total` и доступность Tempo. Не диагностируйте отсутствие trace как отсутствие обработки задания. Collector ограничен 256 MiB, memory limiter 160 MiB, очередь каждого OTLP exporter — 128 batch-запросов; после 15 s исчерпываются повторы и часть telemetry теряется. Источник бизнес-истины — PostgreSQL/S3. Grafana и Collector не заменяют эти хранилища.
|
||||||
|
|
||||||
|
## Учебные SLO и burn rate
|
||||||
|
|
||||||
|
- API: ≥99% бизнес HTTP-запросов без 5xx в скользящем окне 2 min. Сетевые ошибки до API этим SLI не покрываются и отдельно считаются генератором.
|
||||||
|
- Pipeline: ≥95% принятых вложений публикуют ready за ≤5 s, по когорте acceptance за 2 min. Когорта становится оцениваемой через 5 s; failed и ещё не ready считаются bad. Это исключает сокрытие зависших jobs в histogram только завершённых операций.
|
||||||
|
- API burn = error ratio / 0.01. Fast: >14.4 одновременно за 15 s и 1 min, `for: 15s`; Slow: >6 за 30 s и 2 min, `for: 30s`.
|
||||||
|
- Ready burn = bad/total / 0.05. Fast: >6 за 15 s и 1 min, `for: 15s`; Slow: >3 за 30 s и 2 min, `for: 30s`.
|
||||||
|
|
||||||
|
Это ускоренная учебная модель, а не перенесённые без обоснования production пороги 30-дневного SLO. 5 s выбраны как проверяемый локальный бюджет для fixture 320×200 при свободных worker; 60 s публичного smoke — отдельный timeout проверки. В малой когорте один файл существенно меняет ratio. При отсутствии новых запросов burn-alert не заменяет uptime probe, при отсутствии новых upload — QueueLag. Нулевой знаменатель не создаёт искусственного нарушения. Два окна и `for` должны подавлять четырёхсекундный всплеск, а длительное нарушение — обнаруживаться; результаты и ограничения см. REPORT.md.
|
||||||
+238
@@ -0,0 +1,238 @@
|
|||||||
|
name: lyakhonov-lab6
|
||||||
|
|
||||||
|
x-app: &app
|
||||||
|
image: ${APP_IMAGE:-lyakhonov-messenger:lab6}
|
||||||
|
environment:
|
||||||
|
OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4318
|
||||||
|
TELEMETRY_ENABLED: ${TELEMETRY_ENABLED:-1}
|
||||||
|
TRACE_SAMPLE_RATIO: ${TRACE_SAMPLE_RATIO:-1}
|
||||||
|
DATABASE_URL_FILE: /run/secrets/database_url
|
||||||
|
S3_ENDPOINT: http://s3:9000
|
||||||
|
S3_ACCESS_KEY_FILE: /run/secrets/s3_access_key
|
||||||
|
S3_SECRET_KEY_FILE: /run/secrets/s3_secret_key
|
||||||
|
SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600}
|
||||||
|
JOB_MAX_ATTEMPTS: ${JOB_MAX_ATTEMPTS:-5}
|
||||||
|
JOB_TIMEOUT_SECONDS: ${JOB_TIMEOUT_SECONDS:-60}
|
||||||
|
JOB_LEASE_SECONDS: ${JOB_LEASE_SECONDS:-90}
|
||||||
|
LAB5_FAULT_INJECTION: ${LAB5_FAULT_INJECTION:-0}
|
||||||
|
STAGING_RETENTION_SECONDS: ${STAGING_RETENTION_SECONDS:-86400}
|
||||||
|
CACHE_URL: redis://redis:6379/0
|
||||||
|
BROKER_URL_FILE: /run/secrets/broker_url
|
||||||
|
secrets: [database_url, s3_access_key, s3_secret_key, broker_url]
|
||||||
|
cpus: 0.5
|
||||||
|
mem_limit: 640m
|
||||||
|
stop_grace_period: 12s
|
||||||
|
|
||||||
|
x-dependencies: &dependencies
|
||||||
|
migrate:
|
||||||
|
condition: service_completed_successfully
|
||||||
|
bucket-init:
|
||||||
|
condition: service_completed_successfully
|
||||||
|
|
||||||
|
services:
|
||||||
|
otel-collector:
|
||||||
|
image: otel/opentelemetry-collector-contrib:0.137.0
|
||||||
|
command: [--config=/etc/otelcol/config.yaml]
|
||||||
|
volumes: [./infra/otel/collector.yaml:/etc/otelcol/config.yaml:ro]
|
||||||
|
cpus: 0.5
|
||||||
|
mem_limit: 256m
|
||||||
|
restart: unless-stopped
|
||||||
|
prometheus:
|
||||||
|
image: prom/prometheus:v3.7.3
|
||||||
|
command: [--config.file=/etc/prometheus/prometheus.yaml, --storage.tsdb.retention.time=24h, --storage.tsdb.retention.size=512MB]
|
||||||
|
volumes: [./infra/otel/prometheus.yaml:/etc/prometheus/prometheus.yaml:ro, ./infra/otel/alerts.yaml:/etc/prometheus/alerts.yaml:ro, metrics_data:/prometheus]
|
||||||
|
cpus: 0.5
|
||||||
|
mem_limit: 384m
|
||||||
|
restart: unless-stopped
|
||||||
|
loki:
|
||||||
|
image: grafana/loki:3.5.7
|
||||||
|
command: [-config.file=/etc/loki/config.yaml]
|
||||||
|
volumes: [./infra/otel/loki.yaml:/etc/loki/config.yaml:ro, logs_data:/loki]
|
||||||
|
cpus: 0.5
|
||||||
|
mem_limit: 384m
|
||||||
|
restart: unless-stopped
|
||||||
|
tempo:
|
||||||
|
image: grafana/tempo:2.9.0
|
||||||
|
command: [-config.file=/etc/tempo.yaml]
|
||||||
|
volumes: [./infra/otel/tempo.yaml:/etc/tempo.yaml:ro, traces_data:/var/tempo]
|
||||||
|
cpus: 0.5
|
||||||
|
mem_limit: 384m
|
||||||
|
restart: unless-stopped
|
||||||
|
grafana:
|
||||||
|
image: grafana/grafana:12.2.1
|
||||||
|
ports: ['127.0.0.1:${GRAFANA_PORT:-3006}:3000']
|
||||||
|
environment:
|
||||||
|
GF_AUTH_ANONYMOUS_ENABLED: 'true'
|
||||||
|
GF_AUTH_ANONYMOUS_ORG_ROLE: Viewer
|
||||||
|
GF_SECURITY_ADMIN_PASSWORD__FILE: /run/secrets/grafana_password
|
||||||
|
GF_USERS_ALLOW_SIGN_UP: 'false'
|
||||||
|
GF_ANALYTICS_REPORTING_ENABLED: 'false'
|
||||||
|
GF_ANALYTICS_CHECK_FOR_UPDATES: 'false'
|
||||||
|
secrets: [grafana_password]
|
||||||
|
volumes: [grafana_data:/var/lib/grafana, ./infra/grafana/provisioning:/etc/grafana/provisioning:ro, ./infra/grafana/dashboards:/var/lib/grafana/dashboards:ro]
|
||||||
|
cpus: 0.5
|
||||||
|
mem_limit: 384m
|
||||||
|
restart: unless-stopped
|
||||||
|
diagnostics:
|
||||||
|
<<: *app
|
||||||
|
command: [python, -m, src.diagnostics]
|
||||||
|
depends_on: *dependencies
|
||||||
|
healthcheck:
|
||||||
|
disable: true
|
||||||
|
cpus: 0.25
|
||||||
|
mem_limit: 128m
|
||||||
|
restart: unless-stopped
|
||||||
|
inspector:
|
||||||
|
<<: *app
|
||||||
|
profiles: [tools]
|
||||||
|
environment:
|
||||||
|
DATABASE_URL_FILE: /run/secrets/database_url
|
||||||
|
S3_ENDPOINT: http://s3:9000
|
||||||
|
S3_ACCESS_KEY_FILE: /run/secrets/s3_root_user
|
||||||
|
S3_SECRET_KEY_FILE: /run/secrets/s3_root_password
|
||||||
|
secrets: [database_url, s3_root_user, s3_root_password]
|
||||||
|
healthcheck:
|
||||||
|
disable: true
|
||||||
|
cpus: 0.25
|
||||||
|
mem_limit: 256m
|
||||||
|
db:
|
||||||
|
image: postgres:16.6-alpine
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: messenger
|
||||||
|
POSTGRES_DB: messenger
|
||||||
|
POSTGRES_PASSWORD_FILE: /run/secrets/db_password
|
||||||
|
secrets: [db_password]
|
||||||
|
volumes: [postgres_data:/var/lib/postgresql/data]
|
||||||
|
healthcheck:
|
||||||
|
test: [CMD-SHELL, 'pg_isready -U messenger -d messenger']
|
||||||
|
interval: 2s
|
||||||
|
timeout: 2s
|
||||||
|
retries: 30
|
||||||
|
cpus: 1.0
|
||||||
|
mem_limit: 512m
|
||||||
|
redis:
|
||||||
|
image: redis:7.4.1-alpine
|
||||||
|
command: [redis-server, --maxmemory, 64mb, --maxmemory-policy, allkeys-lru, --save, "", --appendonly, "no"]
|
||||||
|
cpus: 0.25
|
||||||
|
mem_limit: 128m
|
||||||
|
s3:
|
||||||
|
image: ${S3_IMAGE:-lyakhonov-storage:lab6}
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile.s3
|
||||||
|
command: [server, /data, --console-address, '127.0.0.1:9001']
|
||||||
|
environment:
|
||||||
|
MINIO_ROOT_USER_FILE: /run/secrets/s3_root_user
|
||||||
|
MINIO_ROOT_PASSWORD_FILE: /run/secrets/s3_root_password
|
||||||
|
secrets: [s3_root_user, s3_root_password]
|
||||||
|
volumes: [s3_data:/data]
|
||||||
|
cpus: 1.0
|
||||||
|
mem_limit: 768m
|
||||||
|
bucket-init:
|
||||||
|
image: ${S3_IMAGE:-lyakhonov-storage:lab6}
|
||||||
|
pull_policy: never
|
||||||
|
entrypoint: [/bin/sh, /bootstrap/bucket.sh]
|
||||||
|
secrets: [s3_root_user, s3_root_password, s3_access_key, s3_secret_key]
|
||||||
|
volumes: [./infra/bucket.sh:/bootstrap/bucket.sh:ro, ./infra/s3-policy.json:/bootstrap/policy.json:ro]
|
||||||
|
depends_on: [s3]
|
||||||
|
cpus: 0.25
|
||||||
|
mem_limit: 128m
|
||||||
|
broker:
|
||||||
|
image: rabbitmq:4.1.0-alpine
|
||||||
|
hostname: broker
|
||||||
|
entrypoint: [/bin/sh, /bootstrap/broker.sh]
|
||||||
|
volumes: [broker_data:/var/lib/rabbitmq, ./infra/broker.sh:/bootstrap/broker.sh:ro,
|
||||||
|
./infra/rabbitmq.conf:/etc/rabbitmq/conf.d/90-lab5.conf:ro]
|
||||||
|
secrets: [broker_password]
|
||||||
|
healthcheck:
|
||||||
|
test: [CMD, rabbitmq-diagnostics, -q, ping]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 4s
|
||||||
|
retries: 20
|
||||||
|
cpus: 0.75
|
||||||
|
mem_limit: 512m
|
||||||
|
migrate:
|
||||||
|
<<: *app
|
||||||
|
command: [python, -m, src.migrate]
|
||||||
|
depends_on:
|
||||||
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
healthcheck:
|
||||||
|
disable: true
|
||||||
|
api:
|
||||||
|
<<: *app
|
||||||
|
build: .
|
||||||
|
depends_on: *dependencies
|
||||||
|
deploy:
|
||||||
|
replicas: ${API_REPLICAS:-2}
|
||||||
|
dispatcher:
|
||||||
|
<<: *app
|
||||||
|
command: [python, -m, src.dispatch]
|
||||||
|
restart: unless-stopped
|
||||||
|
depends_on:
|
||||||
|
<<: *dependencies
|
||||||
|
broker:
|
||||||
|
condition: service_healthy
|
||||||
|
healthcheck:
|
||||||
|
disable: true
|
||||||
|
mem_limit: 256m
|
||||||
|
worker:
|
||||||
|
<<: *app
|
||||||
|
command: [python, -m, src.worker]
|
||||||
|
restart: unless-stopped
|
||||||
|
depends_on:
|
||||||
|
<<: *dependencies
|
||||||
|
broker:
|
||||||
|
condition: service_healthy
|
||||||
|
healthcheck:
|
||||||
|
disable: true
|
||||||
|
deploy:
|
||||||
|
replicas: ${WORKER_CONCURRENCY:-2}
|
||||||
|
cpus: 0.75
|
||||||
|
mem_limit: 768m
|
||||||
|
stop_grace_period: 95s
|
||||||
|
staging-cleaner:
|
||||||
|
<<: *app
|
||||||
|
command: [python, -m, src.staging]
|
||||||
|
restart: unless-stopped
|
||||||
|
depends_on: *dependencies
|
||||||
|
healthcheck:
|
||||||
|
disable: true
|
||||||
|
cpus: 0.25
|
||||||
|
mem_limit: 256m
|
||||||
|
lb:
|
||||||
|
image: haproxy:3.0.6-alpine
|
||||||
|
ports: ['127.0.0.1:${LAB6_PORT:-8086}:8080']
|
||||||
|
volumes: [./infra/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro]
|
||||||
|
depends_on: [api]
|
||||||
|
cpus: 0.5
|
||||||
|
mem_limit: 128m
|
||||||
|
stop_grace_period: 12s
|
||||||
|
|
||||||
|
secrets:
|
||||||
|
grafana_password:
|
||||||
|
file: ./secrets/grafana_password
|
||||||
|
s3_root_user:
|
||||||
|
file: ./secrets/s3_root_user
|
||||||
|
s3_root_password:
|
||||||
|
file: ./secrets/s3_root_password
|
||||||
|
s3_access_key:
|
||||||
|
file: ./secrets/s3_access_key
|
||||||
|
s3_secret_key:
|
||||||
|
file: ./secrets/s3_secret_key
|
||||||
|
db_password:
|
||||||
|
file: ./secrets/db_password
|
||||||
|
database_url:
|
||||||
|
file: ./secrets/database_url
|
||||||
|
broker_password:
|
||||||
|
file: ./secrets/broker_password
|
||||||
|
broker_url:
|
||||||
|
file: ./secrets/broker_url
|
||||||
|
volumes:
|
||||||
|
postgres_data:
|
||||||
|
s3_data:
|
||||||
|
broker_data:
|
||||||
|
metrics_data:
|
||||||
|
logs_data:
|
||||||
|
traces_data:
|
||||||
|
grafana_data:
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"protected_count": 37,
|
||||||
|
"changed_originals": [],
|
||||||
|
"forbidden_paths": [],
|
||||||
|
"secret_leaks": [],
|
||||||
|
"commits": [
|
||||||
|
"a5c650bcf50e06af7b3a50a94feb66018b1b6eb3|Sergey Lyakhonov|lyserg119@gmail.com|Sergey Lyakhonov|lyserg119@gmail.com",
|
||||||
|
"0355ba13d2d9625e740323b9a5a51d486ddaef33|Sergey Lyakhonov|lyserg119@gmail.com|Sergey Lyakhonov|lyserg119@gmail.com",
|
||||||
|
"71254d3389dc55d59405189016ecc8d63339c101|Sergey Lyakhonov|lyserg119@gmail.com|Sergey Lyakhonov|lyserg119@gmail.com",
|
||||||
|
"5c3c4a9d0d2fa7793d741ab5a9f892d6bb8b6ceb|Sergey Lyakhonov|lyserg119@gmail.com|Sergey Lyakhonov|lyserg119@gmail.com"
|
||||||
|
],
|
||||||
|
"invalid_identities": [],
|
||||||
|
"previous": {
|
||||||
|
"4": {
|
||||||
|
"head": "8f112e092a10d72a98c3d9d4554c52b81ebff2b3",
|
||||||
|
"status": "",
|
||||||
|
"branch": "solution/BVT2301-lyakhonov"
|
||||||
|
},
|
||||||
|
"5": {
|
||||||
|
"head": "9dd2a03aa72150d2b786fa8271792e242eaea816",
|
||||||
|
"status": "",
|
||||||
|
"branch": "solution/BVT2301-lyakhonov"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"head_at_capture": "a5c650bcf50e06af7b3a50a94feb66018b1b6eb3",
|
||||||
|
"status_at_capture": " M REPORT.md\n M evidence/audit.json\n M evidence/environment.json\n M infra/grafana/dashboards/messenger.json\n M scripts/audit.py\n?? evidence/cleanup.json\n?? evidence/environment-initial.json\n?? evidence/final-ui-and-isolation.json\n?? evidence/previous-runtime-observation.json\n?? evidence/reproduction-run.txt\n?? evidence/reproduction.json\n"
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
PASS: real byte/pixel limits, MIME, filename, semantic replay and sender spoof rejection
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"checks": [
|
||||||
|
{
|
||||||
|
"case": "invalid filename",
|
||||||
|
"status": 400
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"case": "invalid filename",
|
||||||
|
"status": 400
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"case": "invalid filename",
|
||||||
|
"status": 400
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"case": "actual 10 MiB + 1 byte",
|
||||||
|
"status": 413
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"case": "40041001 declared pixels before decode",
|
||||||
|
"status": 413
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"case": "MIME/content mismatch",
|
||||||
|
"status": 415
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"semantic_replay_equal": true,
|
||||||
|
"spoofed_sender_rejected": true
|
||||||
|
}
|
||||||
@@ -0,0 +1,134 @@
|
|||||||
|
#1 [internal] load local bake definitions
|
||||||
|
#1 reading from stdin 991B 0.0s done
|
||||||
|
#1 DONE 0.0s
|
||||||
|
|
||||||
|
#2 [s3 internal] load build definition from Dockerfile.s3
|
||||||
|
#2 DONE 0.0s
|
||||||
|
|
||||||
|
#2 [s3 internal] load build definition from Dockerfile.s3
|
||||||
|
#2 transferring dockerfile: 1.50kB done
|
||||||
|
#2 DONE 0.0s
|
||||||
|
|
||||||
|
#3 [api internal] load build definition from Dockerfile
|
||||||
|
#3 transferring dockerfile: 793B done
|
||||||
|
#3 DONE 0.0s
|
||||||
|
|
||||||
|
#4 [s3 internal] load metadata for docker.io/library/debian:bookworm-20251020-slim@sha256:78d2f66e0fec9e5a39fb2c72ea5e052b548df75602b5215ed01a17171529f706
|
||||||
|
#4 DONE 0.0s
|
||||||
|
|
||||||
|
#5 [s3 internal] load metadata for docker.io/library/golang:1.24.6-bookworm@sha256:ab1d1823abb55a9504d2e3e003b75b36dbeb1cbcc4c92593d85a84ee46becc6c
|
||||||
|
#5 DONE 0.0s
|
||||||
|
|
||||||
|
#6 [api internal] load metadata for docker.io/library/python:3.11.10-slim-bookworm@sha256:840e180ebcc6e5c8efab209c43f5e40fd2af98cb49db5c7103c90539c56bb30e
|
||||||
|
#6 DONE 0.0s
|
||||||
|
|
||||||
|
#7 [api internal] load .dockerignore
|
||||||
|
#7 transferring context: 216B done
|
||||||
|
#7 DONE 0.0s
|
||||||
|
|
||||||
|
#8 [s3 build 3/7] ADD --checksum=sha256:8819e3e7817e46b7b3798f8f200ead208562e571563c2e040352378031abe9f2 https://github.com/minio/minio/archive/07c3a429bfed433e49018cb0f78a52145d4bedeb.tar.gz /tmp/minio.tar.gz
|
||||||
|
#8 DONE 0.0s
|
||||||
|
|
||||||
|
#9 [s3 build 6/7] ADD --checksum=sha256:526ec538e7f83e4bfa631788129b08ec85898ca572ce0523ebf9a597946bea27 https://github.com/minio/mc/archive/refs/tags/RELEASE.2025-04-16T18-13-26Z.tar.gz /tmp/mc.tar.gz
|
||||||
|
#9 DONE 0.0s
|
||||||
|
|
||||||
|
#10 [s3 internal] load build context
|
||||||
|
#10 transferring context: 69B done
|
||||||
|
#10 DONE 0.0s
|
||||||
|
|
||||||
|
#11 [api internal] load build context
|
||||||
|
#11 transferring context: 2.61kB done
|
||||||
|
#11 DONE 0.0s
|
||||||
|
|
||||||
|
#12 [s3 stage-1 1/6] FROM docker.io/library/debian:bookworm-20251020-slim@sha256:78d2f66e0fec9e5a39fb2c72ea5e052b548df75602b5215ed01a17171529f706
|
||||||
|
#12 resolve docker.io/library/debian:bookworm-20251020-slim@sha256:78d2f66e0fec9e5a39fb2c72ea5e052b548df75602b5215ed01a17171529f706 0.0s done
|
||||||
|
#12 DONE 0.0s
|
||||||
|
|
||||||
|
#13 [s3 build 1/7] FROM docker.io/library/golang:1.24.6-bookworm@sha256:ab1d1823abb55a9504d2e3e003b75b36dbeb1cbcc4c92593d85a84ee46becc6c
|
||||||
|
#13 resolve docker.io/library/golang:1.24.6-bookworm@sha256:ab1d1823abb55a9504d2e3e003b75b36dbeb1cbcc4c92593d85a84ee46becc6c
|
||||||
|
#13 resolve docker.io/library/golang:1.24.6-bookworm@sha256:ab1d1823abb55a9504d2e3e003b75b36dbeb1cbcc4c92593d85a84ee46becc6c 0.0s done
|
||||||
|
#13 DONE 0.0s
|
||||||
|
|
||||||
|
#14 [api 1/7] FROM docker.io/library/python:3.11.10-slim-bookworm@sha256:840e180ebcc6e5c8efab209c43f5e40fd2af98cb49db5c7103c90539c56bb30e
|
||||||
|
#14 resolve docker.io/library/python:3.11.10-slim-bookworm@sha256:840e180ebcc6e5c8efab209c43f5e40fd2af98cb49db5c7103c90539c56bb30e 0.0s done
|
||||||
|
#14 DONE 0.0s
|
||||||
|
|
||||||
|
#15 [api 2/7] WORKDIR /app
|
||||||
|
#15 CACHED
|
||||||
|
|
||||||
|
#16 [api 4/7] COPY requirements.lock.txt .
|
||||||
|
#16 CACHED
|
||||||
|
|
||||||
|
#17 [api 6/7] COPY src/ src/
|
||||||
|
#17 CACHED
|
||||||
|
|
||||||
|
#18 [api 5/7] RUN pip install --no-cache-dir -r requirements.lock.txt
|
||||||
|
#18 CACHED
|
||||||
|
|
||||||
|
#19 [api 3/7] RUN groupadd -r appuser && useradd -r -g appuser appuser
|
||||||
|
#19 CACHED
|
||||||
|
|
||||||
|
#20 [api 7/7] COPY migrations/ migrations/
|
||||||
|
#20 CACHED
|
||||||
|
|
||||||
|
#21 [s3 stage-1 3/6] COPY --from=build /build-mc/LICENSE /usr/share/doc/mc/LICENSE
|
||||||
|
#21 CACHED
|
||||||
|
|
||||||
|
#22 [s3 build 2/7] WORKDIR /build
|
||||||
|
#22 CACHED
|
||||||
|
|
||||||
|
#23 [s3 build 3/7] ADD --checksum=sha256:8819e3e7817e46b7b3798f8f200ead208562e571563c2e040352378031abe9f2 https://github.com/minio/minio/archive/07c3a429bfed433e49018cb0f78a52145d4bedeb.tar.gz /tmp/minio.tar.gz
|
||||||
|
#23 CACHED
|
||||||
|
|
||||||
|
#24 [s3 build 7/7] RUN tar -xzf /tmp/mc.tar.gz --strip-components=1 && CGO_ENABLED=0 go build -trimpath -o /out/mc .
|
||||||
|
#24 CACHED
|
||||||
|
|
||||||
|
#25 [s3 build 6/7] ADD --checksum=sha256:526ec538e7f83e4bfa631788129b08ec85898ca572ce0523ebf9a597946bea27 https://github.com/minio/mc/archive/refs/tags/RELEASE.2025-04-16T18-13-26Z.tar.gz /tmp/mc.tar.gz
|
||||||
|
#25 CACHED
|
||||||
|
|
||||||
|
#26 [s3 stage-1 2/6] COPY --from=build /build/LICENSE /usr/share/doc/minio/LICENSE
|
||||||
|
#26 CACHED
|
||||||
|
|
||||||
|
#27 [s3 stage-1 4/6] COPY --from=build /out/minio /out/mc /usr/bin/
|
||||||
|
#27 CACHED
|
||||||
|
|
||||||
|
#28 [s3 build 4/7] RUN tar -xzf /tmp/minio.tar.gz --strip-components=1 && CGO_ENABLED=0 go build -trimpath -o /out/minio .
|
||||||
|
#28 CACHED
|
||||||
|
|
||||||
|
#29 [s3 build 5/7] WORKDIR /build-mc
|
||||||
|
#29 CACHED
|
||||||
|
|
||||||
|
#30 [s3 stage-1 5/6] COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||||
|
#30 CACHED
|
||||||
|
|
||||||
|
#31 [s3 stage-1 6/6] COPY infra/s3-entrypoint.sh /usr/local/bin/s3-entrypoint.sh
|
||||||
|
#31 CACHED
|
||||||
|
|
||||||
|
#32 [s3] exporting to image
|
||||||
|
#32 exporting layers done
|
||||||
|
#32 exporting manifest sha256:da0c72047c3b1a385d32e9f2257e649e3be0f3ca2af5bedd26b21ff4b45b9e02 done
|
||||||
|
#32 exporting config sha256:7b773c24039d6f3f4c2dfef40c6604a3282eb7e17007032d4e6cb2e94a7addf4 done
|
||||||
|
#32 exporting attestation manifest sha256:2658bbc692679adcbafe4e4c9e406bf1e81d4b9fefcc1b058f980963461bef32 0.0s done
|
||||||
|
#32 exporting manifest list sha256:abf4f50d6ffa16b55f0d02beec9f769386363f756aa0a15dc811887c3bdedf3f
|
||||||
|
#32 exporting manifest list sha256:abf4f50d6ffa16b55f0d02beec9f769386363f756aa0a15dc811887c3bdedf3f 0.0s done
|
||||||
|
#32 naming to docker.io/library/lyakhonov-storage:lab6 done
|
||||||
|
#32 unpacking to docker.io/library/lyakhonov-storage:lab6 done
|
||||||
|
#32 DONE 0.1s
|
||||||
|
|
||||||
|
#33 [api] exporting to image
|
||||||
|
#33 exporting layers done
|
||||||
|
#33 exporting manifest sha256:515746115c95803edc90cf7e52ebd8b1145d95b1c7521c2fd6008ddb75ef29b1 done
|
||||||
|
#33 exporting config sha256:599a8cba8e5ee38464f576ff5243f49a4e708d4e30c6de528e06e39597b0db00 done
|
||||||
|
#33 exporting attestation manifest sha256:c3a97f49f1fd3c641d3b483270cfe2943166561787890afbc0c20c4db06df2ff 0.0s done
|
||||||
|
#33 exporting manifest list sha256:29d9e5e544b01f6159bd3c7f0d639862f9027b13f4738dd505d5cb6b6a6c5223 0.0s done
|
||||||
|
#33 naming to docker.io/library/lyakhonov-messenger:lab6 done
|
||||||
|
#33 unpacking to docker.io/library/lyakhonov-messenger:lab6 0.0s done
|
||||||
|
#33 DONE 0.1s
|
||||||
|
|
||||||
|
#34 [api] resolving provenance for metadata file
|
||||||
|
#34 DONE 0.0s
|
||||||
|
|
||||||
|
#35 [s3] resolving provenance for metadata file
|
||||||
|
#35 DONE 0.0s
|
||||||
|
lyakhonov-messenger:lab6 Built
|
||||||
|
lyakhonov-storage:lab6 Built
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
#1 [internal] load local bake definitions
|
||||||
|
#1 reading from stdin 977B 0.0s done
|
||||||
|
#1 DONE 0.0s
|
||||||
|
|
||||||
|
#2 [internal] load build definition from Dockerfile
|
||||||
|
#2 transferring dockerfile: 793B done
|
||||||
|
#2 DONE 0.0s
|
||||||
|
|
||||||
|
#3 [internal] load metadata for docker.io/library/python:3.11.10-slim-bookworm@sha256:840e180ebcc6e5c8efab209c43f5e40fd2af98cb49db5c7103c90539c56bb30e
|
||||||
|
#3 DONE 0.0s
|
||||||
|
|
||||||
|
#4 [internal] load .dockerignore
|
||||||
|
#4 transferring context: 216B done
|
||||||
|
#4 DONE 0.0s
|
||||||
|
|
||||||
|
#5 [internal] load build context
|
||||||
|
#5 transferring context: 5.17kB done
|
||||||
|
#5 DONE 0.0s
|
||||||
|
|
||||||
|
#6 [1/7] FROM docker.io/library/python:3.11.10-slim-bookworm@sha256:840e180ebcc6e5c8efab209c43f5e40fd2af98cb49db5c7103c90539c56bb30e
|
||||||
|
#6 resolve docker.io/library/python:3.11.10-slim-bookworm@sha256:840e180ebcc6e5c8efab209c43f5e40fd2af98cb49db5c7103c90539c56bb30e 0.0s done
|
||||||
|
#6 DONE 0.0s
|
||||||
|
|
||||||
|
#7 [3/7] RUN groupadd -r appuser && useradd -r -g appuser appuser
|
||||||
|
#7 CACHED
|
||||||
|
|
||||||
|
#8 [4/7] COPY requirements.lock.txt .
|
||||||
|
#8 CACHED
|
||||||
|
|
||||||
|
#9 [2/7] WORKDIR /app
|
||||||
|
#9 CACHED
|
||||||
|
|
||||||
|
#10 [5/7] RUN pip install --no-cache-dir -r requirements.lock.txt
|
||||||
|
#10 CACHED
|
||||||
|
|
||||||
|
#11 [6/7] COPY src/ src/
|
||||||
|
#11 DONE 0.0s
|
||||||
|
|
||||||
|
#12 [7/7] COPY migrations/ migrations/
|
||||||
|
#12 DONE 0.0s
|
||||||
|
|
||||||
|
#13 exporting to image
|
||||||
|
#13 exporting layers 0.1s done
|
||||||
|
#13 exporting manifest sha256:6d300cbaaa8fa0ee0c6a34eae2060bf94eec15ae209c88c55b796a40e7bcbd62 done
|
||||||
|
#13 exporting config sha256:49f2494141844ee42fb8122b870ac8928d717022deacecd7636927a2dbc9e584 done
|
||||||
|
#13 exporting attestation manifest sha256:d3b921227615718ff802b3d57a161121c402f98c41ad1c060078c7d6e729af84 0.0s done
|
||||||
|
#13 exporting manifest list sha256:80c3d2e7ef27177eeacbfa64b42e5bb01d3c5b8266b8acf18d78d74de1dd7cc3 0.0s done
|
||||||
|
#13 naming to docker.io/library/lyakhonov-messenger:lab6 done
|
||||||
|
#13 unpacking to docker.io/library/lyakhonov-messenger:lab6 0.0s done
|
||||||
|
#13 DONE 0.3s
|
||||||
|
|
||||||
|
#14 resolving provenance for metadata file
|
||||||
|
#14 DONE 0.0s
|
||||||
|
lyakhonov-messenger:lab6 Built
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
#1 [internal] load local bake definitions
|
||||||
|
#1 reading from stdin 977B 0.0s done
|
||||||
|
#1 DONE 0.0s
|
||||||
|
|
||||||
|
#2 [internal] load build definition from Dockerfile
|
||||||
|
#2 transferring dockerfile: 793B done
|
||||||
|
#2 DONE 0.0s
|
||||||
|
|
||||||
|
#3 [internal] load metadata for docker.io/library/python:3.11.10-slim-bookworm@sha256:840e180ebcc6e5c8efab209c43f5e40fd2af98cb49db5c7103c90539c56bb30e
|
||||||
|
#3 DONE 0.0s
|
||||||
|
|
||||||
|
#4 [internal] load .dockerignore
|
||||||
|
#4 transferring context: 216B done
|
||||||
|
#4 DONE 0.0s
|
||||||
|
|
||||||
|
#5 [1/7] FROM docker.io/library/python:3.11.10-slim-bookworm@sha256:840e180ebcc6e5c8efab209c43f5e40fd2af98cb49db5c7103c90539c56bb30e
|
||||||
|
#5 resolve docker.io/library/python:3.11.10-slim-bookworm@sha256:840e180ebcc6e5c8efab209c43f5e40fd2af98cb49db5c7103c90539c56bb30e 0.0s done
|
||||||
|
#5 DONE 0.0s
|
||||||
|
|
||||||
|
#6 [internal] load build context
|
||||||
|
#6 transferring context: 16.67kB 0.0s done
|
||||||
|
#6 DONE 0.0s
|
||||||
|
|
||||||
|
#7 [2/7] WORKDIR /app
|
||||||
|
#7 CACHED
|
||||||
|
|
||||||
|
#8 [3/7] RUN groupadd -r appuser && useradd -r -g appuser appuser
|
||||||
|
#8 CACHED
|
||||||
|
|
||||||
|
#9 [4/7] COPY requirements.lock.txt .
|
||||||
|
#9 CACHED
|
||||||
|
|
||||||
|
#10 [5/7] RUN pip install --no-cache-dir -r requirements.lock.txt
|
||||||
|
#10 CACHED
|
||||||
|
|
||||||
|
#11 [6/7] COPY src/ src/
|
||||||
|
#11 DONE 0.0s
|
||||||
|
|
||||||
|
#12 [7/7] COPY migrations/ migrations/
|
||||||
|
#12 DONE 0.0s
|
||||||
|
|
||||||
|
#13 exporting to image
|
||||||
|
#13 exporting layers 0.1s done
|
||||||
|
#13 exporting manifest sha256:09b1d28b805673e9765cb6acfc4e475657e8487e8071ba9d37eb1acba9808891 done
|
||||||
|
#13 exporting config sha256:65c54965007123360a6b5448efcf4d54bab4c32108c0e1ed9bb6a80508bcd297
|
||||||
|
#13 exporting config sha256:65c54965007123360a6b5448efcf4d54bab4c32108c0e1ed9bb6a80508bcd297 done
|
||||||
|
#13 exporting attestation manifest sha256:7b024d54ffb3f5baf704efb1e95cb427730dee120d2ca08d1990ef49c8de0b57 0.0s done
|
||||||
|
#13 exporting manifest list sha256:ddd92258cee6757d27b90df9eda6ef841212c785255627edacb700c631a91914 done
|
||||||
|
#13 naming to docker.io/library/lyakhonov-messenger:lab6 done
|
||||||
|
#13 unpacking to docker.io/library/lyakhonov-messenger:lab6 0.0s done
|
||||||
|
#13 DONE 0.2s
|
||||||
|
|
||||||
|
#14 resolving provenance for metadata file
|
||||||
|
#14 DONE 0.0s
|
||||||
|
lyakhonov-messenger:lab6 Built
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
#1 [internal] load local bake definitions
|
||||||
|
#1 reading from stdin 977B 0.0s done
|
||||||
|
#1 DONE 0.0s
|
||||||
|
|
||||||
|
#2 [internal] load build definition from Dockerfile
|
||||||
|
#2 transferring dockerfile: 793B done
|
||||||
|
#2 DONE 0.0s
|
||||||
|
|
||||||
|
#3 [internal] load metadata for docker.io/library/python:3.11.10-slim-bookworm@sha256:840e180ebcc6e5c8efab209c43f5e40fd2af98cb49db5c7103c90539c56bb30e
|
||||||
|
#3 DONE 0.0s
|
||||||
|
|
||||||
|
#4 [internal] load .dockerignore
|
||||||
|
#4 transferring context: 216B done
|
||||||
|
#4 DONE 0.0s
|
||||||
|
|
||||||
|
#5 [internal] load build context
|
||||||
|
#5 transferring context: 4.85kB 0.0s done
|
||||||
|
#5 DONE 0.0s
|
||||||
|
|
||||||
|
#6 [1/7] FROM docker.io/library/python:3.11.10-slim-bookworm@sha256:840e180ebcc6e5c8efab209c43f5e40fd2af98cb49db5c7103c90539c56bb30e
|
||||||
|
#6 resolve docker.io/library/python:3.11.10-slim-bookworm@sha256:840e180ebcc6e5c8efab209c43f5e40fd2af98cb49db5c7103c90539c56bb30e 0.0s done
|
||||||
|
#6 DONE 0.0s
|
||||||
|
|
||||||
|
#7 [3/7] RUN groupadd -r appuser && useradd -r -g appuser appuser
|
||||||
|
#7 CACHED
|
||||||
|
|
||||||
|
#8 [2/7] WORKDIR /app
|
||||||
|
#8 CACHED
|
||||||
|
|
||||||
|
#9 [4/7] COPY requirements.lock.txt .
|
||||||
|
#9 CACHED
|
||||||
|
|
||||||
|
#10 [5/7] RUN pip install --no-cache-dir -r requirements.lock.txt
|
||||||
|
#10 CACHED
|
||||||
|
|
||||||
|
#11 [6/7] COPY src/ src/
|
||||||
|
#11 DONE 0.0s
|
||||||
|
|
||||||
|
#12 [7/7] COPY migrations/ migrations/
|
||||||
|
#12 DONE 0.0s
|
||||||
|
|
||||||
|
#13 exporting to image
|
||||||
|
#13 exporting layers 0.1s done
|
||||||
|
#13 exporting manifest sha256:f4ca2dd2707a03b16b2a3eeaaea40cf05b3d8e7d4d85d0d81a80d2e29b2a0eee 0.0s done
|
||||||
|
#13 exporting config sha256:9b516c6465f770465fbc27687ef8761a0f7a6938f0e1e8811c672e17d588f7ef 0.0s done
|
||||||
|
#13 exporting attestation manifest sha256:8ec4d4d2c678c531ecf1555a8403fccaeddebe9453cec333cda5fe65333e276e 0.0s done
|
||||||
|
#13 exporting manifest list sha256:ebf6ff26f0ed8017a1681bef81a8f9379756e9c8a3b4587008a55c8c511857bf 0.0s done
|
||||||
|
#13 naming to docker.io/library/lyakhonov-messenger:lab6 done
|
||||||
|
#13 unpacking to docker.io/library/lyakhonov-messenger:lab6 0.1s done
|
||||||
|
#13 DONE 0.3s
|
||||||
|
|
||||||
|
#14 resolving provenance for metadata file
|
||||||
|
#14 DONE 0.0s
|
||||||
|
lyakhonov-messenger:lab6 Built
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"project": "lyakhonov-lab6-repro-b2353f38fc",
|
||||||
|
"checks": {
|
||||||
|
"containers_absent": true,
|
||||||
|
"volumes_absent": true,
|
||||||
|
"networks_absent": true,
|
||||||
|
"images_absent": true,
|
||||||
|
"directory_absent": true
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"command": "docker compose pull otel-collector prometheus loki tempo grafana",
|
||||||
|
"exit_code_observed": 0,
|
||||||
|
"original_bytes": 462984,
|
||||||
|
"sha256": "9544ac01620d772ec55d4a8ca2fef9c9f7449f92d0085ecec78eea2e00cc46d2",
|
||||||
|
"summary": [
|
||||||
|
" loki Pulled ",
|
||||||
|
" tempo Pulled ",
|
||||||
|
" prometheus Pulled ",
|
||||||
|
" otel-collector Pulled ",
|
||||||
|
" grafana Pulled "
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": ".venv/Scripts/python -m pip install -r requirements.txt -r requirements-dev.txt",
|
||||||
|
"exit_code_observed": 0,
|
||||||
|
"original_bytes": 19047,
|
||||||
|
"sha256": "3c9d3ef1e1e366c7a732f21c7945be0ebb29708db1aec6bbdf6741c4932e2844",
|
||||||
|
"summary": [
|
||||||
|
"Successfully installed Pillow-12.0.0 annotated-types-0.8.0 anyio-4.16.0 argon2-cffi-23.1.0 argon2-cffi-bindings-26.2.0 attrs-26.1.0 boto3-1.40.61 botocore-1.40.76 certifi-2026.11.20 cffi-2.1.1 charset_normalizer-3.5.3 click-8.5.1 colorama-0.4.6 fastapi-0.115.0 googleapis-common-protos-1.76.0 h11-0.16.0 httptools-0.9.0 idna-3.20 importlib-metadata-8.7.1 jmespath-1.1.0 jsonschema-4.26.0 jsonschema-path-0.3.4 jsonschema-specifications-2025.9.1 lazy-object-proxy-1.13.0 openapi-schema-validator-0.6.3 openapi-spec-validator-0.7.2 opentelemetry-api-1.38.0 opentelemetry-exporter-otlp-proto-common-1.38.0 opentelemetry-exporter-otlp-proto-http-1.38.0 opentelemetry-instrumentation-0.59b0 opentelemetry-instrumentation-botocore-0.59b0 opentelemetry-instrumentation-dbapi-0.59b0 opentelemetry-instrumentation-psycopg-0.59b0 opentelemetry-propagator-aws-xray-1.0.2 opentelemetry-proto-1.38.0 opentelemetry-sdk-1.38.0 opentelemetry-semantic-conventions-0.59b0 packaging-26.4 pathable-0.4.4 pika-1.3.2 protobuf-6.33.6 psycopg-3.2.3 psycopg-binary-3.2.3 psycopg-pool-3.2.4 pycparser-3.12 pydantic-2.9.2 pydantic-core-2.23.4 python-dateutil-2.9.0.post0 python-dotenv-1.2.4 pyyaml-6.0.4 redis-5.2.0 referencing-0.36.2 requests-2.34.2 rfc3339-validator-0.1.4 rpds-py-2026.9.1 s3transfer-0.14.0 six-1.17.0 starlette-0.38.6 typing-extensions-4.16.0 tzdata-2026.6 urllib3-2.8.0 uvicorn-0.32.0 watchfiles-1.3.0 websockets-17.4 wrapt-1.17.3 zipp-4.1.2"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": ".venv/Scripts/python -m pip install -r requirements-research.txt",
|
||||||
|
"exit_code_observed": 0,
|
||||||
|
"original_bytes": 2820,
|
||||||
|
"sha256": "1223b5417383d012c4a58038e355cdc949de34072c15b0c193ac1b9c78930724",
|
||||||
|
"summary": [
|
||||||
|
"Successfully installed contourpy-1.4.0 cycler-0.12.1 fonttools-4.69.1 kiwisolver-1.5.1 matplotlib-3.10.7 numpy-2.5.5 pyparsing-3.3.3"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -0,0 +1,414 @@
|
|||||||
|
{
|
||||||
|
"commit": "71254d3389dc55d59405189016ecc8d63339c101",
|
||||||
|
"whoami": "win-24dt7t3o465\\lyakhonov",
|
||||||
|
"docker_context": "desktop-linux",
|
||||||
|
"docker_version": {
|
||||||
|
"Client": {
|
||||||
|
"Version": "28.5.1",
|
||||||
|
"ApiVersion": "1.51",
|
||||||
|
"DefaultAPIVersion": "1.51",
|
||||||
|
"GitCommit": "e180ab8",
|
||||||
|
"GoVersion": "go1.24.8",
|
||||||
|
"Os": "windows",
|
||||||
|
"Arch": "amd64",
|
||||||
|
"BuildTime": "Wed Oct 8 12:19:16 2025",
|
||||||
|
"Context": "desktop-linux"
|
||||||
|
},
|
||||||
|
"Server": {
|
||||||
|
"Platform": {
|
||||||
|
"Name": "Docker Desktop 4.49.0 (208700)"
|
||||||
|
},
|
||||||
|
"Components": [
|
||||||
|
{
|
||||||
|
"Name": "Engine",
|
||||||
|
"Version": "28.5.1",
|
||||||
|
"Details": {
|
||||||
|
"ApiVersion": "1.51",
|
||||||
|
"Arch": "amd64",
|
||||||
|
"BuildTime": "Wed Oct 8 12:17:24 2025",
|
||||||
|
"Experimental": "false",
|
||||||
|
"GitCommit": "f8215cc",
|
||||||
|
"GoVersion": "go1.24.8",
|
||||||
|
"KernelVersion": "6.6.87.2-microsoft-standard-WSL2",
|
||||||
|
"MinAPIVersion": "1.24",
|
||||||
|
"Os": "linux"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "containerd",
|
||||||
|
"Version": "1.7.27",
|
||||||
|
"Details": {
|
||||||
|
"GitCommit": "05044ec0a9a75232cad458027ca83437aae3f4da"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "runc",
|
||||||
|
"Version": "1.2.5",
|
||||||
|
"Details": {
|
||||||
|
"GitCommit": "v1.2.5-0-g59923ef"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "docker-init",
|
||||||
|
"Version": "0.19.0",
|
||||||
|
"Details": {
|
||||||
|
"GitCommit": "de40ad0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Version": "28.5.1",
|
||||||
|
"ApiVersion": "1.51",
|
||||||
|
"MinAPIVersion": "1.24",
|
||||||
|
"GitCommit": "f8215cc",
|
||||||
|
"GoVersion": "go1.24.8",
|
||||||
|
"Os": "linux",
|
||||||
|
"Arch": "amd64",
|
||||||
|
"KernelVersion": "6.6.87.2-microsoft-standard-WSL2",
|
||||||
|
"BuildTime": "2025-10-08T12:17:24.000000000+00:00"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"docker_resources": "16 CPUs 8126656512 bytes",
|
||||||
|
"compose_version": "Docker Compose version v2.40.3-desktop.1",
|
||||||
|
"containers": [
|
||||||
|
{
|
||||||
|
"id": "c321063cfe0dc6319e0cb3704f3902e5387e8e19f4c7c21b8c89ec54af2e99cb",
|
||||||
|
"service": "api",
|
||||||
|
"started_at": "2026-11-27T13:46:28.716162825Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 671088640,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "c200522d3266343ce6069346b58a6f645a4ed9129fc6be4503e7443b475033b9",
|
||||||
|
"service": "api",
|
||||||
|
"started_at": "2026-11-27T13:46:36.77308908Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 671088640,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "67250f581ff773c0f5daec64696792f6ef7fbbafed2fcc937bcd45edd96d28ad",
|
||||||
|
"service": "broker",
|
||||||
|
"started_at": "2026-11-27T13:45:10.97424342Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 536870912,
|
||||||
|
"nano_cpus": 750000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "a132f04f36935cdb0d11035f589a5cb4e5838538f184e7a32f0dcf6f99e18ef5",
|
||||||
|
"service": "bucket-init",
|
||||||
|
"started_at": "2026-11-27T13:47:27.333872276Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 134217728,
|
||||||
|
"nano_cpus": 250000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "8b2ac7682adccd6538de7c20f623ae01dd138898cc3ff0d3fffa6bd04c5870ae",
|
||||||
|
"service": "db",
|
||||||
|
"started_at": "2026-11-27T13:45:10.139067021Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 536870912,
|
||||||
|
"nano_cpus": 1000000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "c37c4520dde0281588280092f7b3eb0f666cfdc0c907c18071f4c257c608907d",
|
||||||
|
"service": "diagnostics",
|
||||||
|
"started_at": "2026-11-27T13:44:04.371189151Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 134217728,
|
||||||
|
"nano_cpus": 250000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "b01cf07496d8f1d7436aa7d6a13278bb1c6543bc1ed4c1e879aed3675a524f91",
|
||||||
|
"service": "dispatcher",
|
||||||
|
"started_at": "2026-11-27T13:45:10.274744107Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 268435456,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "fe879ab1e1e5a4d7761a03ab03e08aa614cf3194555d3362ba5a54a8e1ec8eba",
|
||||||
|
"service": "grafana",
|
||||||
|
"started_at": "2026-11-27T13:41:04.086803753Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 402653184,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "7eead7f9124d5e42bad9d977aeeaf851f52075586b23462e94b81e64c4a13525",
|
||||||
|
"service": "lb",
|
||||||
|
"started_at": "2026-11-27T13:45:09.878536759Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 134217728,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "d7eaf54f7dfa6ce43ca84e7630c357ba834d13826a07f1656d532bbd1aa8133d",
|
||||||
|
"service": "loki",
|
||||||
|
"started_at": "2026-11-27T13:41:03.943038494Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 402653184,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "3460fb4f99e34f2afc8cebf95563f121bd458fb983bacc35a2fb694d5580770b",
|
||||||
|
"service": "migrate",
|
||||||
|
"started_at": "2026-11-27T13:47:27.835587689Z",
|
||||||
|
"status": "exited",
|
||||||
|
"memory_limit": 671088640,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "eb8394f106efd30c4ef99094c79301d866a8533050b8eacf28e0e08099331302",
|
||||||
|
"service": "otel-collector",
|
||||||
|
"started_at": "2026-11-27T13:41:03.918588049Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 268435456,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "888ff5ffe6db73757cc652ce5376c3c9a78df120683edf2be120c17e7967e058",
|
||||||
|
"service": "prometheus",
|
||||||
|
"started_at": "2026-11-27T13:44:07.268964594Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 402653184,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "db034935279f969cd150b4fbe32817cf1ae334820e5e5e9d1cd7e7939bcf8dbb",
|
||||||
|
"service": "redis",
|
||||||
|
"started_at": "2026-11-27T13:45:09.601677028Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 134217728,
|
||||||
|
"nano_cpus": 250000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "c24794f0b24a27553c978dfd55459a02784da6f637ef8c69b12b4b9cb8cac555",
|
||||||
|
"service": "s3",
|
||||||
|
"started_at": "2026-11-27T13:45:09.53213622Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 805306368,
|
||||||
|
"nano_cpus": 1000000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "121813ef2b200ce213610c1d4d3d3c35af5203e8fe586bc070a231e51e01be81",
|
||||||
|
"service": "staging-cleaner",
|
||||||
|
"started_at": "2026-11-27T13:45:10.571681425Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 268435456,
|
||||||
|
"nano_cpus": 250000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "d89bc7eca7813a5b8eff9c5c37497bf7feb0c1ad7251797d0f99af5f9eee2337",
|
||||||
|
"service": "tempo",
|
||||||
|
"started_at": "2026-11-27T13:41:04.011042724Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 402653184,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "8f4bf0c0b97760df71ab60ecddb180a9a3aedca3a445c14c8925a1e0e613d818",
|
||||||
|
"service": "worker",
|
||||||
|
"started_at": "2026-11-27T13:45:10.016773257Z",
|
||||||
|
"status": "exited",
|
||||||
|
"memory_limit": 805306368,
|
||||||
|
"nano_cpus": 750000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "ca6de9150e29d58d0d60768e3ebaec6e6ed7fe56a0f1650dff31d8681870d266",
|
||||||
|
"service": "worker",
|
||||||
|
"started_at": "2026-11-27T13:45:10.503836556Z",
|
||||||
|
"status": "exited",
|
||||||
|
"memory_limit": 805306368,
|
||||||
|
"nano_cpus": 750000000
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"other_containers": [
|
||||||
|
{
|
||||||
|
"id": "e36e30c0bc23ffdc3c2c4fe39b57ea98597764dfa313c509bd1734d74b801b44",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-27T13:46:55.696081044Z",
|
||||||
|
"state": "running"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "b3f8a331a59832dde80002af9f29c5893381e780803283476c687168ede15842",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-20T04:00:04.137137202Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "1f724278797561aea476251a8902eac6377039c3e30cbc336d501409af118ae2",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-27T13:47:08.572881915Z",
|
||||||
|
"state": "running"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "bdedd08309bb0db9dc94235a148fc0938180449b1431059178488d0c6f985049",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-27T13:46:52.646440477Z",
|
||||||
|
"state": "running"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "23b814fb71a813bedb09712be57c736e19460c2c25d2b2b4b0e66facb0bfdab9",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-27T13:47:17.724596809Z",
|
||||||
|
"state": "running"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "a0acb99b68a1f803792742460827528137ac3ab96ec76a68de550f930a4a9368",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-20T04:00:23.843924506Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "39b8b11f3c7c9e1c3fb778e780dc8d123e4b955669ddee8c85420eefcb3abaca",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-20T03:59:01.96581278Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "934fcb61b954722ec6f9d3ce84d3399f5a35a30e8368e0ed44a939319ea9ff4f",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-20T03:58:30.862509137Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "fdca00783fcb86e75d3ec4c84494d1571548333d585459191b78992f707729ad",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-20T03:59:01.428198308Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "10408d41f3b50b0a5e8ad4e21b849fa97548c03f4a535b27c8c919163b9c30b2",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-20T03:58:30.504381937Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "b94a25ac1bb3df998e3d0c27beae4b97d655bbc0a7ae520bd60c736cd40462c9",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-20T03:58:31.88055044Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "c3962c31749b802835f909ce1b4efbe34149e88d9bc678ca3b82f9fdbcc97af1",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-20T03:58:30.614258194Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "0b09dce985685e130ed8774a277a3ff254e8a633ff1dfeed7fd2daf80b78c4e8",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-20T03:58:31.091098179Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "99f4403277a732ba8c6512634bdecbce168705cdfdf9edf83420133109647544",
|
||||||
|
"project": "lyakhonov-lab4",
|
||||||
|
"started_at": "2026-10-30T14:46:59.269605492Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "7523f15dc398abffadfc62383a4976e33e0f25220ecb983d059002bd1ac9563b",
|
||||||
|
"project": "lyakhonov-lab4",
|
||||||
|
"started_at": "2026-10-30T14:49:08.477185174Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "af9f952b1304310adb0cfd0620293050d2b1eb3a4e4b7395bd41d41df7730016",
|
||||||
|
"project": "lyakhonov-lab4",
|
||||||
|
"started_at": "2026-10-30T14:46:59.471200143Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "07a9b492d60425b059661cfa7075640b85bd6f5c18831e2b3eb448166b29a7ee",
|
||||||
|
"project": "lyakhonov-lab4",
|
||||||
|
"started_at": "2026-10-30T14:49:07.055892766Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "5d273b8dcb0cc6f4acfe44b78f189e2168eeb212103db0f18dcd5f6fbd3b3134",
|
||||||
|
"project": "lyakhonov-lab4",
|
||||||
|
"started_at": "2026-10-30T14:49:07.517707083Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "a6482b44d70a2031a2563b1b72d955435125453a48e95087464775c918801941",
|
||||||
|
"project": "lyakhonov-lab4",
|
||||||
|
"started_at": "2026-10-30T14:45:43.938532131Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "e9682a892ad30d5becf1fda8abbc16770aed81f261b0843f9cb047b5085baf76",
|
||||||
|
"project": "lyakhonov-lab4",
|
||||||
|
"started_at": "2026-10-30T14:45:44.017393725Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "10138b5c0beefe8a15a6679fdad81ddac663eea21e8f63bf3ca03545c2558f20",
|
||||||
|
"project": "lyakhonov-lab4",
|
||||||
|
"started_at": "2026-10-30T14:45:44.07685361Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "68997bbba33bdd4bed3093f2f7c127856cba5237c46511aad9a35945bdcf535f",
|
||||||
|
"project": "lyakhonov-lab4",
|
||||||
|
"started_at": "2026-10-30T14:45:43.846575438Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "83b50e889353134bf5f1d215a2bc66e8f921a2de8957f3cb176cea255035f17f",
|
||||||
|
"project": "lyakhonov-lab3",
|
||||||
|
"started_at": "2026-10-23T16:13:46.65851457Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "1ff12291d9d61efbb3795aab208fdadff718cb7f6470b4c1094ee76f9acf2924",
|
||||||
|
"project": "lyakhonov-lab3",
|
||||||
|
"started_at": "2026-10-23T16:13:47.058554979Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "1031c94e3574d1843bb615df3426f8769100f54cd862018bb597d54d2401387b",
|
||||||
|
"project": "lyakhonov-lab3",
|
||||||
|
"started_at": "2026-10-23T16:07:54.077571177Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "4577101bc498d9f217ad682ab8af2a4688f7772287a1755eab603ecc946ce2b7",
|
||||||
|
"project": "lyakhonov-lab3",
|
||||||
|
"started_at": "2026-10-23T16:08:02.041383013Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "f2cdcc232751e2c2400763e935897851aca1399824ed751ec96a51180282a207",
|
||||||
|
"project": "lyakhonov-lab3",
|
||||||
|
"started_at": "2026-10-23T16:08:02.306518292Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "889db8e55eb20c99fbe462f3d407763760cc40f0a053b144dcb9f6d13f6255c8",
|
||||||
|
"project": "lyakhonov-lab3",
|
||||||
|
"started_at": "2026-10-23T16:08:02.163804371Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "1d0681eaf75f9c0ed9e48f2529ab671d72b528c4a621e44b68199b1437387d7c",
|
||||||
|
"project": "lyakhonov-lab2",
|
||||||
|
"started_at": "2026-10-09T11:26:57.052800221Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "8bf3b717f757d92d742f440ee37fa2f7a304ca0b21912dcb5e02b9a7d9505a93",
|
||||||
|
"project": "lyakhonov-lab2",
|
||||||
|
"started_at": "2026-10-09T11:25:00.307001994Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "92075e2bbf03ab04a43dccc4b171554af2781687127bd343453182cdcf3fb0ec",
|
||||||
|
"project": "lyakhonov-lab2",
|
||||||
|
"started_at": "2026-10-09T11:25:00.409548723Z",
|
||||||
|
"state": "exited"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,473 @@
|
|||||||
|
{
|
||||||
|
"commit": "a5c650bcf50e06af7b3a50a94feb66018b1b6eb3",
|
||||||
|
"whoami": "win-24dt7t3o465\\lyakhonov",
|
||||||
|
"application_commit": "a5c650bcf50e06af7b3a50a94feb66018b1b6eb3",
|
||||||
|
"local_python": "3.13.7 (tags/v3.13.7:bcee1c3, Aug 14 2025, 14:15:11) [MSC v.1944 64 bit (AMD64)]",
|
||||||
|
"docker_context": "desktop-linux",
|
||||||
|
"docker_version": {
|
||||||
|
"Client": {
|
||||||
|
"Version": "28.5.1",
|
||||||
|
"ApiVersion": "1.51",
|
||||||
|
"DefaultAPIVersion": "1.51",
|
||||||
|
"GitCommit": "e180ab8",
|
||||||
|
"GoVersion": "go1.24.8",
|
||||||
|
"Os": "windows",
|
||||||
|
"Arch": "amd64",
|
||||||
|
"BuildTime": "Wed Oct 8 12:19:16 2025",
|
||||||
|
"Context": "desktop-linux"
|
||||||
|
},
|
||||||
|
"Server": {
|
||||||
|
"Platform": {
|
||||||
|
"Name": "Docker Desktop 4.49.0 (208700)"
|
||||||
|
},
|
||||||
|
"Components": [
|
||||||
|
{
|
||||||
|
"Name": "Engine",
|
||||||
|
"Version": "28.5.1",
|
||||||
|
"Details": {
|
||||||
|
"ApiVersion": "1.51",
|
||||||
|
"Arch": "amd64",
|
||||||
|
"BuildTime": "Wed Oct 8 12:17:24 2025",
|
||||||
|
"Experimental": "false",
|
||||||
|
"GitCommit": "f8215cc",
|
||||||
|
"GoVersion": "go1.24.8",
|
||||||
|
"KernelVersion": "6.6.87.2-microsoft-standard-WSL2",
|
||||||
|
"MinAPIVersion": "1.24",
|
||||||
|
"Os": "linux"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "containerd",
|
||||||
|
"Version": "1.7.27",
|
||||||
|
"Details": {
|
||||||
|
"GitCommit": "05044ec0a9a75232cad458027ca83437aae3f4da"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "runc",
|
||||||
|
"Version": "1.2.5",
|
||||||
|
"Details": {
|
||||||
|
"GitCommit": "v1.2.5-0-g59923ef"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "docker-init",
|
||||||
|
"Version": "0.19.0",
|
||||||
|
"Details": {
|
||||||
|
"GitCommit": "de40ad0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Version": "28.5.1",
|
||||||
|
"ApiVersion": "1.51",
|
||||||
|
"MinAPIVersion": "1.24",
|
||||||
|
"GitCommit": "f8215cc",
|
||||||
|
"GoVersion": "go1.24.8",
|
||||||
|
"Os": "linux",
|
||||||
|
"Arch": "amd64",
|
||||||
|
"KernelVersion": "6.6.87.2-microsoft-standard-WSL2",
|
||||||
|
"BuildTime": "2025-10-08T12:17:24.000000000+00:00"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"docker_resources": "16 CPUs 8126656512 bytes",
|
||||||
|
"compose_version": "Docker Compose version v2.40.3-desktop.1",
|
||||||
|
"containers": [
|
||||||
|
{
|
||||||
|
"id": "dcce0dbef9da4b5ae16773ca933c2c1a4a1b4e22c9129590a9892768c8b61bb1",
|
||||||
|
"service": "api",
|
||||||
|
"image_id": "sha256:80c3d2e7ef27177eeacbfa64b42e5bb01d3c5b8266b8acf18d78d74de1dd7cc3",
|
||||||
|
"image_name": "lyakhonov-messenger:lab6",
|
||||||
|
"started_at": "2026-11-27T14:19:26.186664939Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 671088640,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "6a2cdd955eadc952ad264062d81aedd7610e13af7f7c984486f92510a1db9a50",
|
||||||
|
"service": "api",
|
||||||
|
"image_id": "sha256:80c3d2e7ef27177eeacbfa64b42e5bb01d3c5b8266b8acf18d78d74de1dd7cc3",
|
||||||
|
"image_name": "lyakhonov-messenger:lab6",
|
||||||
|
"started_at": "2026-11-27T14:19:26.448287382Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 671088640,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "67250f581ff773c0f5daec64696792f6ef7fbbafed2fcc937bcd45edd96d28ad",
|
||||||
|
"service": "broker",
|
||||||
|
"image_id": "sha256:8a73e9185f8420247c5b3c19231df18dfac28a8d5706203e13b291934044966d",
|
||||||
|
"image_name": "rabbitmq:4.1.0-alpine",
|
||||||
|
"started_at": "2026-11-27T13:45:10.97424342Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 536870912,
|
||||||
|
"nano_cpus": 750000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "a132f04f36935cdb0d11035f589a5cb4e5838538f184e7a32f0dcf6f99e18ef5",
|
||||||
|
"service": "bucket-init",
|
||||||
|
"image_id": "sha256:abf4f50d6ffa16b55f0d02beec9f769386363f756aa0a15dc811887c3bdedf3f",
|
||||||
|
"image_name": "lyakhonov-storage:lab6",
|
||||||
|
"started_at": "2026-11-27T14:19:22.740870264Z",
|
||||||
|
"status": "exited",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 134217728,
|
||||||
|
"nano_cpus": 250000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "8b2ac7682adccd6538de7c20f623ae01dd138898cc3ff0d3fffa6bd04c5870ae",
|
||||||
|
"service": "db",
|
||||||
|
"image_id": "sha256:1d04b9ba1d4996401f2552b51beda8187f175c0645c091e4781134fc9c9a3eef",
|
||||||
|
"image_name": "postgres:16.6-alpine",
|
||||||
|
"started_at": "2026-11-27T13:45:10.139067021Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 536870912,
|
||||||
|
"nano_cpus": 1000000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "aceeab789db850a85c410f4ca28fd179614bc3d0b2453d26061dd7d0faefe52f",
|
||||||
|
"service": "diagnostics",
|
||||||
|
"image_id": "sha256:80c3d2e7ef27177eeacbfa64b42e5bb01d3c5b8266b8acf18d78d74de1dd7cc3",
|
||||||
|
"image_name": "lyakhonov-messenger:lab6",
|
||||||
|
"started_at": "2026-11-27T14:19:26.18391717Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 134217728,
|
||||||
|
"nano_cpus": 250000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "5ccc7f4f085b5f70537b6c452657c993851530685a469963712e88890c6b315c",
|
||||||
|
"service": "dispatcher",
|
||||||
|
"image_id": "sha256:80c3d2e7ef27177eeacbfa64b42e5bb01d3c5b8266b8acf18d78d74de1dd7cc3",
|
||||||
|
"image_name": "lyakhonov-messenger:lab6",
|
||||||
|
"started_at": "2026-11-27T14:19:26.194270287Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 268435456,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "fd238069b4c6e8710a45a8f177521e86d473157a3b7d9653bfa0f8c456bbec01",
|
||||||
|
"service": "grafana",
|
||||||
|
"image_id": "sha256:35c41e0fd0295f5d0ee5db7e780cf33506abfaf47686196f825364889dee878b",
|
||||||
|
"image_name": "grafana/grafana:12.2.1",
|
||||||
|
"started_at": "2026-11-27T14:19:55.991420476Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 402653184,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "7eead7f9124d5e42bad9d977aeeaf851f52075586b23462e94b81e64c4a13525",
|
||||||
|
"service": "lb",
|
||||||
|
"image_id": "sha256:c22c8710886104a48b920306f063401f0d11811858e3c6b9d87d88a7556b2e61",
|
||||||
|
"image_name": "haproxy:3.0.6-alpine",
|
||||||
|
"started_at": "2026-11-27T13:45:09.878536759Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 134217728,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "fc773e310e1eae54b2e73e03047b648af2ea46f667b3b89f060644e08f661c2a",
|
||||||
|
"service": "loki",
|
||||||
|
"image_id": "sha256:0eaee7bf39cc83aaef46914fb58f287d4f4c4be6ec96b86c2ed55719a75e49c8",
|
||||||
|
"image_name": "grafana/loki:3.5.7",
|
||||||
|
"started_at": "2026-11-27T14:19:55.969688171Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 402653184,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "b2d4fd2ba0bb08e1cfb9ce5f381bb3e536d493c292cf72e9dbe32ad21e464b53",
|
||||||
|
"service": "migrate",
|
||||||
|
"image_id": "sha256:80c3d2e7ef27177eeacbfa64b42e5bb01d3c5b8266b8acf18d78d74de1dd7cc3",
|
||||||
|
"image_name": "lyakhonov-messenger:lab6",
|
||||||
|
"started_at": "2026-11-27T14:19:23.274888457Z",
|
||||||
|
"status": "exited",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 671088640,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "eb8394f106efd30c4ef99094c79301d866a8533050b8eacf28e0e08099331302",
|
||||||
|
"service": "otel-collector",
|
||||||
|
"image_id": "sha256:886722fe0f37af9d1fe24d29529253ec59fbf263b3b1df4facaf221373e19d23",
|
||||||
|
"image_name": "otel/opentelemetry-collector-contrib:0.137.0",
|
||||||
|
"started_at": "2026-11-27T13:41:03.918588049Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 268435456,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "26aef64c2c079a6bd7f0058b8050687a3ea4807e6ac343eae92090f19b08e30c",
|
||||||
|
"service": "prometheus",
|
||||||
|
"image_id": "sha256:49214755b6153f90a597adcbff0252cc61069f8ab69ce8411285cd4a560e8038",
|
||||||
|
"image_name": "prom/prometheus:v3.7.3",
|
||||||
|
"started_at": "2026-11-27T14:19:55.988788641Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 402653184,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "db034935279f969cd150b4fbe32817cf1ae334820e5e5e9d1cd7e7939bcf8dbb",
|
||||||
|
"service": "redis",
|
||||||
|
"image_id": "sha256:c1e88455c85225310bbea54816e9c3f4b5295815e6dbf80c34d40afc6df28275",
|
||||||
|
"image_name": "redis:7.4.1-alpine",
|
||||||
|
"started_at": "2026-11-27T13:45:09.601677028Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 134217728,
|
||||||
|
"nano_cpus": 250000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "c24794f0b24a27553c978dfd55459a02784da6f637ef8c69b12b4b9cb8cac555",
|
||||||
|
"service": "s3",
|
||||||
|
"image_id": "sha256:abf4f50d6ffa16b55f0d02beec9f769386363f756aa0a15dc811887c3bdedf3f",
|
||||||
|
"image_name": "lyakhonov-storage:lab6",
|
||||||
|
"started_at": "2026-11-27T13:55:23.176637759Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 805306368,
|
||||||
|
"nano_cpus": 1000000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "1563a56286835d4258f837228c31fae6d8455a0b7099a61f979f4f0e417c08d5",
|
||||||
|
"service": "staging-cleaner",
|
||||||
|
"image_id": "sha256:80c3d2e7ef27177eeacbfa64b42e5bb01d3c5b8266b8acf18d78d74de1dd7cc3",
|
||||||
|
"image_name": "lyakhonov-messenger:lab6",
|
||||||
|
"started_at": "2026-11-27T14:19:26.192472806Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 268435456,
|
||||||
|
"nano_cpus": 250000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "bc3f7ac2f5718343126796584624c43452dbdb138ded3c37fe67aa83ce8756ea",
|
||||||
|
"service": "tempo",
|
||||||
|
"image_id": "sha256:65a5789759435f1ef696f1953258b9bbdb18eb571d5ce711ff812d2e128288a4",
|
||||||
|
"image_name": "grafana/tempo:2.9.0",
|
||||||
|
"started_at": "2026-11-27T14:19:55.974650121Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 402653184,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "0716b69fcded44f9ca81b499806fa707cb80f5cbad412ec701859060044b0a9f",
|
||||||
|
"service": "worker",
|
||||||
|
"image_id": "sha256:80c3d2e7ef27177eeacbfa64b42e5bb01d3c5b8266b8acf18d78d74de1dd7cc3",
|
||||||
|
"image_name": "lyakhonov-messenger:lab6",
|
||||||
|
"started_at": "2026-11-27T14:19:26.596914241Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 805306368,
|
||||||
|
"nano_cpus": 750000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "d1967d83a486901bb76f7973471fdf733ce9abca882f8610229f580da8dc5d25",
|
||||||
|
"service": "worker",
|
||||||
|
"image_id": "sha256:80c3d2e7ef27177eeacbfa64b42e5bb01d3c5b8266b8acf18d78d74de1dd7cc3",
|
||||||
|
"image_name": "lyakhonov-messenger:lab6",
|
||||||
|
"started_at": "2026-11-27T14:19:26.189342306Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 805306368,
|
||||||
|
"nano_cpus": 750000000
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"other_containers": [
|
||||||
|
{
|
||||||
|
"id": "e36e30c0bc23ffdc3c2c4fe39b57ea98597764dfa313c509bd1734d74b801b44",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-27T14:26:49.382573956Z",
|
||||||
|
"state": "running"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "b3f8a331a59832dde80002af9f29c5893381e780803283476c687168ede15842",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-20T04:00:04.137137202Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "1f724278797561aea476251a8902eac6377039c3e30cbc336d501409af118ae2",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-27T14:26:49.304330011Z",
|
||||||
|
"state": "running"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "bdedd08309bb0db9dc94235a148fc0938180449b1431059178488d0c6f985049",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-27T14:26:52.421275543Z",
|
||||||
|
"state": "running"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "23b814fb71a813bedb09712be57c736e19460c2c25d2b2b4b0e66facb0bfdab9",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-27T14:26:50.810858284Z",
|
||||||
|
"state": "running"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "a0acb99b68a1f803792742460827528137ac3ab96ec76a68de550f930a4a9368",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-20T04:00:23.843924506Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "39b8b11f3c7c9e1c3fb778e780dc8d123e4b955669ddee8c85420eefcb3abaca",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-20T03:59:01.96581278Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "934fcb61b954722ec6f9d3ce84d3399f5a35a30e8368e0ed44a939319ea9ff4f",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-20T03:58:30.862509137Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "fdca00783fcb86e75d3ec4c84494d1571548333d585459191b78992f707729ad",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-20T03:59:01.428198308Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "10408d41f3b50b0a5e8ad4e21b849fa97548c03f4a535b27c8c919163b9c30b2",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-20T03:58:30.504381937Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "b94a25ac1bb3df998e3d0c27beae4b97d655bbc0a7ae520bd60c736cd40462c9",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-20T03:58:31.88055044Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "c3962c31749b802835f909ce1b4efbe34149e88d9bc678ca3b82f9fdbcc97af1",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-20T03:58:30.614258194Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "0b09dce985685e130ed8774a277a3ff254e8a633ff1dfeed7fd2daf80b78c4e8",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-20T03:58:31.091098179Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "99f4403277a732ba8c6512634bdecbce168705cdfdf9edf83420133109647544",
|
||||||
|
"project": "lyakhonov-lab4",
|
||||||
|
"started_at": "2026-10-30T14:46:59.269605492Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "7523f15dc398abffadfc62383a4976e33e0f25220ecb983d059002bd1ac9563b",
|
||||||
|
"project": "lyakhonov-lab4",
|
||||||
|
"started_at": "2026-10-30T14:49:08.477185174Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "af9f952b1304310adb0cfd0620293050d2b1eb3a4e4b7395bd41d41df7730016",
|
||||||
|
"project": "lyakhonov-lab4",
|
||||||
|
"started_at": "2026-10-30T14:46:59.471200143Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "07a9b492d60425b059661cfa7075640b85bd6f5c18831e2b3eb448166b29a7ee",
|
||||||
|
"project": "lyakhonov-lab4",
|
||||||
|
"started_at": "2026-10-30T14:49:07.055892766Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "5d273b8dcb0cc6f4acfe44b78f189e2168eeb212103db0f18dcd5f6fbd3b3134",
|
||||||
|
"project": "lyakhonov-lab4",
|
||||||
|
"started_at": "2026-10-30T14:49:07.517707083Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "a6482b44d70a2031a2563b1b72d955435125453a48e95087464775c918801941",
|
||||||
|
"project": "lyakhonov-lab4",
|
||||||
|
"started_at": "2026-10-30T14:45:43.938532131Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "e9682a892ad30d5becf1fda8abbc16770aed81f261b0843f9cb047b5085baf76",
|
||||||
|
"project": "lyakhonov-lab4",
|
||||||
|
"started_at": "2026-10-30T14:45:44.017393725Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "10138b5c0beefe8a15a6679fdad81ddac663eea21e8f63bf3ca03545c2558f20",
|
||||||
|
"project": "lyakhonov-lab4",
|
||||||
|
"started_at": "2026-10-30T14:45:44.07685361Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "68997bbba33bdd4bed3093f2f7c127856cba5237c46511aad9a35945bdcf535f",
|
||||||
|
"project": "lyakhonov-lab4",
|
||||||
|
"started_at": "2026-10-30T14:45:43.846575438Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "83b50e889353134bf5f1d215a2bc66e8f921a2de8957f3cb176cea255035f17f",
|
||||||
|
"project": "lyakhonov-lab3",
|
||||||
|
"started_at": "2026-10-23T16:13:46.65851457Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "1ff12291d9d61efbb3795aab208fdadff718cb7f6470b4c1094ee76f9acf2924",
|
||||||
|
"project": "lyakhonov-lab3",
|
||||||
|
"started_at": "2026-10-23T16:13:47.058554979Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "1031c94e3574d1843bb615df3426f8769100f54cd862018bb597d54d2401387b",
|
||||||
|
"project": "lyakhonov-lab3",
|
||||||
|
"started_at": "2026-10-23T16:07:54.077571177Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "4577101bc498d9f217ad682ab8af2a4688f7772287a1755eab603ecc946ce2b7",
|
||||||
|
"project": "lyakhonov-lab3",
|
||||||
|
"started_at": "2026-10-23T16:08:02.041383013Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "f2cdcc232751e2c2400763e935897851aca1399824ed751ec96a51180282a207",
|
||||||
|
"project": "lyakhonov-lab3",
|
||||||
|
"started_at": "2026-10-23T16:08:02.306518292Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "889db8e55eb20c99fbe462f3d407763760cc40f0a053b144dcb9f6d13f6255c8",
|
||||||
|
"project": "lyakhonov-lab3",
|
||||||
|
"started_at": "2026-10-23T16:08:02.163804371Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "1d0681eaf75f9c0ed9e48f2529ab671d72b528c4a621e44b68199b1437387d7c",
|
||||||
|
"project": "lyakhonov-lab2",
|
||||||
|
"started_at": "2026-10-09T11:26:57.052800221Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "8bf3b717f757d92d742f440ee37fa2f7a304ca0b21912dcb5e02b9a7d9505a93",
|
||||||
|
"project": "lyakhonov-lab2",
|
||||||
|
"started_at": "2026-10-09T11:25:00.307001994Z",
|
||||||
|
"state": "exited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "92075e2bbf03ab04a43dccc4b171554af2781687127bd343453182cdcf3fb0ec",
|
||||||
|
"project": "lyakhonov-lab2",
|
||||||
|
"started_at": "2026-10-09T11:25:00.409548723Z",
|
||||||
|
"state": "exited"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,106 @@
|
|||||||
|
{
|
||||||
|
"dashboard": {
|
||||||
|
"uid": "messenger-lab6",
|
||||||
|
"title": "Messenger: API, jobs and SLO",
|
||||||
|
"panel_count": 17
|
||||||
|
},
|
||||||
|
"queries": [
|
||||||
|
{
|
||||||
|
"title": "HTTP successful RPS",
|
||||||
|
"query": "sum(rate(messenger_http_requests_total{status_class!=\"5xx\"}[1m]))",
|
||||||
|
"series_count": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "HTTP error ratio",
|
||||||
|
"query": "(sum(rate(messenger_http_requests_total{status_class=\"5xx\"}[1m])) or vector(0)) / clamp_min(sum(rate(messenger_http_requests_total[1m])),0.001)",
|
||||||
|
"series_count": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "API p50/p95/p99",
|
||||||
|
"query": "histogram_quantile(0.5,sum by (le)(rate(messenger_http_duration_seconds_bucket[1m])))",
|
||||||
|
"series_count": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "API p50/p95/p99",
|
||||||
|
"query": "histogram_quantile(0.95,sum by (le)(rate(messenger_http_duration_seconds_bucket[1m])))",
|
||||||
|
"series_count": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "API p50/p95/p99",
|
||||||
|
"query": "histogram_quantile(0.99,sum by (le)(rate(messenger_http_duration_seconds_bucket[1m])))",
|
||||||
|
"series_count": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Jobs by outcome",
|
||||||
|
"query": "sum by (outcome)(rate(messenger_jobs_total[1m]))",
|
||||||
|
"series_count": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Worker p95",
|
||||||
|
"query": "histogram_quantile(0.95,sum by (le)(rate(messenger_job_duration_seconds_bucket[1m])))",
|
||||||
|
"series_count": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Queue depth",
|
||||||
|
"query": "messenger_queue_depth",
|
||||||
|
"series_count": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Oldest unfinished job",
|
||||||
|
"query": "messenger_queue_oldest_seconds",
|
||||||
|
"series_count": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "DB pool used / waiting",
|
||||||
|
"query": "{__name__=~\"messenger_db_pool_(used|waiting)\"}",
|
||||||
|
"series_count": 10
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Worker busy / capacity",
|
||||||
|
"query": "{__name__=~\"messenger_worker_(busy|capacity)\"}",
|
||||||
|
"series_count": 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Time to ready p95",
|
||||||
|
"query": "histogram_quantile(0.95,sum by (le)(rate(messenger_ready_duration_seconds_bucket[1m])))",
|
||||||
|
"series_count": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Process maximum RSS",
|
||||||
|
"query": "messenger_process_maxrss_bytes",
|
||||||
|
"series_count": 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Process CPU cores",
|
||||||
|
"query": "sum by (service_name)(rate(messenger_process_cpu_seconds_total[1m]))",
|
||||||
|
"series_count": 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "API SLI, rolling 2 min",
|
||||||
|
"query": "1 - ((sum(rate(messenger_http_requests_total{status_class=\"5xx\"}[2m])) or vector(0)) / clamp_min(sum(rate(messenger_http_requests_total[2m])),0.001))",
|
||||||
|
"series_count": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Ready SLI, rolling cohort 2 min",
|
||||||
|
"query": "(1 - sum(messenger_ready_window_bad{window=\"2m\"}) / clamp_min(sum(messenger_ready_window_total{window=\"2m\"}),1)) and on() (sum(messenger_ready_window_total{window=\"2m\"}) > 0)",
|
||||||
|
"series_count": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "API burn, short window",
|
||||||
|
"query": "sum(rate(messenger_http_requests_total{status_class=\"5xx\"}[15s])) / clamp_min(sum(rate(messenger_http_requests_total[15s])),0.001) / 0.01",
|
||||||
|
"series_count": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Ready burn, short window",
|
||||||
|
"query": "sum(messenger_ready_window_bad{window=\"15s\"}) / clamp_min(sum(messenger_ready_window_total{window=\"15s\"}),1) / 0.05",
|
||||||
|
"series_count": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Local firing alerts",
|
||||||
|
"query": "ALERTS{alertstate=\"firing\"}",
|
||||||
|
"series_count": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"same_external_container_ids": true,
|
||||||
|
"external_runtime_details": "previous-runtime-observation.json"
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
..
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
Ran 2 tests in 0.223s
|
||||||
|
|
||||||
|
OK
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
Traceback (most recent call last):
|
||||||
|
File "C:\Users\User\Desktop\vysoko-nagr 6\student-tests\incidents.py", line 100, in <module>
|
||||||
|
if __name__=='__main__':main()
|
||||||
|
~~~~^^
|
||||||
|
File "C:\Users\User\Desktop\vysoko-nagr 6\student-tests\incidents.py", line 44, in main
|
||||||
|
check(retried,'no managed retry observed while S3 stopped')
|
||||||
|
~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
File "C:\Users\User\Desktop\vysoko-nagr 6\tests\client.py", line 24, in check
|
||||||
|
raise Failure(message)
|
||||||
|
client.Failure: no managed retry observed while S3 stopped
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
Traceback (most recent call last):
|
||||||
|
File "C:\Users\User\Desktop\vysoko-nagr 6\student-tests\incidents.py", line 90, in <module>
|
||||||
|
if __name__=='__main__':main()
|
||||||
|
~~~~^^
|
||||||
|
File "C:\Users\User\Desktop\vysoko-nagr 6\student-tests\incidents.py", line 39, in main
|
||||||
|
check(sum(s['kind']=='SPAN_KIND_CONSUMER' for s in spans)>=2,'retry trace missing')
|
||||||
|
~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
File "C:\Users\User\Desktop\vysoko-nagr 6\tests\client.py", line 24, in check
|
||||||
|
raise Failure(message)
|
||||||
|
client.Failure: retry trace missing
|
||||||
@@ -0,0 +1,547 @@
|
|||||||
|
{
|
||||||
|
"before": [
|
||||||
|
{
|
||||||
|
"id": "c321063cfe0dc6319e0cb3704f3902e5387e8e19f4c7c21b8c89ec54af2e99cb",
|
||||||
|
"service": "api",
|
||||||
|
"started_at": "2026-11-27T13:46:28.716162825Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 671088640,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "c200522d3266343ce6069346b58a6f645a4ed9129fc6be4503e7443b475033b9",
|
||||||
|
"service": "api",
|
||||||
|
"started_at": "2026-11-27T13:46:36.77308908Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 671088640,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "67250f581ff773c0f5daec64696792f6ef7fbbafed2fcc937bcd45edd96d28ad",
|
||||||
|
"service": "broker",
|
||||||
|
"started_at": "2026-11-27T13:45:10.97424342Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 536870912,
|
||||||
|
"nano_cpus": 750000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "a132f04f36935cdb0d11035f589a5cb4e5838538f184e7a32f0dcf6f99e18ef5",
|
||||||
|
"service": "bucket-init",
|
||||||
|
"started_at": "2026-11-27T13:46:16.007554493Z",
|
||||||
|
"status": "exited",
|
||||||
|
"memory_limit": 134217728,
|
||||||
|
"nano_cpus": 250000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "8b2ac7682adccd6538de7c20f623ae01dd138898cc3ff0d3fffa6bd04c5870ae",
|
||||||
|
"service": "db",
|
||||||
|
"started_at": "2026-11-27T13:45:10.139067021Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 536870912,
|
||||||
|
"nano_cpus": 1000000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "c37c4520dde0281588280092f7b3eb0f666cfdc0c907c18071f4c257c608907d",
|
||||||
|
"service": "diagnostics",
|
||||||
|
"started_at": "2026-11-27T13:44:04.371189151Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 134217728,
|
||||||
|
"nano_cpus": 250000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "b01cf07496d8f1d7436aa7d6a13278bb1c6543bc1ed4c1e879aed3675a524f91",
|
||||||
|
"service": "dispatcher",
|
||||||
|
"started_at": "2026-11-27T13:45:10.274744107Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 268435456,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "fe879ab1e1e5a4d7761a03ab03e08aa614cf3194555d3362ba5a54a8e1ec8eba",
|
||||||
|
"service": "grafana",
|
||||||
|
"started_at": "2026-11-27T13:41:04.086803753Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 402653184,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "7eead7f9124d5e42bad9d977aeeaf851f52075586b23462e94b81e64c4a13525",
|
||||||
|
"service": "lb",
|
||||||
|
"started_at": "2026-11-27T13:45:09.878536759Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 134217728,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "d7eaf54f7dfa6ce43ca84e7630c357ba834d13826a07f1656d532bbd1aa8133d",
|
||||||
|
"service": "loki",
|
||||||
|
"started_at": "2026-11-27T13:41:03.943038494Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 402653184,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "3460fb4f99e34f2afc8cebf95563f121bd458fb983bacc35a2fb694d5580770b",
|
||||||
|
"service": "migrate",
|
||||||
|
"started_at": "2026-11-27T13:46:16.508827083Z",
|
||||||
|
"status": "exited",
|
||||||
|
"memory_limit": 671088640,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "eb8394f106efd30c4ef99094c79301d866a8533050b8eacf28e0e08099331302",
|
||||||
|
"service": "otel-collector",
|
||||||
|
"started_at": "2026-11-27T13:41:03.918588049Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 268435456,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "888ff5ffe6db73757cc652ce5376c3c9a78df120683edf2be120c17e7967e058",
|
||||||
|
"service": "prometheus",
|
||||||
|
"started_at": "2026-11-27T13:44:07.268964594Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 402653184,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "db034935279f969cd150b4fbe32817cf1ae334820e5e5e9d1cd7e7939bcf8dbb",
|
||||||
|
"service": "redis",
|
||||||
|
"started_at": "2026-11-27T13:45:09.601677028Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 134217728,
|
||||||
|
"nano_cpus": 250000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "c24794f0b24a27553c978dfd55459a02784da6f637ef8c69b12b4b9cb8cac555",
|
||||||
|
"service": "s3",
|
||||||
|
"started_at": "2026-11-27T13:45:09.53213622Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 805306368,
|
||||||
|
"nano_cpus": 1000000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "121813ef2b200ce213610c1d4d3d3c35af5203e8fe586bc070a231e51e01be81",
|
||||||
|
"service": "staging-cleaner",
|
||||||
|
"started_at": "2026-11-27T13:45:10.571681425Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 268435456,
|
||||||
|
"nano_cpus": 250000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "d89bc7eca7813a5b8eff9c5c37497bf7feb0c1ad7251797d0f99af5f9eee2337",
|
||||||
|
"service": "tempo",
|
||||||
|
"started_at": "2026-11-27T13:41:04.011042724Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 402653184,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "8f4bf0c0b97760df71ab60ecddb180a9a3aedca3a445c14c8925a1e0e613d818",
|
||||||
|
"service": "worker",
|
||||||
|
"started_at": "2026-11-27T13:45:10.016773257Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 805306368,
|
||||||
|
"nano_cpus": 750000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "ca6de9150e29d58d0d60768e3ebaec6e6ed7fe56a0f1650dff31d8681870d266",
|
||||||
|
"service": "worker",
|
||||||
|
"started_at": "2026-11-27T13:45:10.503836556Z",
|
||||||
|
"status": "running",
|
||||||
|
"memory_limit": 805306368,
|
||||||
|
"nano_cpus": 750000000
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"incidents": [
|
||||||
|
{
|
||||||
|
"name": "worker stopped",
|
||||||
|
"observations": [
|
||||||
|
{
|
||||||
|
"time": 1795787206.595587,
|
||||||
|
"depth": [
|
||||||
|
{
|
||||||
|
"metric": {
|
||||||
|
"__name__": "messenger_queue_depth",
|
||||||
|
"instance": "diagnostics:9099",
|
||||||
|
"job": "backlog"
|
||||||
|
},
|
||||||
|
"value": [
|
||||||
|
1795787206.632,
|
||||||
|
"0"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"age": [
|
||||||
|
{
|
||||||
|
"metric": {
|
||||||
|
"__name__": "messenger_queue_oldest_seconds",
|
||||||
|
"instance": "diagnostics:9099",
|
||||||
|
"job": "backlog"
|
||||||
|
},
|
||||||
|
"value": [
|
||||||
|
1795787206.64,
|
||||||
|
"0"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"alerts": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"time": 1795787211.6497986,
|
||||||
|
"depth": [
|
||||||
|
{
|
||||||
|
"metric": {
|
||||||
|
"__name__": "messenger_queue_depth",
|
||||||
|
"instance": "diagnostics:9099",
|
||||||
|
"job": "backlog"
|
||||||
|
},
|
||||||
|
"value": [
|
||||||
|
1795787211.679,
|
||||||
|
"1"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"age": [
|
||||||
|
{
|
||||||
|
"metric": {
|
||||||
|
"__name__": "messenger_queue_oldest_seconds",
|
||||||
|
"instance": "diagnostics:9099",
|
||||||
|
"job": "backlog"
|
||||||
|
},
|
||||||
|
"value": [
|
||||||
|
1795787211.684,
|
||||||
|
"1.646993"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"alerts": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"time": 1795787216.6868322,
|
||||||
|
"depth": [
|
||||||
|
{
|
||||||
|
"metric": {
|
||||||
|
"__name__": "messenger_queue_depth",
|
||||||
|
"instance": "diagnostics:9099",
|
||||||
|
"job": "backlog"
|
||||||
|
},
|
||||||
|
"value": [
|
||||||
|
1795787216.691,
|
||||||
|
"1"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"age": [
|
||||||
|
{
|
||||||
|
"metric": {
|
||||||
|
"__name__": "messenger_queue_oldest_seconds",
|
||||||
|
"instance": "diagnostics:9099",
|
||||||
|
"job": "backlog"
|
||||||
|
},
|
||||||
|
"value": [
|
||||||
|
1795787216.697,
|
||||||
|
"6.647773"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"alerts": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"time": 1795787221.7274158,
|
||||||
|
"depth": [
|
||||||
|
{
|
||||||
|
"metric": {
|
||||||
|
"__name__": "messenger_queue_depth",
|
||||||
|
"instance": "diagnostics:9099",
|
||||||
|
"job": "backlog"
|
||||||
|
},
|
||||||
|
"value": [
|
||||||
|
1795787221.732,
|
||||||
|
"1"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"age": [
|
||||||
|
{
|
||||||
|
"metric": {
|
||||||
|
"__name__": "messenger_queue_oldest_seconds",
|
||||||
|
"instance": "diagnostics:9099",
|
||||||
|
"job": "backlog"
|
||||||
|
},
|
||||||
|
"value": [
|
||||||
|
1795787221.736,
|
||||||
|
"11.64342"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"alerts": [
|
||||||
|
{
|
||||||
|
"labels": {
|
||||||
|
"alertname": "ReadyBurnSlow",
|
||||||
|
"severity": "critical"
|
||||||
|
},
|
||||||
|
"annotations": {
|
||||||
|
"runbook": "RUNBOOK.md#ready",
|
||||||
|
"summary": "Time-to-ready budget burn in 1m AND 5m, unfinished/failed included"
|
||||||
|
},
|
||||||
|
"state": "pending",
|
||||||
|
"activeAt": "2026-11-27T13:46:54.758725496Z",
|
||||||
|
"value": "1e+01"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"time": 1795787226.7441888,
|
||||||
|
"depth": [
|
||||||
|
{
|
||||||
|
"metric": {
|
||||||
|
"__name__": "messenger_queue_depth",
|
||||||
|
"instance": "diagnostics:9099",
|
||||||
|
"job": "backlog"
|
||||||
|
},
|
||||||
|
"value": [
|
||||||
|
1795787226.749,
|
||||||
|
"1"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"age": [
|
||||||
|
{
|
||||||
|
"metric": {
|
||||||
|
"__name__": "messenger_queue_oldest_seconds",
|
||||||
|
"instance": "diagnostics:9099",
|
||||||
|
"job": "backlog"
|
||||||
|
},
|
||||||
|
"value": [
|
||||||
|
1795787226.778,
|
||||||
|
"16.64385"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"alerts": [
|
||||||
|
{
|
||||||
|
"labels": {
|
||||||
|
"alertname": "QueueLag",
|
||||||
|
"instance": "diagnostics:9099",
|
||||||
|
"job": "backlog",
|
||||||
|
"severity": "warning"
|
||||||
|
},
|
||||||
|
"annotations": {
|
||||||
|
"runbook": "RUNBOOK.md",
|
||||||
|
"summary": "Unfinished job age >10s; inspect worker busy/capacity and consume logs"
|
||||||
|
},
|
||||||
|
"state": "pending",
|
||||||
|
"activeAt": "2026-11-27T13:46:59.758725496Z",
|
||||||
|
"value": "1.164342e+01"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"labels": {
|
||||||
|
"alertname": "ReadyBurnSlow",
|
||||||
|
"severity": "critical"
|
||||||
|
},
|
||||||
|
"annotations": {
|
||||||
|
"runbook": "RUNBOOK.md#ready",
|
||||||
|
"summary": "Time-to-ready budget burn in 1m AND 5m, unfinished/failed included"
|
||||||
|
},
|
||||||
|
"state": "pending",
|
||||||
|
"activeAt": "2026-11-27T13:46:54.758725496Z",
|
||||||
|
"value": "1e+01"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"time": 1795787231.784118,
|
||||||
|
"depth": [
|
||||||
|
{
|
||||||
|
"metric": {
|
||||||
|
"__name__": "messenger_queue_depth",
|
||||||
|
"instance": "diagnostics:9099",
|
||||||
|
"job": "backlog"
|
||||||
|
},
|
||||||
|
"value": [
|
||||||
|
1795787231.793,
|
||||||
|
"1"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"age": [
|
||||||
|
{
|
||||||
|
"metric": {
|
||||||
|
"__name__": "messenger_queue_oldest_seconds",
|
||||||
|
"instance": "diagnostics:9099",
|
||||||
|
"job": "backlog"
|
||||||
|
},
|
||||||
|
"value": [
|
||||||
|
1795787231.8,
|
||||||
|
"21.642843"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"alerts": [
|
||||||
|
{
|
||||||
|
"labels": {
|
||||||
|
"alertname": "QueueLag",
|
||||||
|
"instance": "diagnostics:9099",
|
||||||
|
"job": "backlog",
|
||||||
|
"severity": "warning"
|
||||||
|
},
|
||||||
|
"annotations": {
|
||||||
|
"runbook": "RUNBOOK.md",
|
||||||
|
"summary": "Unfinished job age >10s; inspect worker busy/capacity and consume logs"
|
||||||
|
},
|
||||||
|
"state": "pending",
|
||||||
|
"activeAt": "2026-11-27T13:46:59.758725496Z",
|
||||||
|
"value": "1.664385e+01"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"labels": {
|
||||||
|
"alertname": "ReadyBurnSlow",
|
||||||
|
"severity": "critical"
|
||||||
|
},
|
||||||
|
"annotations": {
|
||||||
|
"runbook": "RUNBOOK.md#ready",
|
||||||
|
"summary": "Time-to-ready budget burn in 1m AND 5m, unfinished/failed included"
|
||||||
|
},
|
||||||
|
"state": "pending",
|
||||||
|
"activeAt": "2026-11-27T13:46:54.758725496Z",
|
||||||
|
"value": "1e+01"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"time": 1795787236.8056507,
|
||||||
|
"depth": [
|
||||||
|
{
|
||||||
|
"metric": {
|
||||||
|
"__name__": "messenger_queue_depth",
|
||||||
|
"instance": "diagnostics:9099",
|
||||||
|
"job": "backlog"
|
||||||
|
},
|
||||||
|
"value": [
|
||||||
|
1795787236.815,
|
||||||
|
"1"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"age": [
|
||||||
|
{
|
||||||
|
"metric": {
|
||||||
|
"__name__": "messenger_queue_oldest_seconds",
|
||||||
|
"instance": "diagnostics:9099",
|
||||||
|
"job": "backlog"
|
||||||
|
},
|
||||||
|
"value": [
|
||||||
|
1795787236.82,
|
||||||
|
"26.644142"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"alerts": [
|
||||||
|
{
|
||||||
|
"labels": {
|
||||||
|
"alertname": "QueueLag",
|
||||||
|
"instance": "diagnostics:9099",
|
||||||
|
"job": "backlog",
|
||||||
|
"severity": "warning"
|
||||||
|
},
|
||||||
|
"annotations": {
|
||||||
|
"runbook": "RUNBOOK.md",
|
||||||
|
"summary": "Unfinished job age >10s; inspect worker busy/capacity and consume logs"
|
||||||
|
},
|
||||||
|
"state": "firing",
|
||||||
|
"activeAt": "2026-11-27T13:46:59.758725496Z",
|
||||||
|
"value": "2.1642843e+01"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"labels": {
|
||||||
|
"alertname": "ReadyBurnSlow",
|
||||||
|
"severity": "critical"
|
||||||
|
},
|
||||||
|
"annotations": {
|
||||||
|
"runbook": "RUNBOOK.md#ready",
|
||||||
|
"summary": "Time-to-ready budget burn in 1m AND 5m, unfinished/failed included"
|
||||||
|
},
|
||||||
|
"state": "pending",
|
||||||
|
"activeAt": "2026-11-27T13:46:54.758725496Z",
|
||||||
|
"value": "2e+01"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"time": 1795787241.8252575,
|
||||||
|
"depth": [
|
||||||
|
{
|
||||||
|
"metric": {
|
||||||
|
"__name__": "messenger_queue_depth",
|
||||||
|
"instance": "diagnostics:9099",
|
||||||
|
"job": "backlog"
|
||||||
|
},
|
||||||
|
"value": [
|
||||||
|
1795787241.847,
|
||||||
|
"1"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"age": [
|
||||||
|
{
|
||||||
|
"metric": {
|
||||||
|
"__name__": "messenger_queue_oldest_seconds",
|
||||||
|
"instance": "diagnostics:9099",
|
||||||
|
"job": "backlog"
|
||||||
|
},
|
||||||
|
"value": [
|
||||||
|
1795787241.878,
|
||||||
|
"31.641954"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"alerts": [
|
||||||
|
{
|
||||||
|
"labels": {
|
||||||
|
"alertname": "QueueLag",
|
||||||
|
"instance": "diagnostics:9099",
|
||||||
|
"job": "backlog",
|
||||||
|
"severity": "warning"
|
||||||
|
},
|
||||||
|
"annotations": {
|
||||||
|
"runbook": "RUNBOOK.md",
|
||||||
|
"summary": "Unfinished job age >10s; inspect worker busy/capacity and consume logs"
|
||||||
|
},
|
||||||
|
"state": "firing",
|
||||||
|
"activeAt": "2026-11-27T13:46:59.758725496Z",
|
||||||
|
"value": "2.6644142e+01"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"labels": {
|
||||||
|
"alertname": "ReadyBurnFast",
|
||||||
|
"severity": "critical"
|
||||||
|
},
|
||||||
|
"annotations": {
|
||||||
|
"runbook": "RUNBOOK.md#ready",
|
||||||
|
"summary": "Time-to-ready budget burn in 30s AND 2m, unfinished/failed included"
|
||||||
|
},
|
||||||
|
"state": "pending",
|
||||||
|
"activeAt": "2026-11-27T13:47:14.758725496Z",
|
||||||
|
"value": "2e+01"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"labels": {
|
||||||
|
"alertname": "ReadyBurnSlow",
|
||||||
|
"severity": "critical"
|
||||||
|
},
|
||||||
|
"annotations": {
|
||||||
|
"runbook": "RUNBOOK.md#ready",
|
||||||
|
"summary": "Time-to-ready budget burn in 1m AND 5m, unfinished/failed included"
|
||||||
|
},
|
||||||
|
"state": "pending",
|
||||||
|
"activeAt": "2026-11-27T13:46:54.758725496Z",
|
||||||
|
"value": "2e+01"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"ready": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
Traceback (most recent call last):
|
||||||
|
File "C:\Users\User\Desktop\vysoko-nagr 6\student-tests\incidents.py", line 116, in <module>
|
||||||
|
if __name__=='__main__':main()
|
||||||
|
~~~~^^
|
||||||
|
File "C:\Users\User\Desktop\vysoko-nagr 6\student-tests\incidents.py", line 60, in main
|
||||||
|
wait_result(response['json'])
|
||||||
|
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
|
||||||
|
File "C:\Users\User\Desktop\vysoko-nagr 6\student-tests\incidents.py", line 18, in wait_result
|
||||||
|
response=c.call('GET','/api/v1/attachments/'+att['id'],[200,503],actor=alice,schema='Attachment')
|
||||||
|
File "C:\Users\User\Desktop\vysoko-nagr 6\tests\client.py", line 133, in call
|
||||||
|
check(bool(rh.get('X-Request-Id')), 'missing X-Request-Id')
|
||||||
|
~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
File "C:\Users\User\Desktop\vysoko-nagr 6\tests\client.py", line 24, in check
|
||||||
|
raise Failure(message)
|
||||||
|
client.Failure: missing X-Request-Id
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
PASS: two ready API instances, healthy DB/broker, required background containers running
|
||||||
|
PASS: worker lag, S3 retry context, DB outage, telemetry backend outage and recovery
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
Traceback (most recent call last):
|
||||||
|
File "C:\Users\User\Desktop\vysoko-nagr 6\student-tests\incidents.py", line 100, in <module>
|
||||||
|
File "C:\Users\User\Desktop\vysoko-nagr 6\student-tests\incidents.py", line 46, in main
|
||||||
|
c.wait_ready(alice,response['json'])
|
||||||
|
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
File "C:\Users\User\Desktop\vysoko-nagr 6\tests\client.py", line 196, in wait_ready
|
||||||
|
att = self.call('GET','/api/v1/attachments/'+att['id'],actor=actor,schema='Attachment')['json']
|
||||||
|
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
File "C:\Users\User\Desktop\vysoko-nagr 6\tests\client.py", line 132, in call
|
||||||
|
check(status in allowed, method + ' ' + path.split('?')[0] + ': expected ' + str(allowed) + ', received ' + str(status))
|
||||||
|
~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
File "C:\Users\User\Desktop\vysoko-nagr 6\tests\client.py", line 24, in check
|
||||||
|
raise Failure(message)
|
||||||
|
client.Failure: GET /api/v1/attachments/d706a90b-8a94-4d37-87a7-08bb11b54739: expected [200], received 503
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"source": "Initial command outputs from this chat, before implementation",
|
||||||
|
"cwd": "C:/Users/User/Desktop/vysoko-nagr 6",
|
||||||
|
"lab_number": 6,
|
||||||
|
"head": "470d9d6",
|
||||||
|
"branch": "main",
|
||||||
|
"status_porcelain": "",
|
||||||
|
"whoami": "win-24dt7t3o465\\lyakhonov",
|
||||||
|
"docker_context": "desktop-linux",
|
||||||
|
"docker_client": "28.5.1",
|
||||||
|
"compose": "v2.40.3-desktop.1",
|
||||||
|
"initial_docker_error": "error during connect: Get \"http://%2F%2F.%2Fpipe%2FdockerDesktopLinuxEngine/v1.51/version\": open //./pipe/dockerDesktopLinuxEngine: The system cannot find the file specified.",
|
||||||
|
"safe_recovery_command": "docker desktop start",
|
||||||
|
"recovered": true,
|
||||||
|
"git_write_probe": {
|
||||||
|
"branch": "codex-probe-89a11a3e854a4c96b9048d1901527ad0",
|
||||||
|
"created_from": "HEAD",
|
||||||
|
"switched": false,
|
||||||
|
"deleted_successfully": true
|
||||||
|
},
|
||||||
|
"previous": {
|
||||||
|
"5": {
|
||||||
|
"head": "9dd2a03",
|
||||||
|
"branch": "solution/BVT2301-lyakhonov",
|
||||||
|
"status_porcelain": "",
|
||||||
|
"remote": "https://gitea.privcloud.tech/lyakhonov/mtusi2026lab5.git"
|
||||||
|
},
|
||||||
|
"4": {
|
||||||
|
"head": "8f112e092a10d72a98c3d9d4554c52b81ebff2b3",
|
||||||
|
"status_porcelain": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"active_previous_project_after_engine_start": "lyakhonov-lab5, four running background containers",
|
||||||
|
"host_logical_cpus": 16,
|
||||||
|
"host_total_ram_kib": 16384944,
|
||||||
|
"host_initial_free_ram_kib": 5490712
|
||||||
|
}
|
||||||
@@ -0,0 +1,125 @@
|
|||||||
|
{
|
||||||
|
"same_external_container_ids": true,
|
||||||
|
"changed_runtime_fields": [
|
||||||
|
{
|
||||||
|
"before": {
|
||||||
|
"id": "e36e30c0bc23ffdc3c2c4fe39b57ea98597764dfa313c509bd1734d74b801b44",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-27T13:46:55.696081044Z",
|
||||||
|
"state": "running"
|
||||||
|
},
|
||||||
|
"after": {
|
||||||
|
"id": "e36e30c0bc23ffdc3c2c4fe39b57ea98597764dfa313c509bd1734d74b801b44",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-27T14:26:49.382573956Z",
|
||||||
|
"state": "running"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"before": {
|
||||||
|
"id": "1f724278797561aea476251a8902eac6377039c3e30cbc336d501409af118ae2",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-27T13:47:08.572881915Z",
|
||||||
|
"state": "running"
|
||||||
|
},
|
||||||
|
"after": {
|
||||||
|
"id": "1f724278797561aea476251a8902eac6377039c3e30cbc336d501409af118ae2",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-27T14:26:49.304330011Z",
|
||||||
|
"state": "running"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"before": {
|
||||||
|
"id": "bdedd08309bb0db9dc94235a148fc0938180449b1431059178488d0c6f985049",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-27T13:46:52.646440477Z",
|
||||||
|
"state": "running"
|
||||||
|
},
|
||||||
|
"after": {
|
||||||
|
"id": "bdedd08309bb0db9dc94235a148fc0938180449b1431059178488d0c6f985049",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-27T14:26:52.421275543Z",
|
||||||
|
"state": "running"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"before": {
|
||||||
|
"id": "23b814fb71a813bedb09712be57c736e19460c2c25d2b2b4b0e66facb0bfdab9",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-27T13:47:17.724596809Z",
|
||||||
|
"state": "running"
|
||||||
|
},
|
||||||
|
"after": {
|
||||||
|
"id": "23b814fb71a813bedb09712be57c736e19460c2c25d2b2b4b0e66facb0bfdab9",
|
||||||
|
"project": "lyakhonov-lab5",
|
||||||
|
"started_at": "2026-11-27T14:26:50.810858284Z",
|
||||||
|
"state": "running"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"restart_metadata": [
|
||||||
|
{
|
||||||
|
"id": "e36e30c0bc23ffdc3c2c4fe39b57ea98597764dfa313c509bd1734d74b801b44",
|
||||||
|
"name": "/lyakhonov-lab5-worker-2",
|
||||||
|
"restart_count": 99,
|
||||||
|
"restart_policy": {
|
||||||
|
"Name": "unless-stopped",
|
||||||
|
"MaximumRetryCount": 0
|
||||||
|
},
|
||||||
|
"oom_killed": false,
|
||||||
|
"started_at": "2026-11-27T14:28:22.786798302Z",
|
||||||
|
"pool_timeout_log_matches": [
|
||||||
|
"psycopg_pool.PoolTimeout: pool initialization incomplete after 30.0 sec",
|
||||||
|
"psycopg_pool.PoolTimeout: pool initialization incomplete after 30.0 sec"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "1f724278797561aea476251a8902eac6377039c3e30cbc336d501409af118ae2",
|
||||||
|
"name": "/lyakhonov-lab5-worker-1",
|
||||||
|
"restart_count": 100,
|
||||||
|
"restart_policy": {
|
||||||
|
"Name": "unless-stopped",
|
||||||
|
"MaximumRetryCount": 0
|
||||||
|
},
|
||||||
|
"oom_killed": false,
|
||||||
|
"started_at": "2026-11-27T14:28:26.651808505Z",
|
||||||
|
"pool_timeout_log_matches": [
|
||||||
|
"psycopg_pool.PoolTimeout: pool initialization incomplete after 30.0 sec",
|
||||||
|
"psycopg_pool.PoolTimeout: pool initialization incomplete after 30.0 sec"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "bdedd08309bb0db9dc94235a148fc0938180449b1431059178488d0c6f985049",
|
||||||
|
"name": "/lyakhonov-lab5-dispatcher-1",
|
||||||
|
"restart_count": 99,
|
||||||
|
"restart_policy": {
|
||||||
|
"Name": "unless-stopped",
|
||||||
|
"MaximumRetryCount": 0
|
||||||
|
},
|
||||||
|
"oom_killed": false,
|
||||||
|
"started_at": "2026-11-27T14:28:26.011549614Z",
|
||||||
|
"pool_timeout_log_matches": [
|
||||||
|
"psycopg_pool.PoolTimeout: pool initialization incomplete after 30.0 sec",
|
||||||
|
"psycopg_pool.PoolTimeout: pool initialization incomplete after 30.0 sec"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "23b814fb71a813bedb09712be57c736e19460c2c25d2b2b4b0e66facb0bfdab9",
|
||||||
|
"name": "/lyakhonov-lab5-staging-cleaner-1",
|
||||||
|
"restart_count": 96,
|
||||||
|
"restart_policy": {
|
||||||
|
"Name": "unless-stopped",
|
||||||
|
"MaximumRetryCount": 0
|
||||||
|
},
|
||||||
|
"oom_killed": false,
|
||||||
|
"started_at": "2026-11-27T14:28:35.370691133Z",
|
||||||
|
"pool_timeout_log_matches": [
|
||||||
|
"psycopg_pool.PoolTimeout: pool initialization incomplete after 30.0 sec",
|
||||||
|
"psycopg_pool.PoolTimeout: pool initialization incomplete after 30.0 sec"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"previous_project_commands": "Read-only inspection only; no stop/start/restart/update/down/build commands addressed previous projects",
|
||||||
|
"interpretation": "Existing unless-stopped policies and application DB pool startup failure while old DB is stopped are consistent with automatic background restarts. Runtime StartedAt is not claimed unchanged."
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
PASS: clean Git export, new secrets and isolated stack; temporary resources removed
|
||||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,4 @@
|
|||||||
|
PASS: two ready API instances, healthy DB/broker, required background containers running
|
||||||
|
PASS: two ready API instances, healthy DB/broker, required background containers running
|
||||||
|
PASS: two ready API instances, healthy DB/broker, required background containers running
|
||||||
|
PASS: persistence, public failover twice, each API stopped separately
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
|||||||
|
PASS: real OTLP signals, connected producer/consumer/S3/DB graph, logs, metric labels, 24 concurrent replays and negative checks
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,9 @@
|
|||||||
|
domain,repeat,alert,detected_seconds,resolved_seconds_after_restore,control_firing_samples
|
||||||
|
db,1,APIBurnFast,34.24638223648071,24.86754822731018,0
|
||||||
|
db,1,APIBurnSlow,46.4275221824646,42.605244398117065,0
|
||||||
|
db,2,APIBurnFast,37.89571285247803,22.452908277511597,0
|
||||||
|
db,2,APIBurnSlow,53.145692586898804,37.67043972015381,0
|
||||||
|
worker,1,ReadyBurnFast,47.255120515823364,29.54395031929016,0
|
||||||
|
worker,1,ReadyBurnSlow,56.27066898345947,41.70926570892334,0
|
||||||
|
worker,2,ReadyBurnFast,48.05506253242493,29.119952917099,0
|
||||||
|
worker,2,ReadyBurnSlow,60.2374165058136,44.51889729499817,0
|
||||||
|
+15491
File diff suppressed because one or more lines are too long
+15410
File diff suppressed because one or more lines are too long
Binary file not shown.
|
After Width: | Height: | Size: 175 KiB |
@@ -0,0 +1,21 @@
|
|||||||
|
domain,repeat,phase,requests,successes,errors,successful_rps,actual_duration,grouping,p50_success_s,p95_success_s,p99_success_s,peak_sampled_cpu_percent,peak_sampled_memory_mib
|
||||||
|
db,1,warmup,71,71,0,1.999714704033638,35.505064725875854,response completion time,0.024286700412631035,0.03545259963721037,0.09412930067628622,83.64,1444.8339999999996
|
||||||
|
db,1,brief,9,4,5,0.9109829067881063,4.390861749649048,response completion time,0.5877243001013994,1.5841758996248245,1.5841758996248245,83.64,1444.8339999999996
|
||||||
|
db,1,brief_recovery,80,80,0,1.975242897178858,40.50134801864624,response completion time,0.015406900085508823,0.03473700024187565,0.07391209993511438,83.64,1444.8339999999996
|
||||||
|
db,1,sustained,151,4,147,0.05302544060059285,75.43548822402954,response completion time,0.7183953998610377,1.6673902999609709,1.6673902999609709,83.64,1444.8339999999996
|
||||||
|
db,1,recovery,200,200,0,2.000046020613062,99.99769902229309,response completion time,0.0463926000520587,0.08716250024735928,0.10644220001995564,83.64,1444.8339999999996
|
||||||
|
db,2,warmup,71,71,0,1.999658683149363,35.506059408187866,response completion time,0.056017300114035606,0.08690529968589544,0.09868700057268143,114.17,1660.8139999999999
|
||||||
|
db,2,brief,9,4,5,0.9035787710786778,4.426841497421265,response completion time,0.6029563993215561,1.6174710001796484,1.6174710001796484,114.17,1660.8139999999999
|
||||||
|
db,2,brief_recovery,80,80,0,1.9751835166682556,40.50256562232971,response completion time,0.04589090030640364,0.08136230055242777,0.10356689989566803,114.17,1660.8139999999999
|
||||||
|
db,2,sustained,151,4,147,0.0530343466674459,75.42282032966614,response completion time,0.721866799518466,1.722020000219345,1.722020000219345,114.17,1660.8139999999999
|
||||||
|
db,2,recovery,200,200,0,1.9787482461760502,101.07399988174438,response completion time,0.03853339981287718,0.08209950011223555,0.12641150038689375,114.17,1660.8139999999999
|
||||||
|
worker,1,warmup,73,73,0,2.014536851008564,36.23661684989929,response completion time,0.03522359952330589,0.08081919979304075,0.09379439987242222,240.95999999999998,1727.5540000000003
|
||||||
|
worker,1,brief,10,10,0,2.032657997658106,4.919666767120361,response completion time,0.03291099984198809,0.10272129997611046,0.10272129997611046,240.95999999999998,1727.5540000000003
|
||||||
|
worker,1,brief_recovery,82,82,0,1.9771963418643572,41.47286653518677,response completion time,0.038936199620366096,0.07219740003347397,0.09336950071156025,240.95999999999998,1727.5540000000003
|
||||||
|
worker,1,sustained,152,152,0,1.9970856205941525,76.11090803146362,response completion time,0.028729300014674664,0.08647890016436577,0.10704569984227419,240.95999999999998,1727.5540000000003
|
||||||
|
worker,1,recovery,200,200,0,1.9593020059476716,102.07716798782349,response completion time,0.026147800497710705,0.0641301004216075,0.08888369984924793,240.95999999999998,1727.5540000000003
|
||||||
|
worker,2,warmup,73,73,0,2.0164311268558914,36.20257544517517,response completion time,0.02096450049430132,0.03476729989051819,0.07523840013891459,211.49,1754.134
|
||||||
|
worker,2,brief,10,10,0,2.0141317065988718,4.964918613433838,response completion time,0.014377299696207047,0.06467240024358034,0.06467240024358034,211.49,1754.134
|
||||||
|
worker,2,brief_recovery,82,82,0,1.9789170858118876,41.43680429458618,response completion time,0.022286999970674515,0.03462549950927496,0.0882422998547554,211.49,1754.134
|
||||||
|
worker,2,sustained,152,152,0,1.9938480375447305,76.2344958782196,response completion time,0.02334349974989891,0.03516850061714649,0.07536919973790646,211.49,1754.134
|
||||||
|
worker,2,recovery,200,200,0,1.9641505565975346,101.82518815994263,response completion time,0.02370220050215721,0.04003189969807863,0.0817319005727768,211.49,1754.134
|
||||||
|
@@ -0,0 +1,24 @@
|
|||||||
|
db 1 warmup 35
|
||||||
|
db 1 brief 4
|
||||||
|
db 1 brief_recovery 40
|
||||||
|
db 1 sustained 75
|
||||||
|
db 1 recovery 100
|
||||||
|
PASS db 1 {"APIBurnFast": {"detected_seconds": 34.24638223648071, "resolved_seconds_after_restore": 24.86754822731018, "control_firing_samples": 0}, "APIBurnSlow": {"detected_seconds": 46.4275221824646, "resolved_seconds_after_restore": 42.605244398117065, "control_firing_samples": 0}}
|
||||||
|
db 2 warmup 35
|
||||||
|
db 2 brief 4
|
||||||
|
db 2 brief_recovery 40
|
||||||
|
db 2 sustained 75
|
||||||
|
db 2 recovery 100
|
||||||
|
PASS db 2 {"APIBurnFast": {"detected_seconds": 37.89571285247803, "resolved_seconds_after_restore": 22.452908277511597, "control_firing_samples": 0}, "APIBurnSlow": {"detected_seconds": 53.145692586898804, "resolved_seconds_after_restore": 37.67043972015381, "control_firing_samples": 0}}
|
||||||
|
worker 1 warmup 35
|
||||||
|
worker 1 brief 4
|
||||||
|
worker 1 brief_recovery 40
|
||||||
|
worker 1 sustained 75
|
||||||
|
worker 1 recovery 100
|
||||||
|
PASS worker 1 {"ReadyBurnFast": {"detected_seconds": 47.255120515823364, "resolved_seconds_after_restore": 29.54395031929016, "control_firing_samples": 0}, "ReadyBurnSlow": {"detected_seconds": 56.27066898345947, "resolved_seconds_after_restore": 41.70926570892334, "control_firing_samples": 0}}
|
||||||
|
worker 2 warmup 35
|
||||||
|
worker 2 brief 4
|
||||||
|
worker 2 brief_recovery 40
|
||||||
|
worker 2 sustained 75
|
||||||
|
worker 2 recovery 100
|
||||||
|
PASS worker 2 {"ReadyBurnFast": {"detected_seconds": 48.05506253242493, "resolved_seconds_after_restore": 29.119952917099, "control_firing_samples": 0}, "ReadyBurnSlow": {"detected_seconds": 60.2374165058136, "resolved_seconds_after_restore": 44.51889729499817, "control_firing_samples": 0}}
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
|||||||
|
PASS: lab6 public API scenario; infrastructure and grading evidence remain separate.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
PASS: lab6 public API scenario; infrastructure and grading evidence remain separate.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
PASS: lab6 public API scenario; infrastructure and grading evidence remain separate.
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
Network lyakhonov-lab6_default Creating
|
||||||
|
Network lyakhonov-lab6_default Created
|
||||||
|
Volume lyakhonov-lab6_s3_data Creating
|
||||||
|
Volume lyakhonov-lab6_s3_data Created
|
||||||
|
Volume lyakhonov-lab6_broker_data Creating
|
||||||
|
Volume lyakhonov-lab6_broker_data Created
|
||||||
|
Volume lyakhonov-lab6_postgres_data Creating
|
||||||
|
Volume lyakhonov-lab6_postgres_data Created
|
||||||
|
Container lyakhonov-lab6-redis-1 Creating
|
||||||
|
Container lyakhonov-lab6-broker-1 Creating
|
||||||
|
Container lyakhonov-lab6-s3-1 Creating
|
||||||
|
Container lyakhonov-lab6-db-1 Creating
|
||||||
|
Container lyakhonov-lab6-s3-1 Created
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Creating
|
||||||
|
Container lyakhonov-lab6-redis-1 Created
|
||||||
|
Container lyakhonov-lab6-broker-1 Created
|
||||||
|
Container lyakhonov-lab6-db-1 Created
|
||||||
|
Container lyakhonov-lab6-migrate-1 Creating
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Created
|
||||||
|
Container lyakhonov-lab6-migrate-1 Created
|
||||||
|
Container lyakhonov-lab6-staging-cleaner-1 Creating
|
||||||
|
Container lyakhonov-lab6-worker-1 Creating
|
||||||
|
Container lyakhonov-lab6-api-2 Creating
|
||||||
|
Container lyakhonov-lab6-dispatcher-1 Creating
|
||||||
|
Container lyakhonov-lab6-api-1 Creating
|
||||||
|
Container lyakhonov-lab6-worker-2 Creating
|
||||||
|
Container lyakhonov-lab6-worker-1 Created
|
||||||
|
Container lyakhonov-lab6-staging-cleaner-1 Created
|
||||||
|
Container lyakhonov-lab6-worker-2 Created
|
||||||
|
Container lyakhonov-lab6-dispatcher-1 Created
|
||||||
|
Container lyakhonov-lab6-api-2 Created
|
||||||
|
Container lyakhonov-lab6-api-1 Created
|
||||||
|
Container lyakhonov-lab6-lb-1 Creating
|
||||||
|
Container lyakhonov-lab6-lb-1 Created
|
||||||
|
Container lyakhonov-lab6-broker-1 Starting
|
||||||
|
Container lyakhonov-lab6-s3-1 Starting
|
||||||
|
Container lyakhonov-lab6-redis-1 Starting
|
||||||
|
Container lyakhonov-lab6-db-1 Starting
|
||||||
|
Container lyakhonov-lab6-s3-1 Started
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Starting
|
||||||
|
Container lyakhonov-lab6-db-1 Started
|
||||||
|
Container lyakhonov-lab6-db-1 Waiting
|
||||||
|
Container lyakhonov-lab6-broker-1 Started
|
||||||
|
Container lyakhonov-lab6-redis-1 Started
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Started
|
||||||
|
Container lyakhonov-lab6-db-1 Healthy
|
||||||
|
Container lyakhonov-lab6-migrate-1 Starting
|
||||||
|
Container lyakhonov-lab6-migrate-1 Started
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Waiting
|
||||||
|
Container lyakhonov-lab6-migrate-1 Waiting
|
||||||
|
Container lyakhonov-lab6-migrate-1 Waiting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Waiting
|
||||||
|
Container lyakhonov-lab6-broker-1 Waiting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Waiting
|
||||||
|
Container lyakhonov-lab6-broker-1 Waiting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Waiting
|
||||||
|
Container lyakhonov-lab6-migrate-1 Waiting
|
||||||
|
Container lyakhonov-lab6-migrate-1 Waiting
|
||||||
|
Container lyakhonov-lab6-migrate-1 Exited
|
||||||
|
Container lyakhonov-lab6-migrate-1 Exited
|
||||||
|
Container lyakhonov-lab6-migrate-1 Exited
|
||||||
|
Container lyakhonov-lab6-migrate-1 Exited
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Exited
|
||||||
|
Container lyakhonov-lab6-api-2 Starting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Exited
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Exited
|
||||||
|
Container lyakhonov-lab6-staging-cleaner-1 Starting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Exited
|
||||||
|
Container lyakhonov-lab6-api-2 Started
|
||||||
|
Container lyakhonov-lab6-api-1 Starting
|
||||||
|
Container lyakhonov-lab6-staging-cleaner-1 Started
|
||||||
|
Container lyakhonov-lab6-api-1 Started
|
||||||
|
Container lyakhonov-lab6-lb-1 Starting
|
||||||
|
Container lyakhonov-lab6-lb-1 Started
|
||||||
|
Container lyakhonov-lab6-broker-1 Healthy
|
||||||
|
Container lyakhonov-lab6-dispatcher-1 Starting
|
||||||
|
Container lyakhonov-lab6-broker-1 Healthy
|
||||||
|
Container lyakhonov-lab6-worker-2 Starting
|
||||||
|
Container lyakhonov-lab6-worker-2 Started
|
||||||
|
Container lyakhonov-lab6-worker-1 Starting
|
||||||
|
Container lyakhonov-lab6-dispatcher-1 Started
|
||||||
|
Container lyakhonov-lab6-worker-1 Started
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
Container lyakhonov-lab6-redis-1 Running
|
||||||
|
Container lyakhonov-lab6-tempo-1 Running
|
||||||
|
Container lyakhonov-lab6-prometheus-1 Running
|
||||||
|
Container lyakhonov-lab6-db-1 Running
|
||||||
|
Container lyakhonov-lab6-grafana-1 Running
|
||||||
|
Container lyakhonov-lab6-otel-collector-1 Running
|
||||||
|
Container lyakhonov-lab6-s3-1 Running
|
||||||
|
Container lyakhonov-lab6-loki-1 Running
|
||||||
|
Container lyakhonov-lab6-broker-1 Running
|
||||||
|
Container lyakhonov-lab6-migrate-1 Recreate
|
||||||
|
Container lyakhonov-lab6-migrate-1 Recreated
|
||||||
|
Container lyakhonov-lab6-dispatcher-1 Recreate
|
||||||
|
Container lyakhonov-lab6-worker-1 Recreate
|
||||||
|
Container lyakhonov-lab6-api-2 Recreate
|
||||||
|
Container lyakhonov-lab6-diagnostics-1 Recreate
|
||||||
|
Container lyakhonov-lab6-worker-2 Recreate
|
||||||
|
Container lyakhonov-lab6-staging-cleaner-1 Recreate
|
||||||
|
Container lyakhonov-lab6-api-1 Recreate
|
||||||
|
Container lyakhonov-lab6-dispatcher-1 Recreated
|
||||||
|
Container lyakhonov-lab6-worker-2 Recreated
|
||||||
|
Container lyakhonov-lab6-worker-1 Recreated
|
||||||
|
Container lyakhonov-lab6-api-1 Recreated
|
||||||
|
Container lyakhonov-lab6-staging-cleaner-1 Recreated
|
||||||
|
Container lyakhonov-lab6-api-2 Recreated
|
||||||
|
Container lyakhonov-lab6-lb-1 Running
|
||||||
|
Container lyakhonov-lab6-diagnostics-1 Recreated
|
||||||
|
Container lyakhonov-lab6-db-1 Waiting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Starting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Started
|
||||||
|
Container lyakhonov-lab6-db-1 Healthy
|
||||||
|
Container lyakhonov-lab6-migrate-1 Starting
|
||||||
|
Container lyakhonov-lab6-migrate-1 Started
|
||||||
|
Container lyakhonov-lab6-migrate-1 Waiting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Waiting
|
||||||
|
Container lyakhonov-lab6-migrate-1 Waiting
|
||||||
|
Container lyakhonov-lab6-broker-1 Waiting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Waiting
|
||||||
|
Container lyakhonov-lab6-broker-1 Waiting
|
||||||
|
Container lyakhonov-lab6-migrate-1 Waiting
|
||||||
|
Container lyakhonov-lab6-migrate-1 Waiting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Waiting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Waiting
|
||||||
|
Container lyakhonov-lab6-migrate-1 Waiting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Waiting
|
||||||
|
Container lyakhonov-lab6-broker-1 Healthy
|
||||||
|
Container lyakhonov-lab6-broker-1 Healthy
|
||||||
|
Container lyakhonov-lab6-migrate-1 Exited
|
||||||
|
Container lyakhonov-lab6-migrate-1 Exited
|
||||||
|
Container lyakhonov-lab6-migrate-1 Exited
|
||||||
|
Container lyakhonov-lab6-migrate-1 Exited
|
||||||
|
Container lyakhonov-lab6-migrate-1 Exited
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Exited
|
||||||
|
Container lyakhonov-lab6-diagnostics-1 Starting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Exited
|
||||||
|
Container lyakhonov-lab6-dispatcher-1 Starting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Exited
|
||||||
|
Container lyakhonov-lab6-api-1 Starting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Exited
|
||||||
|
Container lyakhonov-lab6-staging-cleaner-1 Starting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Exited
|
||||||
|
Container lyakhonov-lab6-worker-2 Starting
|
||||||
|
Container lyakhonov-lab6-api-1 Started
|
||||||
|
Container lyakhonov-lab6-api-2 Starting
|
||||||
|
Container lyakhonov-lab6-worker-2 Started
|
||||||
|
Container lyakhonov-lab6-worker-1 Starting
|
||||||
|
Container lyakhonov-lab6-dispatcher-1 Started
|
||||||
|
Container lyakhonov-lab6-diagnostics-1 Started
|
||||||
|
Container lyakhonov-lab6-staging-cleaner-1 Started
|
||||||
|
Container lyakhonov-lab6-api-2 Started
|
||||||
|
Container lyakhonov-lab6-worker-1 Started
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
Container lyakhonov-lab6-prometheus-1 Running
|
||||||
|
Container lyakhonov-lab6-broker-1 Running
|
||||||
|
Container lyakhonov-lab6-s3-1 Running
|
||||||
|
Container lyakhonov-lab6-db-1 Running
|
||||||
|
Container lyakhonov-lab6-redis-1 Running
|
||||||
|
Container lyakhonov-lab6-loki-1 Running
|
||||||
|
Container lyakhonov-lab6-otel-collector-1 Running
|
||||||
|
Container lyakhonov-lab6-tempo-1 Running
|
||||||
|
Container lyakhonov-lab6-grafana-1 Running
|
||||||
|
Container lyakhonov-lab6-migrate-1 Recreate
|
||||||
|
Container lyakhonov-lab6-migrate-1 Recreated
|
||||||
|
Container lyakhonov-lab6-diagnostics-1 Recreate
|
||||||
|
Container lyakhonov-lab6-worker-1 Recreate
|
||||||
|
Container lyakhonov-lab6-worker-2 Recreate
|
||||||
|
Container lyakhonov-lab6-staging-cleaner-1 Recreate
|
||||||
|
Container lyakhonov-lab6-dispatcher-1 Recreate
|
||||||
|
Container lyakhonov-lab6-api-2 Recreate
|
||||||
|
Container lyakhonov-lab6-api-1 Recreate
|
||||||
|
Container lyakhonov-lab6-worker-1 Recreated
|
||||||
|
Container lyakhonov-lab6-dispatcher-1 Recreated
|
||||||
|
Container lyakhonov-lab6-worker-2 Recreated
|
||||||
|
Container lyakhonov-lab6-staging-cleaner-1 Recreated
|
||||||
|
Container lyakhonov-lab6-api-1 Recreated
|
||||||
|
Container lyakhonov-lab6-api-2 Recreated
|
||||||
|
Container lyakhonov-lab6-lb-1 Running
|
||||||
|
Container lyakhonov-lab6-diagnostics-1 Recreated
|
||||||
|
Container lyakhonov-lab6-db-1 Waiting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Starting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Started
|
||||||
|
Container lyakhonov-lab6-db-1 Healthy
|
||||||
|
Container lyakhonov-lab6-migrate-1 Starting
|
||||||
|
Container lyakhonov-lab6-migrate-1 Started
|
||||||
|
Container lyakhonov-lab6-broker-1 Waiting
|
||||||
|
Container lyakhonov-lab6-migrate-1 Waiting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Waiting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Waiting
|
||||||
|
Container lyakhonov-lab6-migrate-1 Waiting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Waiting
|
||||||
|
Container lyakhonov-lab6-broker-1 Waiting
|
||||||
|
Container lyakhonov-lab6-migrate-1 Waiting
|
||||||
|
Container lyakhonov-lab6-migrate-1 Waiting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Waiting
|
||||||
|
Container lyakhonov-lab6-migrate-1 Waiting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Waiting
|
||||||
|
Container lyakhonov-lab6-broker-1 Healthy
|
||||||
|
Container lyakhonov-lab6-broker-1 Healthy
|
||||||
|
Container lyakhonov-lab6-migrate-1 Exited
|
||||||
|
Container lyakhonov-lab6-migrate-1 Exited
|
||||||
|
Container lyakhonov-lab6-migrate-1 Exited
|
||||||
|
Container lyakhonov-lab6-migrate-1 Exited
|
||||||
|
Container lyakhonov-lab6-migrate-1 Exited
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Exited
|
||||||
|
Container lyakhonov-lab6-worker-2 Starting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Exited
|
||||||
|
Container lyakhonov-lab6-api-1 Starting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Exited
|
||||||
|
Container lyakhonov-lab6-staging-cleaner-1 Starting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Exited
|
||||||
|
Container lyakhonov-lab6-diagnostics-1 Starting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Exited
|
||||||
|
Container lyakhonov-lab6-dispatcher-1 Starting
|
||||||
|
Container lyakhonov-lab6-api-1 Started
|
||||||
|
Container lyakhonov-lab6-api-2 Starting
|
||||||
|
Container lyakhonov-lab6-dispatcher-1 Started
|
||||||
|
Container lyakhonov-lab6-worker-2 Started
|
||||||
|
Container lyakhonov-lab6-worker-1 Starting
|
||||||
|
Container lyakhonov-lab6-staging-cleaner-1 Started
|
||||||
|
Container lyakhonov-lab6-diagnostics-1 Started
|
||||||
|
Container lyakhonov-lab6-api-2 Started
|
||||||
|
Container lyakhonov-lab6-worker-1 Started
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
Container lyakhonov-lab6-redis-1 Running
|
||||||
|
Container lyakhonov-lab6-loki-1 Running
|
||||||
|
Container lyakhonov-lab6-prometheus-1 Running
|
||||||
|
Container lyakhonov-lab6-db-1 Running
|
||||||
|
Container lyakhonov-lab6-broker-1 Running
|
||||||
|
Container lyakhonov-lab6-tempo-1 Running
|
||||||
|
Container lyakhonov-lab6-grafana-1 Running
|
||||||
|
Container lyakhonov-lab6-otel-collector-1 Running
|
||||||
|
Container lyakhonov-lab6-s3-1 Running
|
||||||
|
Container lyakhonov-lab6-migrate-1 Recreate
|
||||||
|
Container lyakhonov-lab6-migrate-1 Recreated
|
||||||
|
Container lyakhonov-lab6-staging-cleaner-1 Recreate
|
||||||
|
Container lyakhonov-lab6-api-1 Recreate
|
||||||
|
Container lyakhonov-lab6-api-2 Recreate
|
||||||
|
Container lyakhonov-lab6-diagnostics-1 Recreate
|
||||||
|
Container lyakhonov-lab6-worker-2 Recreate
|
||||||
|
Container lyakhonov-lab6-worker-1 Recreate
|
||||||
|
Container lyakhonov-lab6-dispatcher-1 Recreate
|
||||||
|
Container lyakhonov-lab6-dispatcher-1 Recreated
|
||||||
|
Container lyakhonov-lab6-worker-1 Recreated
|
||||||
|
Container lyakhonov-lab6-worker-2 Recreated
|
||||||
|
Container lyakhonov-lab6-diagnostics-1 Recreated
|
||||||
|
Container lyakhonov-lab6-api-1 Recreated
|
||||||
|
Container lyakhonov-lab6-api-2 Recreated
|
||||||
|
Container lyakhonov-lab6-lb-1 Running
|
||||||
|
Container lyakhonov-lab6-staging-cleaner-1 Recreated
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Starting
|
||||||
|
Container lyakhonov-lab6-db-1 Waiting
|
||||||
|
Container lyakhonov-lab6-db-1 Healthy
|
||||||
|
Container lyakhonov-lab6-migrate-1 Starting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Started
|
||||||
|
Container lyakhonov-lab6-migrate-1 Started
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Waiting
|
||||||
|
Container lyakhonov-lab6-broker-1 Waiting
|
||||||
|
Container lyakhonov-lab6-migrate-1 Waiting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Waiting
|
||||||
|
Container lyakhonov-lab6-migrate-1 Waiting
|
||||||
|
Container lyakhonov-lab6-broker-1 Waiting
|
||||||
|
Container lyakhonov-lab6-migrate-1 Waiting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Waiting
|
||||||
|
Container lyakhonov-lab6-migrate-1 Waiting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Waiting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Waiting
|
||||||
|
Container lyakhonov-lab6-migrate-1 Waiting
|
||||||
|
Container lyakhonov-lab6-broker-1 Healthy
|
||||||
|
Container lyakhonov-lab6-broker-1 Healthy
|
||||||
|
Container lyakhonov-lab6-migrate-1 Exited
|
||||||
|
Container lyakhonov-lab6-migrate-1 Exited
|
||||||
|
Container lyakhonov-lab6-migrate-1 Exited
|
||||||
|
Container lyakhonov-lab6-migrate-1 Exited
|
||||||
|
Container lyakhonov-lab6-migrate-1 Exited
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Exited
|
||||||
|
Container lyakhonov-lab6-diagnostics-1 Starting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Exited
|
||||||
|
Container lyakhonov-lab6-staging-cleaner-1 Starting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Exited
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Exited
|
||||||
|
Container lyakhonov-lab6-dispatcher-1 Starting
|
||||||
|
Container lyakhonov-lab6-worker-1 Starting
|
||||||
|
Container lyakhonov-lab6-bucket-init-1 Exited
|
||||||
|
Container lyakhonov-lab6-api-2 Starting
|
||||||
|
Container lyakhonov-lab6-worker-1 Started
|
||||||
|
Container lyakhonov-lab6-worker-2 Starting
|
||||||
|
Container lyakhonov-lab6-api-2 Started
|
||||||
|
Container lyakhonov-lab6-api-1 Starting
|
||||||
|
Container lyakhonov-lab6-staging-cleaner-1 Started
|
||||||
|
Container lyakhonov-lab6-dispatcher-1 Started
|
||||||
|
Container lyakhonov-lab6-diagnostics-1 Started
|
||||||
|
Container lyakhonov-lab6-worker-2 Started
|
||||||
|
Container lyakhonov-lab6-api-1 Started
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
PASS: two ready API instances, healthy DB/broker, required background containers running
|
||||||
|
PASS: historical traces, logs and metrics survive storage container recreation with volumes
|
||||||
@@ -0,0 +1,432 @@
|
|||||||
|
{
|
||||||
|
"before_containers": [
|
||||||
|
{
|
||||||
|
"id": "dcce0dbef9da4b5ae16773ca933c2c1a4a1b4e22c9129590a9892768c8b61bb1",
|
||||||
|
"service": "api",
|
||||||
|
"image_id": "sha256:80c3d2e7ef27177eeacbfa64b42e5bb01d3c5b8266b8acf18d78d74de1dd7cc3",
|
||||||
|
"image_name": "lyakhonov-messenger:lab6",
|
||||||
|
"started_at": "2026-11-27T14:19:26.186664939Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 671088640,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "6a2cdd955eadc952ad264062d81aedd7610e13af7f7c984486f92510a1db9a50",
|
||||||
|
"service": "api",
|
||||||
|
"image_id": "sha256:80c3d2e7ef27177eeacbfa64b42e5bb01d3c5b8266b8acf18d78d74de1dd7cc3",
|
||||||
|
"image_name": "lyakhonov-messenger:lab6",
|
||||||
|
"started_at": "2026-11-27T14:19:26.448287382Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 671088640,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "67250f581ff773c0f5daec64696792f6ef7fbbafed2fcc937bcd45edd96d28ad",
|
||||||
|
"service": "broker",
|
||||||
|
"image_id": "sha256:8a73e9185f8420247c5b3c19231df18dfac28a8d5706203e13b291934044966d",
|
||||||
|
"image_name": "rabbitmq:4.1.0-alpine",
|
||||||
|
"started_at": "2026-11-27T13:45:10.97424342Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 536870912,
|
||||||
|
"nano_cpus": 750000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "a132f04f36935cdb0d11035f589a5cb4e5838538f184e7a32f0dcf6f99e18ef5",
|
||||||
|
"service": "bucket-init",
|
||||||
|
"image_id": "sha256:abf4f50d6ffa16b55f0d02beec9f769386363f756aa0a15dc811887c3bdedf3f",
|
||||||
|
"image_name": "lyakhonov-storage:lab6",
|
||||||
|
"started_at": "2026-11-27T14:19:22.740870264Z",
|
||||||
|
"status": "exited",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 134217728,
|
||||||
|
"nano_cpus": 250000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "8b2ac7682adccd6538de7c20f623ae01dd138898cc3ff0d3fffa6bd04c5870ae",
|
||||||
|
"service": "db",
|
||||||
|
"image_id": "sha256:1d04b9ba1d4996401f2552b51beda8187f175c0645c091e4781134fc9c9a3eef",
|
||||||
|
"image_name": "postgres:16.6-alpine",
|
||||||
|
"started_at": "2026-11-27T13:45:10.139067021Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 536870912,
|
||||||
|
"nano_cpus": 1000000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "aceeab789db850a85c410f4ca28fd179614bc3d0b2453d26061dd7d0faefe52f",
|
||||||
|
"service": "diagnostics",
|
||||||
|
"image_id": "sha256:80c3d2e7ef27177eeacbfa64b42e5bb01d3c5b8266b8acf18d78d74de1dd7cc3",
|
||||||
|
"image_name": "lyakhonov-messenger:lab6",
|
||||||
|
"started_at": "2026-11-27T14:19:26.18391717Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 134217728,
|
||||||
|
"nano_cpus": 250000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "5ccc7f4f085b5f70537b6c452657c993851530685a469963712e88890c6b315c",
|
||||||
|
"service": "dispatcher",
|
||||||
|
"image_id": "sha256:80c3d2e7ef27177eeacbfa64b42e5bb01d3c5b8266b8acf18d78d74de1dd7cc3",
|
||||||
|
"image_name": "lyakhonov-messenger:lab6",
|
||||||
|
"started_at": "2026-11-27T14:19:26.194270287Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 268435456,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "fe879ab1e1e5a4d7761a03ab03e08aa614cf3194555d3362ba5a54a8e1ec8eba",
|
||||||
|
"service": "grafana",
|
||||||
|
"image_id": "sha256:35c41e0fd0295f5d0ee5db7e780cf33506abfaf47686196f825364889dee878b",
|
||||||
|
"image_name": "grafana/grafana:12.2.1",
|
||||||
|
"started_at": "2026-11-27T13:41:04.086803753Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 402653184,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "7eead7f9124d5e42bad9d977aeeaf851f52075586b23462e94b81e64c4a13525",
|
||||||
|
"service": "lb",
|
||||||
|
"image_id": "sha256:c22c8710886104a48b920306f063401f0d11811858e3c6b9d87d88a7556b2e61",
|
||||||
|
"image_name": "haproxy:3.0.6-alpine",
|
||||||
|
"started_at": "2026-11-27T13:45:09.878536759Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 134217728,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "d7eaf54f7dfa6ce43ca84e7630c357ba834d13826a07f1656d532bbd1aa8133d",
|
||||||
|
"service": "loki",
|
||||||
|
"image_id": "sha256:0eaee7bf39cc83aaef46914fb58f287d4f4c4be6ec96b86c2ed55719a75e49c8",
|
||||||
|
"image_name": "grafana/loki:3.5.7",
|
||||||
|
"started_at": "2026-11-27T13:41:03.943038494Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 402653184,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "b2d4fd2ba0bb08e1cfb9ce5f381bb3e536d493c292cf72e9dbe32ad21e464b53",
|
||||||
|
"service": "migrate",
|
||||||
|
"image_id": "sha256:80c3d2e7ef27177eeacbfa64b42e5bb01d3c5b8266b8acf18d78d74de1dd7cc3",
|
||||||
|
"image_name": "lyakhonov-messenger:lab6",
|
||||||
|
"started_at": "2026-11-27T14:19:23.274888457Z",
|
||||||
|
"status": "exited",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 671088640,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "eb8394f106efd30c4ef99094c79301d866a8533050b8eacf28e0e08099331302",
|
||||||
|
"service": "otel-collector",
|
||||||
|
"image_id": "sha256:886722fe0f37af9d1fe24d29529253ec59fbf263b3b1df4facaf221373e19d23",
|
||||||
|
"image_name": "otel/opentelemetry-collector-contrib:0.137.0",
|
||||||
|
"started_at": "2026-11-27T13:41:03.918588049Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 268435456,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "888ff5ffe6db73757cc652ce5376c3c9a78df120683edf2be120c17e7967e058",
|
||||||
|
"service": "prometheus",
|
||||||
|
"image_id": "sha256:49214755b6153f90a597adcbff0252cc61069f8ab69ce8411285cd4a560e8038",
|
||||||
|
"image_name": "prom/prometheus:v3.7.3",
|
||||||
|
"started_at": "2026-11-27T13:50:22.24159232Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 402653184,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "db034935279f969cd150b4fbe32817cf1ae334820e5e5e9d1cd7e7939bcf8dbb",
|
||||||
|
"service": "redis",
|
||||||
|
"image_id": "sha256:c1e88455c85225310bbea54816e9c3f4b5295815e6dbf80c34d40afc6df28275",
|
||||||
|
"image_name": "redis:7.4.1-alpine",
|
||||||
|
"started_at": "2026-11-27T13:45:09.601677028Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 134217728,
|
||||||
|
"nano_cpus": 250000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "c24794f0b24a27553c978dfd55459a02784da6f637ef8c69b12b4b9cb8cac555",
|
||||||
|
"service": "s3",
|
||||||
|
"image_id": "sha256:abf4f50d6ffa16b55f0d02beec9f769386363f756aa0a15dc811887c3bdedf3f",
|
||||||
|
"image_name": "lyakhonov-storage:lab6",
|
||||||
|
"started_at": "2026-11-27T13:55:23.176637759Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 805306368,
|
||||||
|
"nano_cpus": 1000000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "1563a56286835d4258f837228c31fae6d8455a0b7099a61f979f4f0e417c08d5",
|
||||||
|
"service": "staging-cleaner",
|
||||||
|
"image_id": "sha256:80c3d2e7ef27177eeacbfa64b42e5bb01d3c5b8266b8acf18d78d74de1dd7cc3",
|
||||||
|
"image_name": "lyakhonov-messenger:lab6",
|
||||||
|
"started_at": "2026-11-27T14:19:26.192472806Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 268435456,
|
||||||
|
"nano_cpus": 250000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "d89bc7eca7813a5b8eff9c5c37497bf7feb0c1ad7251797d0f99af5f9eee2337",
|
||||||
|
"service": "tempo",
|
||||||
|
"image_id": "sha256:65a5789759435f1ef696f1953258b9bbdb18eb571d5ce711ff812d2e128288a4",
|
||||||
|
"image_name": "grafana/tempo:2.9.0",
|
||||||
|
"started_at": "2026-11-27T13:57:19.112705824Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 402653184,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "0716b69fcded44f9ca81b499806fa707cb80f5cbad412ec701859060044b0a9f",
|
||||||
|
"service": "worker",
|
||||||
|
"image_id": "sha256:80c3d2e7ef27177eeacbfa64b42e5bb01d3c5b8266b8acf18d78d74de1dd7cc3",
|
||||||
|
"image_name": "lyakhonov-messenger:lab6",
|
||||||
|
"started_at": "2026-11-27T14:19:26.596914241Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 805306368,
|
||||||
|
"nano_cpus": 750000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "d1967d83a486901bb76f7973471fdf733ce9abca882f8610229f580da8dc5d25",
|
||||||
|
"service": "worker",
|
||||||
|
"image_id": "sha256:80c3d2e7ef27177eeacbfa64b42e5bb01d3c5b8266b8acf18d78d74de1dd7cc3",
|
||||||
|
"image_name": "lyakhonov-messenger:lab6",
|
||||||
|
"started_at": "2026-11-27T14:19:26.189342306Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 805306368,
|
||||||
|
"nano_cpus": 750000000
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"after_containers": [
|
||||||
|
{
|
||||||
|
"id": "dcce0dbef9da4b5ae16773ca933c2c1a4a1b4e22c9129590a9892768c8b61bb1",
|
||||||
|
"service": "api",
|
||||||
|
"image_id": "sha256:80c3d2e7ef27177eeacbfa64b42e5bb01d3c5b8266b8acf18d78d74de1dd7cc3",
|
||||||
|
"image_name": "lyakhonov-messenger:lab6",
|
||||||
|
"started_at": "2026-11-27T14:19:26.186664939Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 671088640,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "6a2cdd955eadc952ad264062d81aedd7610e13af7f7c984486f92510a1db9a50",
|
||||||
|
"service": "api",
|
||||||
|
"image_id": "sha256:80c3d2e7ef27177eeacbfa64b42e5bb01d3c5b8266b8acf18d78d74de1dd7cc3",
|
||||||
|
"image_name": "lyakhonov-messenger:lab6",
|
||||||
|
"started_at": "2026-11-27T14:19:26.448287382Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 671088640,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "67250f581ff773c0f5daec64696792f6ef7fbbafed2fcc937bcd45edd96d28ad",
|
||||||
|
"service": "broker",
|
||||||
|
"image_id": "sha256:8a73e9185f8420247c5b3c19231df18dfac28a8d5706203e13b291934044966d",
|
||||||
|
"image_name": "rabbitmq:4.1.0-alpine",
|
||||||
|
"started_at": "2026-11-27T13:45:10.97424342Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 536870912,
|
||||||
|
"nano_cpus": 750000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "a132f04f36935cdb0d11035f589a5cb4e5838538f184e7a32f0dcf6f99e18ef5",
|
||||||
|
"service": "bucket-init",
|
||||||
|
"image_id": "sha256:abf4f50d6ffa16b55f0d02beec9f769386363f756aa0a15dc811887c3bdedf3f",
|
||||||
|
"image_name": "lyakhonov-storage:lab6",
|
||||||
|
"started_at": "2026-11-27T14:19:22.740870264Z",
|
||||||
|
"status": "exited",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 134217728,
|
||||||
|
"nano_cpus": 250000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "8b2ac7682adccd6538de7c20f623ae01dd138898cc3ff0d3fffa6bd04c5870ae",
|
||||||
|
"service": "db",
|
||||||
|
"image_id": "sha256:1d04b9ba1d4996401f2552b51beda8187f175c0645c091e4781134fc9c9a3eef",
|
||||||
|
"image_name": "postgres:16.6-alpine",
|
||||||
|
"started_at": "2026-11-27T13:45:10.139067021Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 536870912,
|
||||||
|
"nano_cpus": 1000000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "aceeab789db850a85c410f4ca28fd179614bc3d0b2453d26061dd7d0faefe52f",
|
||||||
|
"service": "diagnostics",
|
||||||
|
"image_id": "sha256:80c3d2e7ef27177eeacbfa64b42e5bb01d3c5b8266b8acf18d78d74de1dd7cc3",
|
||||||
|
"image_name": "lyakhonov-messenger:lab6",
|
||||||
|
"started_at": "2026-11-27T14:19:26.18391717Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 134217728,
|
||||||
|
"nano_cpus": 250000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "5ccc7f4f085b5f70537b6c452657c993851530685a469963712e88890c6b315c",
|
||||||
|
"service": "dispatcher",
|
||||||
|
"image_id": "sha256:80c3d2e7ef27177eeacbfa64b42e5bb01d3c5b8266b8acf18d78d74de1dd7cc3",
|
||||||
|
"image_name": "lyakhonov-messenger:lab6",
|
||||||
|
"started_at": "2026-11-27T14:19:26.194270287Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 268435456,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "fd238069b4c6e8710a45a8f177521e86d473157a3b7d9653bfa0f8c456bbec01",
|
||||||
|
"service": "grafana",
|
||||||
|
"image_id": "sha256:35c41e0fd0295f5d0ee5db7e780cf33506abfaf47686196f825364889dee878b",
|
||||||
|
"image_name": "grafana/grafana:12.2.1",
|
||||||
|
"started_at": "2026-11-27T14:19:55.991420476Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 402653184,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "7eead7f9124d5e42bad9d977aeeaf851f52075586b23462e94b81e64c4a13525",
|
||||||
|
"service": "lb",
|
||||||
|
"image_id": "sha256:c22c8710886104a48b920306f063401f0d11811858e3c6b9d87d88a7556b2e61",
|
||||||
|
"image_name": "haproxy:3.0.6-alpine",
|
||||||
|
"started_at": "2026-11-27T13:45:09.878536759Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 134217728,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "fc773e310e1eae54b2e73e03047b648af2ea46f667b3b89f060644e08f661c2a",
|
||||||
|
"service": "loki",
|
||||||
|
"image_id": "sha256:0eaee7bf39cc83aaef46914fb58f287d4f4c4be6ec96b86c2ed55719a75e49c8",
|
||||||
|
"image_name": "grafana/loki:3.5.7",
|
||||||
|
"started_at": "2026-11-27T14:19:55.969688171Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 402653184,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "b2d4fd2ba0bb08e1cfb9ce5f381bb3e536d493c292cf72e9dbe32ad21e464b53",
|
||||||
|
"service": "migrate",
|
||||||
|
"image_id": "sha256:80c3d2e7ef27177eeacbfa64b42e5bb01d3c5b8266b8acf18d78d74de1dd7cc3",
|
||||||
|
"image_name": "lyakhonov-messenger:lab6",
|
||||||
|
"started_at": "2026-11-27T14:19:23.274888457Z",
|
||||||
|
"status": "exited",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 671088640,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "eb8394f106efd30c4ef99094c79301d866a8533050b8eacf28e0e08099331302",
|
||||||
|
"service": "otel-collector",
|
||||||
|
"image_id": "sha256:886722fe0f37af9d1fe24d29529253ec59fbf263b3b1df4facaf221373e19d23",
|
||||||
|
"image_name": "otel/opentelemetry-collector-contrib:0.137.0",
|
||||||
|
"started_at": "2026-11-27T13:41:03.918588049Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 268435456,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "26aef64c2c079a6bd7f0058b8050687a3ea4807e6ac343eae92090f19b08e30c",
|
||||||
|
"service": "prometheus",
|
||||||
|
"image_id": "sha256:49214755b6153f90a597adcbff0252cc61069f8ab69ce8411285cd4a560e8038",
|
||||||
|
"image_name": "prom/prometheus:v3.7.3",
|
||||||
|
"started_at": "2026-11-27T14:19:55.988788641Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 402653184,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "db034935279f969cd150b4fbe32817cf1ae334820e5e5e9d1cd7e7939bcf8dbb",
|
||||||
|
"service": "redis",
|
||||||
|
"image_id": "sha256:c1e88455c85225310bbea54816e9c3f4b5295815e6dbf80c34d40afc6df28275",
|
||||||
|
"image_name": "redis:7.4.1-alpine",
|
||||||
|
"started_at": "2026-11-27T13:45:09.601677028Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 134217728,
|
||||||
|
"nano_cpus": 250000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "c24794f0b24a27553c978dfd55459a02784da6f637ef8c69b12b4b9cb8cac555",
|
||||||
|
"service": "s3",
|
||||||
|
"image_id": "sha256:abf4f50d6ffa16b55f0d02beec9f769386363f756aa0a15dc811887c3bdedf3f",
|
||||||
|
"image_name": "lyakhonov-storage:lab6",
|
||||||
|
"started_at": "2026-11-27T13:55:23.176637759Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 805306368,
|
||||||
|
"nano_cpus": 1000000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "1563a56286835d4258f837228c31fae6d8455a0b7099a61f979f4f0e417c08d5",
|
||||||
|
"service": "staging-cleaner",
|
||||||
|
"image_id": "sha256:80c3d2e7ef27177eeacbfa64b42e5bb01d3c5b8266b8acf18d78d74de1dd7cc3",
|
||||||
|
"image_name": "lyakhonov-messenger:lab6",
|
||||||
|
"started_at": "2026-11-27T14:19:26.192472806Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 268435456,
|
||||||
|
"nano_cpus": 250000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "bc3f7ac2f5718343126796584624c43452dbdb138ded3c37fe67aa83ce8756ea",
|
||||||
|
"service": "tempo",
|
||||||
|
"image_id": "sha256:65a5789759435f1ef696f1953258b9bbdb18eb571d5ce711ff812d2e128288a4",
|
||||||
|
"image_name": "grafana/tempo:2.9.0",
|
||||||
|
"started_at": "2026-11-27T14:19:55.974650121Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 402653184,
|
||||||
|
"nano_cpus": 500000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "0716b69fcded44f9ca81b499806fa707cb80f5cbad412ec701859060044b0a9f",
|
||||||
|
"service": "worker",
|
||||||
|
"image_id": "sha256:80c3d2e7ef27177eeacbfa64b42e5bb01d3c5b8266b8acf18d78d74de1dd7cc3",
|
||||||
|
"image_name": "lyakhonov-messenger:lab6",
|
||||||
|
"started_at": "2026-11-27T14:19:26.596914241Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 805306368,
|
||||||
|
"nano_cpus": 750000000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "d1967d83a486901bb76f7973471fdf733ce9abca882f8610229f580da8dc5d25",
|
||||||
|
"service": "worker",
|
||||||
|
"image_id": "sha256:80c3d2e7ef27177eeacbfa64b42e5bb01d3c5b8266b8acf18d78d74de1dd7cc3",
|
||||||
|
"image_name": "lyakhonov-messenger:lab6",
|
||||||
|
"started_at": "2026-11-27T14:19:26.189342306Z",
|
||||||
|
"status": "running",
|
||||||
|
"oom_killed": false,
|
||||||
|
"memory_limit": 805306368,
|
||||||
|
"nano_cpus": 750000000
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"trace_id": "3b47146d37f7eec67eb4eb1a7760cfbf",
|
||||||
|
"historical_query_time": 1795789182.4387877,
|
||||||
|
"span_count": 32,
|
||||||
|
"log_count": 3,
|
||||||
|
"metric_series": 22,
|
||||||
|
"same_spans": true,
|
||||||
|
"same_logs": true,
|
||||||
|
"same_metrics": true
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
PASS: result publication SQL failure recorded as retry, lease recovery, immutable bytes
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -eu
|
||||||
|
export RABBITMQ_DEFAULT_USER=messenger
|
||||||
|
export RABBITMQ_DEFAULT_PASS="$(cat /run/secrets/broker_password)"
|
||||||
|
exec /usr/local/bin/docker-entrypoint.sh rabbitmq-server
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
# Не включать set -x: аргументы содержат учебные credentials.
|
||||||
|
|
||||||
|
attempt=0
|
||||||
|
until mc alias set local http://s3:9000 "$(cat /run/secrets/s3_root_user)" "$(cat /run/secrets/s3_root_password)" >/dev/null 2>&1; do
|
||||||
|
attempt=$((attempt + 1))
|
||||||
|
if [ "$attempt" -ge 30 ]; then
|
||||||
|
echo 'S3 bootstrap timed out' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
|
mc mb --ignore-existing local/attachments >/dev/null
|
||||||
|
|
||||||
|
mc anonymous set none local/attachments >/dev/null
|
||||||
|
|
||||||
|
mc admin user add local "$(cat /run/secrets/s3_access_key)" "$(cat /run/secrets/s3_secret_key)" >/dev/null
|
||||||
|
|
||||||
|
mc admin policy create local attachments-app /bootstrap/policy.json >/dev/null
|
||||||
|
|
||||||
|
mc admin policy attach local attachments-app --user "$(cat /run/secrets/s3_access_key)" >/dev/null
|
||||||
|
|
||||||
|
echo 'Private bucket and restricted application user ready'
|
||||||
|
|
||||||
@@ -0,0 +1,499 @@
|
|||||||
|
{
|
||||||
|
"uid": "messenger-lab6",
|
||||||
|
"title": "Messenger: API, jobs and SLO",
|
||||||
|
"schemaVersion": 41,
|
||||||
|
"version": 1,
|
||||||
|
"refresh": "5s",
|
||||||
|
"time": {
|
||||||
|
"from": "now-30m",
|
||||||
|
"to": "now"
|
||||||
|
},
|
||||||
|
"panels": [
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"title": "HTTP successful RPS",
|
||||||
|
"type": "timeseries",
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "prometheus"
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"x": 0,
|
||||||
|
"y": 0,
|
||||||
|
"w": 12,
|
||||||
|
"h": 8
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"expr": "sum(rate(messenger_http_requests_total{status_class!=\"5xx\"}[1m]))",
|
||||||
|
"refId": "A",
|
||||||
|
"legendFormat": "{{service_name}} {{outcome}}"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"unit": "reqps"
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 2,
|
||||||
|
"title": "HTTP error ratio",
|
||||||
|
"type": "timeseries",
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "prometheus"
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"x": 12,
|
||||||
|
"y": 0,
|
||||||
|
"w": 12,
|
||||||
|
"h": 8
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"expr": "(sum(rate(messenger_http_requests_total{status_class=\"5xx\"}[1m])) or vector(0)) / clamp_min(sum(rate(messenger_http_requests_total[1m])),0.001)",
|
||||||
|
"refId": "A",
|
||||||
|
"legendFormat": "{{service_name}} {{outcome}}"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"unit": "percentunit"
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 3,
|
||||||
|
"title": "API p50/p95/p99",
|
||||||
|
"type": "timeseries",
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "prometheus"
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"x": 0,
|
||||||
|
"y": 8,
|
||||||
|
"w": 12,
|
||||||
|
"h": 8
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"expr": "histogram_quantile(0.5,sum by (le)(rate(messenger_http_duration_seconds_bucket[1m])))",
|
||||||
|
"refId": "A",
|
||||||
|
"legendFormat": "0.5"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"expr": "histogram_quantile(0.95,sum by (le)(rate(messenger_http_duration_seconds_bucket[1m])))",
|
||||||
|
"refId": "B",
|
||||||
|
"legendFormat": "0.95"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"expr": "histogram_quantile(0.99,sum by (le)(rate(messenger_http_duration_seconds_bucket[1m])))",
|
||||||
|
"refId": "C",
|
||||||
|
"legendFormat": "0.99"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"unit": "s"
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 4,
|
||||||
|
"title": "Jobs by outcome",
|
||||||
|
"type": "timeseries",
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "prometheus"
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"x": 12,
|
||||||
|
"y": 8,
|
||||||
|
"w": 12,
|
||||||
|
"h": 8
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"expr": "sum by (outcome)(rate(messenger_jobs_total[1m]))",
|
||||||
|
"refId": "A",
|
||||||
|
"legendFormat": "{{service_name}} {{outcome}}"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"unit": "ops"
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 5,
|
||||||
|
"title": "Worker p95",
|
||||||
|
"type": "timeseries",
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "prometheus"
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"x": 0,
|
||||||
|
"y": 16,
|
||||||
|
"w": 12,
|
||||||
|
"h": 8
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"expr": "histogram_quantile(0.95,sum by (le)(rate(messenger_job_duration_seconds_bucket[1m])))",
|
||||||
|
"refId": "A",
|
||||||
|
"legendFormat": "{{service_name}} {{outcome}}"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"unit": "s"
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 6,
|
||||||
|
"title": "Queue depth",
|
||||||
|
"type": "timeseries",
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "prometheus"
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"x": 12,
|
||||||
|
"y": 16,
|
||||||
|
"w": 12,
|
||||||
|
"h": 8
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"expr": "messenger_queue_depth",
|
||||||
|
"refId": "A",
|
||||||
|
"legendFormat": "{{service_name}} {{outcome}}"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"unit": "short"
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 7,
|
||||||
|
"title": "Oldest unfinished job",
|
||||||
|
"type": "timeseries",
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "prometheus"
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"x": 0,
|
||||||
|
"y": 24,
|
||||||
|
"w": 12,
|
||||||
|
"h": 8
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"expr": "messenger_queue_oldest_seconds",
|
||||||
|
"refId": "A",
|
||||||
|
"legendFormat": "{{service_name}} {{outcome}}"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"unit": "s"
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 8,
|
||||||
|
"title": "DB pool used / waiting",
|
||||||
|
"type": "timeseries",
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "prometheus"
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"x": 12,
|
||||||
|
"y": 24,
|
||||||
|
"w": 12,
|
||||||
|
"h": 8
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"expr": "{__name__=~\"messenger_db_pool_(used|waiting)\"}",
|
||||||
|
"refId": "A",
|
||||||
|
"legendFormat": "{{service_name}} {{outcome}}"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"unit": "short"
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 9,
|
||||||
|
"title": "Worker busy / capacity",
|
||||||
|
"type": "timeseries",
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "prometheus"
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"x": 0,
|
||||||
|
"y": 32,
|
||||||
|
"w": 12,
|
||||||
|
"h": 8
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"expr": "{__name__=~\"messenger_worker_(busy|capacity)\"}",
|
||||||
|
"refId": "A",
|
||||||
|
"legendFormat": "{{service_name}} {{outcome}}"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"unit": "short"
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 10,
|
||||||
|
"title": "Time to ready p95",
|
||||||
|
"type": "timeseries",
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "prometheus"
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"x": 12,
|
||||||
|
"y": 32,
|
||||||
|
"w": 12,
|
||||||
|
"h": 8
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"expr": "histogram_quantile(0.95,sum by (le)(rate(messenger_ready_duration_seconds_bucket[1m])))",
|
||||||
|
"refId": "A",
|
||||||
|
"legendFormat": "{{service_name}} {{outcome}}"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"unit": "s"
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 11,
|
||||||
|
"title": "Process maximum RSS",
|
||||||
|
"type": "timeseries",
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "prometheus"
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"x": 0,
|
||||||
|
"y": 40,
|
||||||
|
"w": 12,
|
||||||
|
"h": 8
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"expr": "messenger_process_maxrss_bytes",
|
||||||
|
"refId": "A",
|
||||||
|
"legendFormat": "{{service_name}} {{outcome}}"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"unit": "bytes"
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 12,
|
||||||
|
"title": "Process CPU cores",
|
||||||
|
"type": "timeseries",
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "prometheus"
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"x": 12,
|
||||||
|
"y": 40,
|
||||||
|
"w": 12,
|
||||||
|
"h": 8
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"expr": "sum by (service_name)(rate(messenger_process_cpu_seconds_total[1m]))",
|
||||||
|
"refId": "A",
|
||||||
|
"legendFormat": "{{service_name}} {{outcome}}"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"unit": "short"
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 13,
|
||||||
|
"title": "API SLI, rolling 2 min",
|
||||||
|
"type": "timeseries",
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "prometheus"
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"x": 0,
|
||||||
|
"y": 48,
|
||||||
|
"w": 12,
|
||||||
|
"h": 8
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"expr": "1 - ((sum(rate(messenger_http_requests_total{status_class=\"5xx\"}[2m])) or vector(0)) / clamp_min(sum(rate(messenger_http_requests_total[2m])),0.001))",
|
||||||
|
"refId": "A",
|
||||||
|
"legendFormat": "API SLI, rolling 2 min"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"unit": "percentunit"
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 14,
|
||||||
|
"title": "Ready SLI, rolling cohort 2 min",
|
||||||
|
"type": "timeseries",
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "prometheus"
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"x": 12,
|
||||||
|
"y": 48,
|
||||||
|
"w": 12,
|
||||||
|
"h": 8
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"expr": "(1 - sum(messenger_ready_window_bad{window=\"2m\"}) / clamp_min(sum(messenger_ready_window_total{window=\"2m\"}),1)) and on() (sum(messenger_ready_window_total{window=\"2m\"}) > 0)",
|
||||||
|
"refId": "A",
|
||||||
|
"legendFormat": "Ready SLI, rolling cohort 2 min"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"unit": "percentunit"
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 15,
|
||||||
|
"title": "API burn, short window",
|
||||||
|
"type": "timeseries",
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "prometheus"
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"x": 0,
|
||||||
|
"y": 56,
|
||||||
|
"w": 12,
|
||||||
|
"h": 8
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"expr": "sum(rate(messenger_http_requests_total{status_class=\"5xx\"}[15s])) / clamp_min(sum(rate(messenger_http_requests_total[15s])),0.001) / 0.01",
|
||||||
|
"refId": "A",
|
||||||
|
"legendFormat": "API burn, short window"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"unit": "short"
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 16,
|
||||||
|
"title": "Ready burn, short window",
|
||||||
|
"type": "timeseries",
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "prometheus"
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"x": 12,
|
||||||
|
"y": 56,
|
||||||
|
"w": 12,
|
||||||
|
"h": 8
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"expr": "sum(messenger_ready_window_bad{window=\"15s\"}) / clamp_min(sum(messenger_ready_window_total{window=\"15s\"}),1) / 0.05",
|
||||||
|
"refId": "A",
|
||||||
|
"legendFormat": "Ready burn, short window"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"unit": "short"
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 17,
|
||||||
|
"title": "Local firing alerts",
|
||||||
|
"type": "timeseries",
|
||||||
|
"datasource": {
|
||||||
|
"type": "prometheus",
|
||||||
|
"uid": "prometheus"
|
||||||
|
},
|
||||||
|
"gridPos": {
|
||||||
|
"x": 0,
|
||||||
|
"y": 64,
|
||||||
|
"w": 12,
|
||||||
|
"h": 8
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"expr": "ALERTS{alertstate=\"firing\"}",
|
||||||
|
"refId": "A",
|
||||||
|
"legendFormat": "Local firing alerts"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"unit": "short"
|
||||||
|
},
|
||||||
|
"overrides": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
apiVersion: 1
|
||||||
|
providers:
|
||||||
|
- name: messenger
|
||||||
|
type: file
|
||||||
|
options:
|
||||||
|
path: /var/lib/grafana/dashboards
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
apiVersion: 1
|
||||||
|
datasources:
|
||||||
|
- name: Prometheus
|
||||||
|
uid: prometheus
|
||||||
|
type: prometheus
|
||||||
|
url: http://prometheus:9090
|
||||||
|
isDefault: true
|
||||||
|
editable: false
|
||||||
|
- name: Loki
|
||||||
|
uid: loki
|
||||||
|
type: loki
|
||||||
|
url: http://loki:3100
|
||||||
|
editable: false
|
||||||
|
jsonData:
|
||||||
|
derivedFields:
|
||||||
|
- name: TraceID
|
||||||
|
matcherRegex: '"trace_id":"([a-f0-9]{32})"'
|
||||||
|
datasourceUid: tempo
|
||||||
|
url: '$${__value.raw}'
|
||||||
|
- name: Tempo
|
||||||
|
uid: tempo
|
||||||
|
type: tempo
|
||||||
|
url: http://tempo:3200
|
||||||
|
editable: false
|
||||||
|
jsonData:
|
||||||
|
tracesToLogsV2:
|
||||||
|
datasourceUid: loki
|
||||||
|
spanStartTimeShift: '-1m'
|
||||||
|
spanEndTimeShift: '1m'
|
||||||
|
filterByTraceID: true
|
||||||
|
tags: [{key: service.name, value: service_name}]
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
global
|
||||||
|
log stdout format raw local0
|
||||||
|
maxconn 1024
|
||||||
|
defaults
|
||||||
|
mode http
|
||||||
|
log global
|
||||||
|
timeout connect 1s
|
||||||
|
timeout client 60s
|
||||||
|
timeout server 45s
|
||||||
|
timeout check 1s
|
||||||
|
retries 0
|
||||||
|
resolvers docker
|
||||||
|
nameserver dns 127.0.0.11:53
|
||||||
|
resolve_retries 2
|
||||||
|
timeout resolve 1s
|
||||||
|
timeout retry 1s
|
||||||
|
hold valid 1s
|
||||||
|
hold obsolete 1s
|
||||||
|
frontend public
|
||||||
|
bind :8080
|
||||||
|
default_backend application
|
||||||
|
backend application
|
||||||
|
balance roundrobin
|
||||||
|
option httpchk GET /health/ready
|
||||||
|
http-check expect status 200
|
||||||
|
default-server inter 1s fastinter 500ms downinter 1s fall 2 rise 1
|
||||||
|
server-template api 1-4 api:8080 check resolvers docker init-addr none
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
groups:
|
||||||
|
- name: messenger-slo
|
||||||
|
interval: 5s
|
||||||
|
rules:
|
||||||
|
- alert: HighAPIErrorRate
|
||||||
|
expr: sum(rate(messenger_http_requests_total{status_class="5xx"}[30s])) / clamp_min(sum(rate(messenger_http_requests_total[30s])),0.001)
|
||||||
|
> 0.1
|
||||||
|
for: 10s
|
||||||
|
labels:
|
||||||
|
severity: warning
|
||||||
|
annotations:
|
||||||
|
summary: API 5xx >10%; inspect DB spans and pool
|
||||||
|
runbook: RUNBOOK.md
|
||||||
|
- alert: QueueLag
|
||||||
|
expr: messenger_queue_oldest_seconds > 10 and messenger_queue_depth > 0
|
||||||
|
for: 10s
|
||||||
|
labels:
|
||||||
|
severity: warning
|
||||||
|
annotations:
|
||||||
|
summary: Unfinished job age >10s; inspect worker busy/capacity and consume logs
|
||||||
|
runbook: RUNBOOK.md
|
||||||
|
- alert: APIBurnFast
|
||||||
|
expr: (sum(rate(messenger_http_requests_total{status_class="5xx"}[15s])) / clamp_min(sum(rate(messenger_http_requests_total[15s])),0.001)
|
||||||
|
/ 0.01 > 14.4) and (sum(rate(messenger_http_requests_total{status_class="5xx"}[1m]))
|
||||||
|
/ clamp_min(sum(rate(messenger_http_requests_total[1m])),0.001) / 0.01 > 14.4)
|
||||||
|
for: 15s
|
||||||
|
labels:
|
||||||
|
severity: critical
|
||||||
|
annotations:
|
||||||
|
summary: API budget burn >14.4 in 15s AND 1m
|
||||||
|
runbook: RUNBOOK.md#api
|
||||||
|
- alert: ReadyBurnFast
|
||||||
|
expr: (sum(messenger_ready_window_bad{window="15s"}) / clamp_min(sum(messenger_ready_window_total{window="15s"}),1)
|
||||||
|
/ 0.05 > 6) and (sum(messenger_ready_window_bad{window="1m"}) / clamp_min(sum(messenger_ready_window_total{window="1m"}),1)
|
||||||
|
/ 0.05 > 6)
|
||||||
|
for: 15s
|
||||||
|
labels:
|
||||||
|
severity: critical
|
||||||
|
annotations:
|
||||||
|
summary: Time-to-ready budget burn in 15s AND 1m, unfinished/failed included
|
||||||
|
runbook: RUNBOOK.md#ready
|
||||||
|
- alert: APIBurnSlow
|
||||||
|
expr: (sum(rate(messenger_http_requests_total{status_class="5xx"}[30s])) / clamp_min(sum(rate(messenger_http_requests_total[30s])),0.001)
|
||||||
|
/ 0.01 > 6) and (sum(rate(messenger_http_requests_total{status_class="5xx"}[2m]))
|
||||||
|
/ clamp_min(sum(rate(messenger_http_requests_total[2m])),0.001) / 0.01 > 6)
|
||||||
|
for: 30s
|
||||||
|
labels:
|
||||||
|
severity: critical
|
||||||
|
annotations:
|
||||||
|
summary: API budget burn >6 in 30s AND 2m
|
||||||
|
runbook: RUNBOOK.md#api
|
||||||
|
- alert: ReadyBurnSlow
|
||||||
|
expr: (sum(messenger_ready_window_bad{window="30s"}) / clamp_min(sum(messenger_ready_window_total{window="30s"}),1)
|
||||||
|
/ 0.05 > 3) and (sum(messenger_ready_window_bad{window="2m"}) / clamp_min(sum(messenger_ready_window_total{window="2m"}),1)
|
||||||
|
/ 0.05 > 3)
|
||||||
|
for: 30s
|
||||||
|
labels:
|
||||||
|
severity: critical
|
||||||
|
annotations:
|
||||||
|
summary: Time-to-ready budget burn in 30s AND 2m, unfinished/failed included
|
||||||
|
runbook: RUNBOOK.md#ready
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
receivers:
|
||||||
|
otlp:
|
||||||
|
protocols:
|
||||||
|
http:
|
||||||
|
endpoint: 0.0.0.0:4318
|
||||||
|
processors:
|
||||||
|
memory_limiter:
|
||||||
|
check_interval: 1s
|
||||||
|
limit_mib: 160
|
||||||
|
spike_limit_mib: 32
|
||||||
|
batch:
|
||||||
|
timeout: 1s
|
||||||
|
send_batch_size: 128
|
||||||
|
send_batch_max_size: 256
|
||||||
|
exporters:
|
||||||
|
prometheus:
|
||||||
|
endpoint: 0.0.0.0:8889
|
||||||
|
resource_to_telemetry_conversion:
|
||||||
|
enabled: true
|
||||||
|
otlphttp/tempo:
|
||||||
|
endpoint: http://tempo:4318
|
||||||
|
timeout: 2s
|
||||||
|
retry_on_failure:
|
||||||
|
initial_interval: 1s
|
||||||
|
max_interval: 5s
|
||||||
|
max_elapsed_time: 15s
|
||||||
|
sending_queue:
|
||||||
|
queue_size: 128
|
||||||
|
num_consumers: 2
|
||||||
|
otlphttp/loki:
|
||||||
|
endpoint: http://loki:3100/otlp
|
||||||
|
timeout: 2s
|
||||||
|
retry_on_failure:
|
||||||
|
initial_interval: 1s
|
||||||
|
max_interval: 5s
|
||||||
|
max_elapsed_time: 15s
|
||||||
|
sending_queue:
|
||||||
|
queue_size: 128
|
||||||
|
num_consumers: 2
|
||||||
|
service:
|
||||||
|
telemetry:
|
||||||
|
metrics:
|
||||||
|
level: detailed
|
||||||
|
readers:
|
||||||
|
- pull:
|
||||||
|
exporter:
|
||||||
|
prometheus:
|
||||||
|
host: 0.0.0.0
|
||||||
|
port: 8888
|
||||||
|
pipelines:
|
||||||
|
traces:
|
||||||
|
receivers: [otlp]
|
||||||
|
processors: [memory_limiter, batch]
|
||||||
|
exporters: [otlphttp/tempo]
|
||||||
|
metrics:
|
||||||
|
receivers: [otlp]
|
||||||
|
processors: [memory_limiter, batch]
|
||||||
|
exporters: [prometheus]
|
||||||
|
logs:
|
||||||
|
receivers: [otlp]
|
||||||
|
processors: [memory_limiter, batch]
|
||||||
|
exporters: [otlphttp/loki]
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
auth_enabled: false
|
||||||
|
server:
|
||||||
|
http_listen_port: 3100
|
||||||
|
common:
|
||||||
|
path_prefix: /loki
|
||||||
|
replication_factor: 1
|
||||||
|
ring:
|
||||||
|
kvstore:
|
||||||
|
store: inmemory
|
||||||
|
storage:
|
||||||
|
filesystem:
|
||||||
|
chunks_directory: /loki/chunks
|
||||||
|
rules_directory: /loki/rules
|
||||||
|
schema_config:
|
||||||
|
configs:
|
||||||
|
- from: 2024-01-01
|
||||||
|
store: tsdb
|
||||||
|
object_store: filesystem
|
||||||
|
schema: v13
|
||||||
|
index:
|
||||||
|
prefix: index_
|
||||||
|
period: 24h
|
||||||
|
limits_config:
|
||||||
|
allow_structured_metadata: true
|
||||||
|
retention_period: 24h
|
||||||
|
compactor:
|
||||||
|
working_directory: /loki/compactor
|
||||||
|
retention_enabled: true
|
||||||
|
delete_request_store: filesystem
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
global:
|
||||||
|
scrape_interval: 5s
|
||||||
|
evaluation_interval: 5s
|
||||||
|
rule_files: [/etc/prometheus/alerts.yaml]
|
||||||
|
scrape_configs:
|
||||||
|
- job_name: application
|
||||||
|
static_configs:
|
||||||
|
- targets: [otel-collector:8889]
|
||||||
|
- job_name: collector
|
||||||
|
static_configs:
|
||||||
|
- targets: [otel-collector:8888]
|
||||||
|
- job_name: backlog
|
||||||
|
static_configs:
|
||||||
|
- targets: [diagnostics:9099]
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
server:
|
||||||
|
http_listen_port: 3200
|
||||||
|
distributor:
|
||||||
|
receivers:
|
||||||
|
otlp:
|
||||||
|
protocols:
|
||||||
|
http:
|
||||||
|
endpoint: 0.0.0.0:4318
|
||||||
|
ingester:
|
||||||
|
max_block_duration: 1m
|
||||||
|
compactor:
|
||||||
|
compaction:
|
||||||
|
block_retention: 24h
|
||||||
|
storage:
|
||||||
|
trace:
|
||||||
|
backend: local
|
||||||
|
wal:
|
||||||
|
path: /var/tempo/wal
|
||||||
|
local:
|
||||||
|
path: /var/tempo/blocks
|
||||||
|
usage_report:
|
||||||
|
reporting_enabled: false
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
heartbeat = 180
|
||||||
|
vm_memory_high_watermark.absolute = 300MiB
|
||||||
|
disk_free_limit.absolute = 200MiB
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -eu
|
||||||
|
export MINIO_ROOT_USER="$(cat "$MINIO_ROOT_USER_FILE")"
|
||||||
|
export MINIO_ROOT_PASSWORD="$(cat "$MINIO_ROOT_PASSWORD_FILE")"
|
||||||
|
exec minio "$@"
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":["s3:ListBucket"],"Resource":["arn:aws:s3:::attachments"],"Condition":{"StringLike":{"s3:prefix":["staging/*"]}}},{"Effect":"Allow","Action":["s3:GetObject","s3:PutObject"],"Resource":["arn:aws:s3:::attachments/originals/*","arn:aws:s3:::attachments/variants/*"]},{"Effect":"Allow","Action":["s3:GetObject","s3:PutObject","s3:DeleteObject"],"Resource":["arn:aws:s3:::attachments/staging/*"]}]}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
LAB6_PORT=8086
|
||||||
|
API_REPLICAS=2
|
||||||
|
SESSION_TTL_SECONDS=3600
|
||||||
|
WORKER_CONCURRENCY=2
|
||||||
|
JOB_MAX_ATTEMPTS=5
|
||||||
|
JOB_TIMEOUT_SECONDS=60
|
||||||
|
STAGING_RETENTION_SECONDS=86400
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
CREATE TABLE users (
|
||||||
|
id uuid PRIMARY KEY,
|
||||||
|
username varchar(32) NOT NULL UNIQUE CHECK (username ~ '^[a-z0-9_]{3,32}$'),
|
||||||
|
display_name varchar(100) NOT NULL CHECK (length(btrim(display_name)) > 0),
|
||||||
|
password_hash text NOT NULL,
|
||||||
|
created_at timestamptz NOT NULL DEFAULT clock_timestamp()
|
||||||
|
);
|
||||||
|
CREATE TABLE chats (
|
||||||
|
id uuid PRIMARY KEY,
|
||||||
|
title varchar(100) NOT NULL CHECK (length(btrim(title)) > 0),
|
||||||
|
created_at timestamptz NOT NULL DEFAULT clock_timestamp()
|
||||||
|
);
|
||||||
|
CREATE TABLE chat_members (
|
||||||
|
chat_id uuid NOT NULL REFERENCES chats(id),
|
||||||
|
user_id uuid NOT NULL REFERENCES users(id),
|
||||||
|
PRIMARY KEY (chat_id, user_id)
|
||||||
|
);
|
||||||
|
CREATE INDEX chat_members_user_idx ON chat_members (user_id, chat_id);
|
||||||
|
CREATE TABLE messages (
|
||||||
|
id uuid PRIMARY KEY,
|
||||||
|
chat_id uuid NOT NULL REFERENCES chats(id),
|
||||||
|
sender_id uuid NOT NULL REFERENCES users(id),
|
||||||
|
text varchar(4000) NOT NULL CHECK (length(btrim(text)) > 0),
|
||||||
|
created_at timestamptz NOT NULL DEFAULT clock_timestamp(),
|
||||||
|
FOREIGN KEY (chat_id, sender_id) REFERENCES chat_members(chat_id, user_id)
|
||||||
|
);
|
||||||
|
CREATE INDEX messages_history_idx ON messages (chat_id, created_at, id);
|
||||||
|
CREATE TABLE sessions (
|
||||||
|
token_hash char(64) PRIMARY KEY,
|
||||||
|
user_id uuid NOT NULL REFERENCES users(id),
|
||||||
|
expires_at timestamptz NOT NULL
|
||||||
|
);
|
||||||
|
CREATE INDEX sessions_expiry_idx ON sessions (expires_at);
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
CREATE TABLE message_requests (
|
||||||
|
user_id uuid NOT NULL REFERENCES users(id),
|
||||||
|
chat_id uuid NOT NULL REFERENCES chats(id),
|
||||||
|
key varchar(128) NOT NULL,
|
||||||
|
body text NOT NULL,
|
||||||
|
message_id uuid NOT NULL REFERENCES messages(id),
|
||||||
|
expires_at timestamptz NOT NULL,
|
||||||
|
PRIMARY KEY (user_id, chat_id, key)
|
||||||
|
);
|
||||||
|
CREATE INDEX message_requests_expiry_idx ON message_requests(expires_at);
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
ALTER TABLE messages DROP CONSTRAINT messages_text_check;␍
|
||||||
|
ALTER TABLE messages ADD CONSTRAINT messages_text_limit CHECK (length(text)<=4000);␍
|
||||||
|
CREATE TABLE attachments (␍
|
||||||
|
id uuid PRIMARY KEY, chat_id uuid NOT NULL REFERENCES chats(id),␍
|
||||||
|
owner_id uuid NOT NULL REFERENCES users(id), object_key text NOT NULL UNIQUE,␍
|
||||||
|
filename text NOT NULL, content_type text NOT NULL, size_bytes integer NOT NULL,␍
|
||||||
|
sha256 char(64) NOT NULL, state text NOT NULL CHECK(state IN ('ready','missing')),␍
|
||||||
|
created_at timestamptz NOT NULL DEFAULT clock_timestamp(),␍
|
||||||
|
updated_at timestamptz NOT NULL DEFAULT clock_timestamp(),␍
|
||||||
|
FOREIGN KEY(chat_id,owner_id) REFERENCES chat_members(chat_id,user_id)␍
|
||||||
|
);␍
|
||||||
|
CREATE TABLE message_attachments (␍
|
||||||
|
message_id uuid NOT NULL REFERENCES messages(id), attachment_id uuid NOT NULL REFERENCES attachments(id),␍
|
||||||
|
position integer NOT NULL, PRIMARY KEY(message_id,attachment_id), UNIQUE(message_id,position)␍
|
||||||
|
);␍
|
||||||
|
-- Старые сохранённые ключи теперь сравнивают полное нормализованное тело.␍
|
||||||
|
UPDATE message_requests SET body=json_build_object('text',body,'attachment_ids',json_build_array())::text;␍
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
ALTER TABLE attachments DROP CONSTRAINT attachments_state_check;
|
||||||
|
UPDATE attachments SET state = 'failed' WHERE state = 'missing';
|
||||||
|
ALTER TABLE attachments ADD COLUMN error_code text;
|
||||||
|
UPDATE attachments SET error_code = 'original_unavailable' WHERE state = 'failed';
|
||||||
|
ALTER TABLE attachments ADD CONSTRAINT attachments_pipeline_state CHECK (
|
||||||
|
state IN ('queued', 'processing', 'ready', 'failed')
|
||||||
|
AND ((state = 'failed') = (error_code IS NOT NULL))
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE attachment_jobs (
|
||||||
|
id uuid PRIMARY KEY,
|
||||||
|
attachment_id uuid NOT NULL UNIQUE REFERENCES attachments(id),
|
||||||
|
staging_key text NOT NULL UNIQUE,
|
||||||
|
created_at timestamptz NOT NULL DEFAULT clock_timestamp(),
|
||||||
|
attempt integer NOT NULL DEFAULT 1 CHECK (attempt >= 1),
|
||||||
|
attempt_limit integer NOT NULL CHECK (attempt_limit >= 1),
|
||||||
|
state text NOT NULL DEFAULT 'queued' CHECK (state IN ('queued', 'processing', 'ready', 'failed')),
|
||||||
|
next_publish_at timestamptz,
|
||||||
|
published_at timestamptz,
|
||||||
|
publish_failures integer NOT NULL DEFAULT 0,
|
||||||
|
lease_until timestamptz,
|
||||||
|
lease_token uuid,
|
||||||
|
last_error text,
|
||||||
|
CHECK ((lease_until IS NULL) = (lease_token IS NULL))
|
||||||
|
);
|
||||||
|
CREATE INDEX attachment_jobs_outbox ON attachment_jobs(next_publish_at)
|
||||||
|
WHERE next_publish_at IS NOT NULL;
|
||||||
|
CREATE INDEX attachment_jobs_leases ON attachment_jobs(lease_until)
|
||||||
|
WHERE lease_until IS NOT NULL;
|
||||||
|
|
||||||
|
CREATE TABLE attachment_variants (
|
||||||
|
attachment_id uuid NOT NULL REFERENCES attachments(id),
|
||||||
|
name text NOT NULL CHECK (name IN ('thumbnail', 'crop', 'optimized')),
|
||||||
|
object_key text NOT NULL UNIQUE,
|
||||||
|
content_type text NOT NULL,
|
||||||
|
size_bytes integer NOT NULL CHECK (size_bytes > 0),
|
||||||
|
sha256 char(64) NOT NULL,
|
||||||
|
width integer NOT NULL CHECK (width > 0),
|
||||||
|
height integer NOT NULL CHECK (height > 0),
|
||||||
|
PRIMARY KEY (attachment_id, name)
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE attachment_replays (
|
||||||
|
job_id uuid NOT NULL REFERENCES attachment_jobs(id),
|
||||||
|
attempt integer NOT NULL,
|
||||||
|
reason text NOT NULL,
|
||||||
|
created_at timestamptz NOT NULL DEFAULT clock_timestamp(),
|
||||||
|
PRIMARY KEY (job_id, attempt)
|
||||||
|
);
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
ALTER TABLE attachments
|
||||||
|
ADD COLUMN target_pipeline_version integer NOT NULL DEFAULT 1 CHECK (target_pipeline_version >= 1),
|
||||||
|
ADD COLUMN published_pipeline_version integer CHECK (published_pipeline_version >= 1),
|
||||||
|
ADD CHECK (published_pipeline_version <= target_pipeline_version);
|
||||||
|
UPDATE attachments SET published_pipeline_version = 1 WHERE state = 'ready';
|
||||||
|
|
||||||
|
ALTER TABLE attachment_jobs
|
||||||
|
DROP CONSTRAINT attachment_jobs_attachment_id_key,
|
||||||
|
DROP CONSTRAINT attachment_jobs_staging_key_key,
|
||||||
|
DROP CONSTRAINT attachment_jobs_state_check,
|
||||||
|
ADD COLUMN pipeline_version integer NOT NULL DEFAULT 1 CHECK (pipeline_version >= 1),
|
||||||
|
ADD COLUMN settled_at timestamptz,
|
||||||
|
ADD CHECK (state IN ('queued', 'processing', 'ready', 'failed', 'superseded')),
|
||||||
|
ADD UNIQUE (attachment_id, pipeline_version);
|
||||||
|
CREATE INDEX attachment_jobs_staging ON attachment_jobs(staging_key);
|
||||||
|
|
||||||
|
ALTER TABLE attachment_variants ADD COLUMN pipeline_version integer NOT NULL DEFAULT 1;
|
||||||
|
ALTER TABLE attachment_variants DROP CONSTRAINT attachment_variants_pkey;
|
||||||
|
ALTER TABLE attachment_variants ADD PRIMARY KEY (attachment_id, pipeline_version, name);
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
CREATE TABLE experiment_faults (
|
||||||
|
job_id uuid NOT NULL REFERENCES attachment_jobs(id),
|
||||||
|
point text NOT NULL,
|
||||||
|
action text NOT NULL CHECK (action IN ('crash', 'pause')),
|
||||||
|
hit_at timestamptz,
|
||||||
|
process_id integer,
|
||||||
|
released boolean NOT NULL DEFAULT false,
|
||||||
|
PRIMARY KEY (job_id, point)
|
||||||
|
);
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE attachment_jobs ADD COLUMN trace_context jsonb NOT NULL DEFAULT '{}'::jsonb;
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
annotated-types==0.8.0
|
||||||
|
anyio==4.16.0
|
||||||
|
argon2-cffi==23.1.0
|
||||||
|
argon2-cffi-bindings==26.2.0
|
||||||
|
attrs==26.1.0
|
||||||
|
boto3==1.40.61
|
||||||
|
botocore==1.40.76
|
||||||
|
certifi==2026.11.20
|
||||||
|
cffi==2.1.1
|
||||||
|
charset-normalizer==3.5.3
|
||||||
|
click==8.5.1
|
||||||
|
colorama==0.4.6
|
||||||
|
contourpy==1.4.0
|
||||||
|
cycler==0.12.1
|
||||||
|
fastapi==0.115.0
|
||||||
|
fonttools==4.69.1
|
||||||
|
googleapis-common-protos==1.76.0
|
||||||
|
h11==0.16.0
|
||||||
|
httptools==0.9.0
|
||||||
|
idna==3.20
|
||||||
|
importlib_metadata==8.7.1
|
||||||
|
jmespath==1.1.0
|
||||||
|
jsonschema==4.26.0
|
||||||
|
jsonschema-path==0.3.4
|
||||||
|
jsonschema-specifications==2025.9.1
|
||||||
|
kiwisolver==1.5.1
|
||||||
|
lazy-object-proxy==1.13.0
|
||||||
|
matplotlib==3.10.7
|
||||||
|
numpy==2.5.5
|
||||||
|
openapi-schema-validator==0.6.3
|
||||||
|
openapi-spec-validator==0.7.2
|
||||||
|
opentelemetry-api==1.38.0
|
||||||
|
opentelemetry-exporter-otlp-proto-common==1.38.0
|
||||||
|
opentelemetry-exporter-otlp-proto-http==1.38.0
|
||||||
|
opentelemetry-instrumentation==0.59b0
|
||||||
|
opentelemetry-instrumentation-botocore==0.59b0
|
||||||
|
opentelemetry-instrumentation-dbapi==0.59b0
|
||||||
|
opentelemetry-instrumentation-psycopg==0.59b0
|
||||||
|
opentelemetry-propagator-aws-xray==1.0.2
|
||||||
|
opentelemetry-proto==1.38.0
|
||||||
|
opentelemetry-sdk==1.38.0
|
||||||
|
opentelemetry-semantic-conventions==0.59b0
|
||||||
|
packaging==26.4
|
||||||
|
pathable==0.4.4
|
||||||
|
pika==1.3.2
|
||||||
|
pillow==12.0.0
|
||||||
|
protobuf==6.33.6
|
||||||
|
psycopg==3.2.3
|
||||||
|
psycopg-binary==3.2.3
|
||||||
|
psycopg-pool==3.2.4
|
||||||
|
pycparser==3.12
|
||||||
|
pydantic==2.9.2
|
||||||
|
pydantic_core==2.23.4
|
||||||
|
pyparsing==3.3.3
|
||||||
|
python-dateutil==2.9.0.post0
|
||||||
|
python-dotenv==1.2.4
|
||||||
|
PyYAML==6.0.4
|
||||||
|
redis==5.2.0
|
||||||
|
referencing==0.36.2
|
||||||
|
requests==2.34.2
|
||||||
|
rfc3339-validator==0.1.4
|
||||||
|
rpds-py==2026.9.1
|
||||||
|
s3transfer==0.14.0
|
||||||
|
six==1.17.0
|
||||||
|
starlette==0.38.6
|
||||||
|
typing_extensions==4.16.0
|
||||||
|
tzdata==2026.6
|
||||||
|
urllib3==2.8.0
|
||||||
|
uvicorn==0.32.0
|
||||||
|
watchfiles==1.3.0
|
||||||
|
websockets==17.4
|
||||||
|
wrapt==1.17.3
|
||||||
|
zipp==4.1.2
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
matplotlib==3.10.7
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
annotated-types==0.8.0
|
||||||
|
anyio==4.16.0
|
||||||
|
argon2-cffi==23.1.0
|
||||||
|
argon2-cffi-bindings==26.2.0
|
||||||
|
attrs==26.1.0
|
||||||
|
boto3==1.40.61
|
||||||
|
botocore==1.40.76
|
||||||
|
certifi==2026.11.20
|
||||||
|
cffi==2.1.1
|
||||||
|
charset-normalizer==3.5.3
|
||||||
|
click==8.5.1
|
||||||
|
colorama==0.4.6
|
||||||
|
fastapi==0.115.0
|
||||||
|
googleapis-common-protos==1.76.0
|
||||||
|
h11==0.16.0
|
||||||
|
httptools==0.9.0
|
||||||
|
idna==3.20
|
||||||
|
importlib_metadata==8.7.1
|
||||||
|
jmespath==1.1.0
|
||||||
|
jsonschema==4.26.0
|
||||||
|
jsonschema-path==0.3.4
|
||||||
|
jsonschema-specifications==2025.9.1
|
||||||
|
lazy-object-proxy==1.13.0
|
||||||
|
openapi-schema-validator==0.6.3
|
||||||
|
openapi-spec-validator==0.7.2
|
||||||
|
opentelemetry-api==1.38.0
|
||||||
|
opentelemetry-exporter-otlp-proto-common==1.38.0
|
||||||
|
opentelemetry-exporter-otlp-proto-http==1.38.0
|
||||||
|
opentelemetry-instrumentation==0.59b0
|
||||||
|
opentelemetry-instrumentation-botocore==0.59b0
|
||||||
|
opentelemetry-instrumentation-dbapi==0.59b0
|
||||||
|
opentelemetry-instrumentation-psycopg==0.59b0
|
||||||
|
opentelemetry-propagator-aws-xray==1.0.2
|
||||||
|
opentelemetry-proto==1.38.0
|
||||||
|
opentelemetry-sdk==1.38.0
|
||||||
|
opentelemetry-semantic-conventions==0.59b0
|
||||||
|
packaging==26.4
|
||||||
|
pathable==0.4.4
|
||||||
|
pika==1.3.2
|
||||||
|
pillow==12.0.0
|
||||||
|
protobuf==6.33.6
|
||||||
|
psycopg==3.2.3
|
||||||
|
psycopg-binary==3.2.3
|
||||||
|
psycopg-pool==3.2.4
|
||||||
|
pycparser==3.12
|
||||||
|
pydantic==2.9.2
|
||||||
|
pydantic_core==2.23.4
|
||||||
|
python-dateutil==2.9.0.post0
|
||||||
|
python-dotenv==1.2.4
|
||||||
|
PyYAML==6.0.4
|
||||||
|
redis==5.2.0
|
||||||
|
referencing==0.36.2
|
||||||
|
requests==2.34.2
|
||||||
|
rfc3339-validator==0.1.4
|
||||||
|
rpds-py==2026.9.1
|
||||||
|
s3transfer==0.14.0
|
||||||
|
six==1.17.0
|
||||||
|
starlette==0.38.6
|
||||||
|
typing_extensions==4.16.0
|
||||||
|
tzdata==2026.6
|
||||||
|
urllib3==2.8.0
|
||||||
|
uvicorn==0.32.0
|
||||||
|
watchfiles==1.3.0
|
||||||
|
websockets==17.4
|
||||||
|
wrapt==1.17.3
|
||||||
|
zipp==4.1.2
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
fastapi==0.115.0
|
||||||
|
uvicorn[standard]==0.32.0
|
||||||
|
pydantic==2.9.2
|
||||||
|
psycopg[binary]==3.2.3
|
||||||
|
psycopg-pool==3.2.4
|
||||||
|
argon2-cffi==23.1.0
|
||||||
|
redis==5.2.0
|
||||||
|
|
||||||
|
boto3==1.40.61
|
||||||
|
Pillow==12.0.0
|
||||||
|
pika==1.3.2
|
||||||
|
|
||||||
|
opentelemetry-sdk==1.38.0
|
||||||
|
opentelemetry-exporter-otlp-proto-http==1.38.0
|
||||||
|
opentelemetry-instrumentation-psycopg==0.59b0
|
||||||
|
opentelemetry-instrumentation-botocore==0.59b0
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
"""Windows hooks for the public resilience client."""
|
||||||
|
|
||||||
|
import os
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
ROOT = Path(__file__).resolve().parents[1]
|
||||||
|
|
||||||
|
|
||||||
|
def docker(*args):
|
||||||
|
return subprocess.check_output(['docker', *args], cwd=ROOT, text=True).strip()
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
if sys.argv[1] == 'restart':
|
||||||
|
docker('compose', 'restart', '-t', '4', 'db', 'redis', 's3', 'broker', 'api',
|
||||||
|
'dispatcher', 'worker', 'staging-cleaner', 'lb')
|
||||||
|
return
|
||||||
|
target = os.environ['TARGET_INSTANCE_ID']
|
||||||
|
for container in docker('compose', 'ps', '-q', 'api').splitlines():
|
||||||
|
name = docker('inspect', '--format', '{{.Config.Hostname}}', container)
|
||||||
|
prefix, _, suffix = target.rpartition('-')
|
||||||
|
if prefix == name and len(suffix) == 8:
|
||||||
|
docker('stop', '-t', '2', container)
|
||||||
|
return
|
||||||
|
raise SystemExit('API instance not found')
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
"""Preserved course materials, local author identities and absence of local secrets."""
|
||||||
|
import hashlib
|
||||||
|
import json
|
||||||
|
from pathlib import Path
|
||||||
|
import re
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
|
ROOT=Path(__file__).resolve().parents[1]
|
||||||
|
BASE='470d9d6'
|
||||||
|
|
||||||
|
|
||||||
|
def git(*args,cwd=ROOT):return subprocess.check_output(['git',*args],cwd=cwd)
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
original=git('ls-tree','-r','--name-only',BASE).decode().splitlines()
|
||||||
|
protected=[p for p in original if p!='REPORT.md']
|
||||||
|
changed=[]
|
||||||
|
for name in protected:
|
||||||
|
expected=git('show',BASE+':'+name).replace(b'\r\n',b'\n')
|
||||||
|
actual=(ROOT/name).read_bytes().replace(b'\r\n',b'\n')
|
||||||
|
if expected!=actual:changed.append(name)
|
||||||
|
tracked=git('ls-files','-z').decode().split('\0')
|
||||||
|
forbidden=[p for p in tracked if p.startswith(('secrets/','.env','data/','volumes/')) and p!='.env.example']
|
||||||
|
local_secrets=[p.read_bytes().strip() for p in (ROOT/'secrets').glob('*') if p.is_file() and p.stat().st_size>8]
|
||||||
|
leaks=[]
|
||||||
|
inspected=sorted(set(tracked)|{p.relative_to(ROOT).as_posix() for p in (ROOT/'evidence').rglob('*') if p.is_file()})
|
||||||
|
for name in inspected:
|
||||||
|
if not name or not (ROOT/name).is_file():continue
|
||||||
|
content=(ROOT/name).read_bytes()
|
||||||
|
if any(secret in content for secret in local_secrets):leaks.append(name)
|
||||||
|
if b'-----BEGIN '+b'PRIVATE KEY-----' in content:leaks.append(name)
|
||||||
|
identities=git('log',BASE+'..HEAD','--format=%H|%an|%ae|%cn|%ce').decode().splitlines()
|
||||||
|
invalid=[line for line in identities if line.split('|')[1:]!=['Sergey Lyakhonov','lyserg119@gmail.com','Sergey Lyakhonov','lyserg119@gmail.com']]
|
||||||
|
previous={}
|
||||||
|
for lab in (4,5):
|
||||||
|
folder=ROOT.parent/f'vysoko-nagr {lab}'
|
||||||
|
previous[str(lab)]={'head':git('rev-parse','HEAD',cwd=folder).decode().strip(),
|
||||||
|
'status':git('status','--porcelain',cwd=folder).decode(),'branch':git('branch','--show-current',cwd=folder).decode().strip()}
|
||||||
|
result={'protected_count':len(protected),'changed_originals':changed,'forbidden_paths':forbidden,
|
||||||
|
'secret_leaks':sorted(set(leaks)),'commits':identities,'invalid_identities':invalid,'previous':previous,
|
||||||
|
'head_at_capture':git('rev-parse','HEAD').decode().strip(),
|
||||||
|
'status_at_capture':git('status','--short').decode()}
|
||||||
|
if '--check-only' not in sys.argv:
|
||||||
|
(ROOT/'evidence/audit.json').write_text(json.dumps(result,ensure_ascii=False,indent=2),encoding='utf-8')
|
||||||
|
assert not (changed or forbidden or leaks or invalid),result
|
||||||
|
assert all(not value['status'] for value in previous.values()),'previous lab modified'
|
||||||
|
assert previous['4']['head']=='8f112e092a10d72a98c3d9d4554c52b81ebff2b3'
|
||||||
|
assert previous['5']['head'].startswith('9dd2a03')
|
||||||
|
print('PASS: original materials, author/committer, tracked secrets, previous labs; HEAD',result['head_at_capture'])
|
||||||
|
|
||||||
|
|
||||||
|
if __name__=='__main__':main()
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
"""Создаёт только отсутствующие локальные секреты и конфигурацию."""
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
|
from secrets import token_hex
|
||||||
|
from urllib.parse import quote
|
||||||
|
|
||||||
|
ROOT = Path(__file__).resolve().parents[1]
|
||||||
|
|
||||||
|
|
||||||
|
def create(path, value):
|
||||||
|
try:
|
||||||
|
with path.open('x', encoding='utf-8') as target:
|
||||||
|
target.write(value)
|
||||||
|
except FileExistsError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
directory = ROOT / 'secrets'
|
||||||
|
directory.mkdir(mode=0o700, exist_ok=True)
|
||||||
|
for name in ('db_password', 'broker_password', 's3_root_user', 's3_root_password',
|
||||||
|
's3_access_key', 's3_secret_key', 'grafana_password'):
|
||||||
|
create(directory / name, token_hex(24))
|
||||||
|
db = quote((directory / 'db_password').read_text(encoding='utf-8').strip(), safe='')
|
||||||
|
broker = quote((directory / 'broker_password').read_text(encoding='utf-8').strip(), safe='')
|
||||||
|
create(directory / 'database_url', f'postgresql://messenger:{db}@db:5432/messenger')
|
||||||
|
create(directory / 'broker_url', f'amqp://messenger:{broker}@broker:5672/%2F')
|
||||||
|
create(ROOT / '.env', (ROOT / 'lab6.env.example').read_text(encoding='utf-8'))
|
||||||
|
print('Локальные файлы готовы')
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
"""Separate permanent drop logs from counters of failed export attempts."""
|
||||||
|
from datetime import datetime, timezone
|
||||||
|
import json
|
||||||
|
from pathlib import Path
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
|
ROOT=Path(__file__).resolve().parents[1]
|
||||||
|
sys.path.insert(0,str(ROOT/'student-tests'))
|
||||||
|
from common import dc
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
path=ROOT/'evidence/incidents.json'
|
||||||
|
data=json.loads(path.read_text(encoding='utf-8'))
|
||||||
|
samples=data['backend_outage']['samples']
|
||||||
|
start=min(s['time'] for s in samples)-10
|
||||||
|
end=max(s['time'] for s in samples)+25
|
||||||
|
drops=[]
|
||||||
|
for line in dc('logs','--no-color','--no-log-prefix','otel-collector').splitlines():
|
||||||
|
match=re.search(r'"dropped_items"\s*:\s*(\d+)',line)
|
||||||
|
if not match:continue
|
||||||
|
stamp=line.split()[0]
|
||||||
|
epoch=datetime.fromisoformat(stamp.replace('Z','+00:00')).timestamp()
|
||||||
|
if start<=epoch<=end:
|
||||||
|
drops.append({'time':stamp,'dropped_items':int(match.group(1)),
|
||||||
|
'signal':'spans' if 'otlphttp/tempo' in line else 'other'})
|
||||||
|
memory=[]
|
||||||
|
for sample in samples:
|
||||||
|
for line in sample['stats'].splitlines():
|
||||||
|
row=json.loads(line)
|
||||||
|
if 'otel-collector' not in row.get('Name',''):continue
|
||||||
|
match=re.match(r'([\d.]+)MiB',row['MemUsage'])
|
||||||
|
if match:memory.append({'time':sample['time'],'memory_mib':float(match.group(1))})
|
||||||
|
data['collector_drop_logs']=drops
|
||||||
|
data['collector_dropped_spans_observed']=sum(r['dropped_items'] for r in drops if r['signal']=='spans')
|
||||||
|
data['collector_memory_samples']=memory
|
||||||
|
path.write_text(json.dumps(data,ensure_ascii=False,indent=2),encoding='utf-8')
|
||||||
|
print('Observed permanently dropped spans:',data['collector_dropped_spans_observed'])
|
||||||
|
print('Collector sampled MiB:',min(r['memory_mib'] for r in memory),max(r['memory_mib'] for r in memory))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__=='__main__':main()
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
"""Only sanitized environment fields; never serialize Docker Config.Env or secrets."""
|
||||||
|
import json
|
||||||
|
from pathlib import Path
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
|
ROOT=Path(__file__).resolve().parents[1]
|
||||||
|
sys.path.insert(0,str(ROOT/'student-tests'))
|
||||||
|
from common import snapshot,save,PROJECT
|
||||||
|
|
||||||
|
|
||||||
|
def command(*args):return subprocess.check_output(args,text=True,cwd=ROOT).strip()
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
other=[]
|
||||||
|
for cid in command('docker','ps','-aq').split():
|
||||||
|
row=json.loads(command('docker','inspect',cid))[0]
|
||||||
|
project=row['Config'].get('Labels',{}).get('com.docker.compose.project','')
|
||||||
|
if project != PROJECT:
|
||||||
|
other.append({'id':row['Id'],'project':project,'started_at':row['State']['StartedAt'],
|
||||||
|
'state':row['State']['Status']})
|
||||||
|
data={'commit':command('git','rev-parse','HEAD'),'whoami':command('whoami'),
|
||||||
|
'application_commit':command('git','log','-1','--format=%H','--','src'),
|
||||||
|
'local_python':sys.version,
|
||||||
|
'docker_context':command('docker','context','show'),
|
||||||
|
'docker_version':json.loads(command('docker','version','--format','{{json .}}')),
|
||||||
|
'docker_resources':command('docker','info','--format','{{.NCPU}} CPUs {{.MemTotal}} bytes'),
|
||||||
|
'compose_version':command('docker','compose','version'),'containers':snapshot(),'other_containers':other}
|
||||||
|
# Docker version output contains no application environment.
|
||||||
|
save('environment.json',data)
|
||||||
|
print('Sanitized environment captured')
|
||||||
|
|
||||||
|
|
||||||
|
if __name__=='__main__':main()
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
"""Publication artifacts from actual saved measurements, no synthetic plot data."""
|
||||||
|
import csv
|
||||||
|
import json
|
||||||
|
import math
|
||||||
|
from pathlib import Path
|
||||||
|
import re
|
||||||
|
|
||||||
|
import matplotlib
|
||||||
|
matplotlib.use('Agg')
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
|
||||||
|
ROOT=Path(__file__).resolve().parents[1]
|
||||||
|
|
||||||
|
|
||||||
|
def stats(record):
|
||||||
|
cpu=memory=0
|
||||||
|
for line in record.get('stats','').splitlines():
|
||||||
|
row=json.loads(line)
|
||||||
|
cpu+=float(row['CPUPerc'].rstrip('%'))
|
||||||
|
match=re.match(r'([\d.]+)\s*([KMGT]?i?B)',row['MemUsage'])
|
||||||
|
if match:
|
||||||
|
number,unit=match.groups()
|
||||||
|
factors={'B':1,'kB':1000,'KB':1000,'KiB':1024,'MB':1e6,'MiB':1024**2,'GB':1e9,'GiB':1024**3}
|
||||||
|
memory+=float(number)*factors[unit]/1024**2
|
||||||
|
return cpu,memory
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
cases=[json.loads(p.read_text(encoding='utf-8')) for p in sorted((ROOT/'evidence').glob('slo-*-*.json'))]
|
||||||
|
if not cases:raise SystemExit('No measured cases')
|
||||||
|
fig,axes=plt.subplots(len(cases),2,figsize=(14,3.2*len(cases)),squeeze=False)
|
||||||
|
alerts=[];performance=[]
|
||||||
|
for i,case in enumerate(cases):
|
||||||
|
origin=case['started'];domain=case['domain'];repeat=case['repeat']
|
||||||
|
ax=axes[i,0]
|
||||||
|
for name,values in case['alerts'].items():
|
||||||
|
alerts.append({'domain':domain,'repeat':repeat,'alert':name,**values})
|
||||||
|
selected=[(s['time']-origin,int(any(a['labels']['alertname']==name and a['state']=='firing'
|
||||||
|
for a in s.get('alerts',[])))) for s in case['samples']]
|
||||||
|
ax.step([x for x,y in selected],[y for x,y in selected],where='post',label=name)
|
||||||
|
ax.set_ylim(-.1,1.4);ax.set_yticks([0,1]);ax.set_ylabel('firing');ax.legend(loc='upper right',fontsize=8)
|
||||||
|
right=axes[i,1]
|
||||||
|
if domain=='worker':
|
||||||
|
observed=[(s['time']-origin,float(s['queue_age'][0]['value'][1])) for s in case['samples'] if s.get('queue_age')]
|
||||||
|
right.plot([x for x,y in observed],[y for x,y in observed],label='oldest unfinished job, s')
|
||||||
|
right.set_ylabel('seconds')
|
||||||
|
else:
|
||||||
|
observed=[(r['time']-origin,r['elapsed'],r['status']) for r in case['requests'] if r['kind']=='message']
|
||||||
|
right.scatter([x for x,y,s in observed if s==201],[y for x,y,s in observed if s==201],s=5,label='201')
|
||||||
|
right.scatter([x for x,y,s in observed if s!=201],[y for x,y,s in observed if s!=201],s=7,label='error')
|
||||||
|
right.set_ylabel('HTTP latency, s')
|
||||||
|
right.legend(fontsize=8)
|
||||||
|
for axis in (ax,right):
|
||||||
|
for phase in case['phases']:
|
||||||
|
if phase['name'] in ('brief','sustained'):
|
||||||
|
axis.axvspan(phase['time']-origin,phase['time']-origin+phase['duration_planned'],color='red',alpha=.1)
|
||||||
|
axis.set_title(f'{domain}, repeat {repeat}');axis.set_xlabel('seconds from case start');axis.grid(alpha=.2)
|
||||||
|
resource=[stats(s) for s in case['samples'] if s.get('stats')]
|
||||||
|
for phase,summary in case['summaries'].items():
|
||||||
|
row={'domain':domain,'repeat':repeat,'phase':phase,**summary,
|
||||||
|
'peak_sampled_cpu_percent':max(x[0] for x in resource),
|
||||||
|
'peak_sampled_memory_mib':max(x[1] for x in resource)}
|
||||||
|
performance.append(row)
|
||||||
|
fig.tight_layout();fig.savefig(ROOT/'evidence/slo-incidents.png',dpi=150);plt.close(fig)
|
||||||
|
for name,rows in [('slo-alerts.csv',alerts),('slo-performance.csv',performance)]:
|
||||||
|
with (ROOT/'evidence'/name).open('w',newline='',encoding='utf-8') as target:
|
||||||
|
writer=csv.DictWriter(target,fieldnames=rows[0].keys());writer.writeheader();writer.writerows(rows)
|
||||||
|
result=['| Домен / повтор | Alert | Detection, s | Resolved после restore, s | Firing samples в контроле/всплеске |',
|
||||||
|
'|---|---|---:|---:|---:|']
|
||||||
|
def number(v):return '—' if v is None else f'{v:.2f}'
|
||||||
|
for r in alerts:
|
||||||
|
result.append(f"| {r['domain']} / {r['repeat']} | {r['alert']} | {number(r['detected_seconds'])} | {number(r['resolved_seconds_after_restore'])} | {r['control_firing_samples']} |")
|
||||||
|
result+=['','| Домен / повтор / фаза | Успешно / ошибок | Successful RPS | p50 / p95 / p99 успешных, ms |', '|---|---:|---:|---|']
|
||||||
|
for r in performance:
|
||||||
|
latency=' / '.join(number(r[k]*1000 if r[k] is not None else None) for k in ['p50_success_s','p95_success_s','p99_success_s'])
|
||||||
|
result.append(f"| {r['domain']} / {r['repeat']} / {r['phase']} | {r['successes']} / {r['errors']} | {r['successful_rps']:.3f} | {latency} |")
|
||||||
|
result+=['',f"Максимум суммы редких snapshots: CPU **{max(r['peak_sampled_cpu_percent'] for r in performance):.1f}%**, cgroup memory **{max(r['peak_sampled_memory_mib'] for r in performance):.1f} MiB**. Это не непрерывно измеренные пики.",
|
||||||
|
'',f"За worker-серии принято и отдельно найдено ready **{sum(c['accepted_uploads'] for c in cases if c['domain']=='worker')}** вложений.",
|
||||||
|
'', '', '',
|
||||||
|
'CSV агрегатов: `evidence/slo-alerts.csv`, `evidence/slo-performance.csv`. Красная область — фактическое воздействие с плановой длительностью, точки и линии — измеренные ответы/сигналы.',
|
||||||
|
'', 'В измеренном контроле и кратких всплесках оцениваются только наблюдённые firing samples; это не статистическая оценка production false-positive rate. Подробные фазы/ошибки/снимки находятся в исходных JSON.']
|
||||||
|
result+=['','| Worker повтор | Ready / ошибок upload | Completed images/s | p50 / p95 / p99 ready, s | ≤5 s |',
|
||||||
|
'|---|---:|---:|---|---:|']
|
||||||
|
for case in cases:
|
||||||
|
if case.get('ready_summary'):
|
||||||
|
r=case['ready_summary']
|
||||||
|
result.append(f"| {case['repeat']} | {r['count']} / {r['upload_http_errors']} | {r['completed_rps']:.3f} | {number(r['p50_s'])} / {number(r['p95_s'])} / {number(r['p99_s'])} | {r['within_5s']} |")
|
||||||
|
p=ROOT/'REPORT.md';text=p.read_text(encoding='utf-8');a='<!-- RESULTS BEGIN -->';b='<!-- RESULTS END -->'
|
||||||
|
text=text[:text.index(a)+len(a)]+'\n\n'+'\n'.join(result)+'\n\n'+text[text.index(b):]
|
||||||
|
p.write_text(text,encoding='utf-8')
|
||||||
|
print('Plots, CSV and report tables generated from',len(cases),'measured cases')
|
||||||
|
|
||||||
|
|
||||||
|
if __name__=='__main__':main()
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
"""Clean HEAD export, new secrets/images/volumes/ports; cleanup only this experiment."""
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
from pathlib import Path
|
||||||
|
import shutil
|
||||||
|
import socket
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
import tempfile
|
||||||
|
import time
|
||||||
|
import uuid
|
||||||
|
import zipfile
|
||||||
|
|
||||||
|
ROOT=Path(__file__).resolve().parents[1]
|
||||||
|
|
||||||
|
|
||||||
|
def port():
|
||||||
|
with socket.socket() as sock:
|
||||||
|
sock.bind(('127.0.0.1',0))
|
||||||
|
return sock.getsockname()[1]
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
tag=uuid.uuid4().hex[:10];project='lyakhonov-lab6-repro-'+tag
|
||||||
|
directory=Path(tempfile.mkdtemp(prefix='lab6-repro-')).resolve()
|
||||||
|
assert directory.parent==Path(tempfile.gettempdir()).resolve() and directory.name.startswith('lab6-repro-')
|
||||||
|
api_port,grafana_port=port(),port()
|
||||||
|
while grafana_port==api_port:grafana_port=port()
|
||||||
|
app='lyakhonov-messenger:lab6-repro-'+tag;s3='lyakhonov-storage:lab6-repro-'+tag
|
||||||
|
env=dict(os.environ,COMPOSE_PROJECT_NAME=project,LAB6_PORT=str(api_port),GRAFANA_PORT=str(grafana_port),
|
||||||
|
BASE_URL=f'http://127.0.0.1:{api_port}',GRAFANA_URL=f'http://127.0.0.1:{grafana_port}',
|
||||||
|
APP_IMAGE=app,S3_IMAGE=s3,PYTHONUTF8='1')
|
||||||
|
result={'project':project,'directory':str(directory),'ports':[api_port,grafana_port],
|
||||||
|
'images':[app,s3],'commit':subprocess.check_output(['git','rev-parse','HEAD'],cwd=ROOT,text=True).strip(),'steps':[]}
|
||||||
|
archive=directory/'source.zip';checkout=directory/'checkout';checkout.mkdir()
|
||||||
|
def run(*args,timeout=600):
|
||||||
|
started=time.time()
|
||||||
|
proc=subprocess.run(args,cwd=checkout,env=env,capture_output=True,text=True,timeout=timeout)
|
||||||
|
result['steps'].append({'command':list(args),'exit_code':proc.returncode,'duration':time.time()-started,
|
||||||
|
'output':(proc.stdout+proc.stderr)[-12000:]})
|
||||||
|
(ROOT/'evidence/reproduction.json').write_text(json.dumps(result,ensure_ascii=False,indent=2),encoding='utf-8')
|
||||||
|
if proc.returncode:raise RuntimeError('reproduction step failed: '+args[0])
|
||||||
|
try:
|
||||||
|
subprocess.check_call(['git','archive','--format=zip','--output',str(archive),'HEAD'],cwd=ROOT)
|
||||||
|
with zipfile.ZipFile(archive) as zipped:zipped.extractall(checkout)
|
||||||
|
run(sys.executable,'scripts/bootstrap.py')
|
||||||
|
run('docker','compose','-p',project,'config','--quiet')
|
||||||
|
run('docker','compose','-p',project,'build','api','s3',timeout=1200)
|
||||||
|
run('docker','compose','-p',project,'up','-d','--no-build')
|
||||||
|
run(sys.executable,'scripts/wait_ready.py','--project',project,'--base-url',env['BASE_URL'],'--telemetry')
|
||||||
|
run(sys.executable,'tests/smoke.py','--base-url',env['BASE_URL'])
|
||||||
|
run(sys.executable,'student-tests/signals.py')
|
||||||
|
ids=subprocess.check_output(['docker','compose','-p',project,'ps','-q'],cwd=checkout,env=env,text=True).split()
|
||||||
|
inspected=json.loads(subprocess.check_output(['docker','inspect',*ids],text=True))
|
||||||
|
result['containers']=[{'id':r['Id'],'service':r['Config']['Labels']['com.docker.compose.service'],
|
||||||
|
'started_at':r['State']['StartedAt'],'mounts':[m.get('Name') for m in r['Mounts'] if m['Type']=='volume']} for r in inspected]
|
||||||
|
result['checks']='PASS'
|
||||||
|
finally:
|
||||||
|
cleanup=subprocess.run(['docker','compose','-p',project,'down','-v','--remove-orphans'],cwd=checkout,env=env,capture_output=True,text=True)
|
||||||
|
result['cleanup']={'exit_code':cleanup.returncode,'output':cleanup.stdout+cleanup.stderr}
|
||||||
|
if cleanup.returncode==0:
|
||||||
|
subprocess.run(['docker','image','rm',app,s3],capture_output=True,text=True)
|
||||||
|
resolved=directory.resolve()
|
||||||
|
assert resolved.parent==Path(tempfile.gettempdir()).resolve() and resolved.name=='lab6-repro-'+directory.name.removeprefix('lab6-repro-')
|
||||||
|
shutil.rmtree(resolved)
|
||||||
|
(ROOT/'evidence/reproduction.json').write_text(json.dumps(result,ensure_ascii=False,indent=2),encoding='utf-8')
|
||||||
|
print('PASS: clean Git export, new secrets and isolated stack; temporary resources removed')
|
||||||
|
|
||||||
|
|
||||||
|
if __name__=='__main__':main()
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
@echo off
|
||||||
|
python "%~dp0actions.py" restart
|
||||||
Executable
+5
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -eu
|
||||||
|
root="$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)"
|
||||||
|
cd "$root"
|
||||||
|
docker compose restart -t 4 db redis s3 broker api dispatcher worker staging-cleaner lb
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
@echo off
|
||||||
|
python "%~dp0actions.py" stop-one
|
||||||
Executable
+16
@@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -eu
|
||||||
|
root="$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)"
|
||||||
|
cd "$root"
|
||||||
|
: "${TARGET_INSTANCE_ID:?}"
|
||||||
|
for container in $(docker compose ps -q api); do
|
||||||
|
hostname="$(docker inspect --format '{{.Config.Hostname}}' "$container")"
|
||||||
|
case "$TARGET_INSTANCE_ID" in
|
||||||
|
"$hostname"-????????)
|
||||||
|
docker compose ps -q api | grep -Fx "$container" >/dev/null
|
||||||
|
docker stop -t 2 "$container" >/dev/null
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
exit 1
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
"""Derive phase statistics and ready latency from actual stored observations."""
|
||||||
|
import json
|
||||||
|
import math
|
||||||
|
from pathlib import Path
|
||||||
|
import sys
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
ROOT=Path(__file__).resolve().parents[1]
|
||||||
|
sys.path.insert(0,str(ROOT/'student-tests'))
|
||||||
|
from common import dc,check
|
||||||
|
|
||||||
|
|
||||||
|
def percentile(values,q):
|
||||||
|
values=sorted(values)
|
||||||
|
return values[min(len(values)-1,math.ceil(len(values)*q)-1)] if values else None
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
for path in sorted((ROOT/'evidence').glob('slo-*-*.json')):
|
||||||
|
case=json.loads(path.read_text(encoding='utf-8'))
|
||||||
|
case.setdefault('application_commit',subprocess.check_output(
|
||||||
|
['git','log','-1','--format=%H','--','src'],cwd=ROOT,text=True).strip())
|
||||||
|
case.setdefault('summaries_requested_period',case['summaries'])
|
||||||
|
for index,phase in enumerate(case['phases']):
|
||||||
|
end=case['phases'][index+1]['time'] if index+1<len(case['phases']) else case['ended']
|
||||||
|
duration=end-phase['time']
|
||||||
|
rows=[r for r in case['requests'] if r['kind']=='message' and phase['time']<=r['time']<end]
|
||||||
|
good=[r['elapsed'] for r in rows if r['status']==201]
|
||||||
|
case['summaries'][phase['name']]={'requests':len(rows),'successes':len(good),'errors':len(rows)-len(good),
|
||||||
|
'successful_rps':len(good)/duration,'actual_duration':duration,'grouping':'response completion time',
|
||||||
|
'p50_success_s':percentile(good,.5),'p95_success_s':percentile(good,.95),'p99_success_s':percentile(good,.99)}
|
||||||
|
if case['domain']=='worker':
|
||||||
|
code=f'''import json
|
||||||
|
from src.storage import storage
|
||||||
|
storage.pool.open(wait=True)
|
||||||
|
with storage.pool.connection() as conn:
|
||||||
|
rows=conn.execute("SELECT id,state,extract(epoch from created_at) AS accepted,extract(epoch from updated_at) AS settled FROM attachments WHERE created_at>=to_timestamp(%s) AND created_at<to_timestamp(%s) ORDER BY created_at",({case['started']!r},{case['ended']!r})).fetchall()
|
||||||
|
print(json.dumps([dict(id=str(r['id']),state=r['state'],accepted=float(r['accepted']),settled=float(r['settled'])) for r in rows]))
|
||||||
|
storage.pool.close()
|
||||||
|
'''
|
||||||
|
observations=json.loads(dc('exec','-T','api','python','-c',code))
|
||||||
|
check(len(observations)==case['accepted_uploads'],'accepted cohort count differs')
|
||||||
|
check(all(r['state']=='ready' for r in observations),'unfinished accepted upload')
|
||||||
|
durations=[r['settled']-r['accepted'] for r in observations]
|
||||||
|
case['ready_observations']=observations
|
||||||
|
case['ready_summary']={'count':len(durations),'p50_s':percentile(durations,.5),'p95_s':percentile(durations,.95),
|
||||||
|
'p99_s':percentile(durations,.99),'within_5s':sum(v<=5 for v in durations),
|
||||||
|
'completed_rps':len(durations)/(case['ended']-case['started']),
|
||||||
|
'upload_http_errors':sum(r['status']!=202 for r in case['requests'] if r['kind']=='upload')}
|
||||||
|
path.write_text(json.dumps(case,ensure_ascii=False,indent=2),encoding='utf-8')
|
||||||
|
print('Summaries use actual phase bounds and response timestamps; ready cohorts checked in DB')
|
||||||
|
|
||||||
|
|
||||||
|
if __name__=='__main__':main()
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
"""Явная готовность API, stores и процессов; smoke проверяет обработку задания."""
|
||||||
|
import argparse
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
import subprocess
|
||||||
|
import time
|
||||||
|
import urllib.error
|
||||||
|
import urllib.request
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument('--project', default='lyakhonov-lab6')
|
||||||
|
parser.add_argument('--base-url', default='http://127.0.0.1:8086')
|
||||||
|
parser.add_argument('--telemetry', action='store_true')
|
||||||
|
parser.add_argument('--grafana-url', default=os.getenv('GRAFANA_URL','http://127.0.0.1:3006'))
|
||||||
|
args = parser.parse_args()
|
||||||
|
deadline = time.monotonic()+120
|
||||||
|
observed = set()
|
||||||
|
while time.monotonic() < deadline:
|
||||||
|
ids = subprocess.check_output(['docker','compose','-p',args.project,'ps','-q'], text=True).split()
|
||||||
|
if not ids:
|
||||||
|
time.sleep(1)
|
||||||
|
continue
|
||||||
|
rows = json.loads(subprocess.check_output(['docker','inspect',*ids], text=True))
|
||||||
|
services = {}
|
||||||
|
for row in rows:
|
||||||
|
name = row['Config']['Labels']['com.docker.compose.service']
|
||||||
|
services.setdefault(name, []).append(row['State'])
|
||||||
|
running = all(services.get(name) and all(s['Running'] for s in services[name])
|
||||||
|
for name in ('api','db','s3','broker','dispatcher','worker','staging-cleaner','lb'))
|
||||||
|
healthy = all(services.get(name) and all(s.get('Health',{}).get('Status') == 'healthy' for s in services[name])
|
||||||
|
for name in ('db','broker','api'))
|
||||||
|
try:
|
||||||
|
with urllib.request.urlopen(args.base_url+'/health/ready', timeout=2) as response:
|
||||||
|
observed.add(response.headers.get('X-Instance-Id'))
|
||||||
|
except (urllib.error.URLError, TimeoutError, OSError):
|
||||||
|
pass
|
||||||
|
if running and healthy and len(services.get('api', [])) >= 2 and len(observed - {None}) >= 2:
|
||||||
|
if args.telemetry:
|
||||||
|
try:
|
||||||
|
for path in ['/api/health','/api/datasources/proxy/uid/prometheus/-/ready',
|
||||||
|
'/api/datasources/proxy/uid/loki/ready','/api/datasources/proxy/uid/tempo/ready']:
|
||||||
|
with urllib.request.urlopen(args.grafana_url+path,timeout=2) as response:
|
||||||
|
if response.status!=200:raise OSError('telemetry not ready')
|
||||||
|
except (urllib.error.URLError,TimeoutError,OSError):
|
||||||
|
time.sleep(.5)
|
||||||
|
continue
|
||||||
|
print('PASS: two ready API instances, healthy DB/broker, required background containers running')
|
||||||
|
return
|
||||||
|
time.sleep(.5)
|
||||||
|
raise SystemExit('Readiness deadline exceeded')
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
+174
@@ -0,0 +1,174 @@
|
|||||||
|
import uuid
|
||||||
|
import os
|
||||||
|
import socket
|
||||||
|
from contextlib import asynccontextmanager
|
||||||
|
import psycopg
|
||||||
|
from psycopg_pool import PoolTimeout, TooManyRequests
|
||||||
|
from starlette.concurrency import run_in_threadpool
|
||||||
|
|
||||||
|
from fastapi import FastAPI, Request
|
||||||
|
from fastapi.exceptions import RequestValidationError
|
||||||
|
from fastapi.responses import JSONResponse
|
||||||
|
from pydantic import ValidationError as PydanticValidationError
|
||||||
|
from starlette.exceptions import HTTPException as StarletteHTTPException
|
||||||
|
|
||||||
|
from src.models import ErrorResponse
|
||||||
|
from src.routes import chats, health, messages, users, attachments
|
||||||
|
from botocore.exceptions import BotoCoreError, ClientError
|
||||||
|
from src.storage import storage
|
||||||
|
|
||||||
|
|
||||||
|
from src import telemetry
|
||||||
|
telemetry.setup("messenger-api")
|
||||||
|
telemetry.register_gauges(storage.pool)
|
||||||
|
|
||||||
|
def create_app() -> FastAPI:
|
||||||
|
"""Создать и настроить приложение FastAPI."""
|
||||||
|
@asynccontextmanager
|
||||||
|
async def lifespan(app):
|
||||||
|
await run_in_threadpool(storage.pool.open, wait=True)
|
||||||
|
try:
|
||||||
|
yield
|
||||||
|
finally:
|
||||||
|
await run_in_threadpool(storage.pool.close)
|
||||||
|
|
||||||
|
instance_id = os.getenv("INSTANCE_ID", socket.gethostname()) + "-" + uuid.uuid4().hex[:8]
|
||||||
|
app = FastAPI(title="MTUSI Messenger Lab6", version="1.6.0", lifespan=lifespan)
|
||||||
|
|
||||||
|
@app.exception_handler(BotoCoreError)
|
||||||
|
@app.exception_handler(ClientError)
|
||||||
|
@app.exception_handler(psycopg.OperationalError)
|
||||||
|
@app.exception_handler(psycopg.errors.QueryCanceled)
|
||||||
|
@app.exception_handler(psycopg.errors.LockNotAvailable)
|
||||||
|
@app.exception_handler(PoolTimeout)
|
||||||
|
@app.exception_handler(TooManyRequests)
|
||||||
|
async def dependency_error(request, exc):
|
||||||
|
return JSONResponse(status_code=503, content=ErrorResponse(error={
|
||||||
|
"code": "unavailable", "message": "хранилище временно недоступно",
|
||||||
|
"request_id": request.state.request_id}).model_dump(),
|
||||||
|
headers={"X-Request-Id": request.state.request_id})
|
||||||
|
|
||||||
|
@app.middleware("http")
|
||||||
|
async def add_request_id(request: Request, call_next):
|
||||||
|
"""Добавляет идентификаторы запроса и процесса, ограничивает очередь."""
|
||||||
|
try:
|
||||||
|
request_id = str(uuid.UUID(request.headers.get("X-Request-Id", "")))
|
||||||
|
except ValueError:
|
||||||
|
request_id = str(uuid.uuid4())
|
||||||
|
request.state.request_id = request_id
|
||||||
|
|
||||||
|
# Ограничение числа обслуживаемых запросов в процессе.
|
||||||
|
if not storage.acquire_request_slot():
|
||||||
|
return JSONResponse(
|
||||||
|
status_code=503,
|
||||||
|
content=ErrorResponse(
|
||||||
|
error={
|
||||||
|
"code": "unavailable",
|
||||||
|
"message": "сервер перегружен, попробуйте позже",
|
||||||
|
"request_id": request_id,
|
||||||
|
}
|
||||||
|
).model_dump(),
|
||||||
|
headers={"X-Request-Id": request_id, "X-Instance-Id": instance_id},
|
||||||
|
)
|
||||||
|
|
||||||
|
try:
|
||||||
|
response = await call_next(request)
|
||||||
|
response.headers["X-Request-Id"] = request_id
|
||||||
|
response.headers["X-Instance-Id"] = instance_id
|
||||||
|
return response
|
||||||
|
finally:
|
||||||
|
storage.release_request_slot()
|
||||||
|
|
||||||
|
@app.exception_handler(StarletteHTTPException)
|
||||||
|
async def http_exception_handler(request: Request, exc: StarletteHTTPException):
|
||||||
|
"""Обработчик HTTPException: возвращает ошибку в формате контракта {"error": ...}."""
|
||||||
|
request_id = getattr(request.state, "request_id", str(uuid.uuid4()))
|
||||||
|
if isinstance(exc.detail, dict) and "error" in exc.detail:
|
||||||
|
return JSONResponse(
|
||||||
|
status_code=exc.status_code,
|
||||||
|
content=exc.detail,
|
||||||
|
headers={"X-Request-Id": request_id, **(exc.headers or {})},
|
||||||
|
)
|
||||||
|
return JSONResponse(
|
||||||
|
status_code=exc.status_code,
|
||||||
|
content=ErrorResponse(
|
||||||
|
error={
|
||||||
|
"code": "internal_error",
|
||||||
|
"message": str(exc.detail),
|
||||||
|
"request_id": request_id,
|
||||||
|
}
|
||||||
|
).model_dump(),
|
||||||
|
headers={"X-Request-Id": request_id, "X-Instance-Id": instance_id},
|
||||||
|
)
|
||||||
|
|
||||||
|
@app.exception_handler(RequestValidationError)
|
||||||
|
async def request_validation_handler(request: Request, exc: RequestValidationError):
|
||||||
|
"""Перехватываем ошибки валидации запроса (422 -> 400 по контракту)."""
|
||||||
|
request_id = getattr(request.state, "request_id", str(uuid.uuid4()))
|
||||||
|
errors = exc.errors()
|
||||||
|
messages = []
|
||||||
|
for err in errors:
|
||||||
|
loc = ".".join(str(x) for x in err.get("loc", []))
|
||||||
|
messages.append(f"{loc}: {err.get('msg', 'invalid')}")
|
||||||
|
return JSONResponse(
|
||||||
|
status_code=400,
|
||||||
|
content=ErrorResponse(
|
||||||
|
error={
|
||||||
|
"code": "invalid_request",
|
||||||
|
"message": "; ".join(messages),
|
||||||
|
"request_id": request_id,
|
||||||
|
}
|
||||||
|
).model_dump(),
|
||||||
|
headers={"X-Request-Id": request_id, "X-Instance-Id": instance_id},
|
||||||
|
)
|
||||||
|
|
||||||
|
@app.exception_handler(PydanticValidationError)
|
||||||
|
async def validation_exception_handler(request: Request, exc: PydanticValidationError):
|
||||||
|
"""Перехватываем ошибки Pydantic (422 -> 400 по контракту)."""
|
||||||
|
request_id = getattr(request.state, "request_id", str(uuid.uuid4()))
|
||||||
|
errors = exc.errors()
|
||||||
|
messages = []
|
||||||
|
for err in errors:
|
||||||
|
loc = ".".join(str(x) for x in err.get("loc", []))
|
||||||
|
messages.append(f"{loc}: {err.get('msg', 'invalid')}")
|
||||||
|
return JSONResponse(
|
||||||
|
status_code=400,
|
||||||
|
content=ErrorResponse(
|
||||||
|
error={
|
||||||
|
"code": "invalid_request",
|
||||||
|
"message": "; ".join(messages),
|
||||||
|
"request_id": request_id,
|
||||||
|
}
|
||||||
|
).model_dump(),
|
||||||
|
headers={"X-Request-Id": request_id, "X-Instance-Id": instance_id},
|
||||||
|
)
|
||||||
|
|
||||||
|
@app.exception_handler(Exception)
|
||||||
|
async def generic_exception_handler(request: Request, exc: Exception):
|
||||||
|
"""Обработчик непредвиденных исключений: скрываем детали, возвращаем 500."""
|
||||||
|
request_id = getattr(request.state, "request_id", str(uuid.uuid4()))
|
||||||
|
return JSONResponse(
|
||||||
|
status_code=500,
|
||||||
|
content=ErrorResponse(
|
||||||
|
error={
|
||||||
|
"code": "internal_error",
|
||||||
|
"message": "внутренняя ошибка сервера",
|
||||||
|
"request_id": request_id,
|
||||||
|
}
|
||||||
|
).model_dump(),
|
||||||
|
headers={"X-Request-Id": request_id, "X-Instance-Id": instance_id},
|
||||||
|
)
|
||||||
|
|
||||||
|
# Подключаем роуты
|
||||||
|
app.include_router(health.router)
|
||||||
|
app.include_router(users.router)
|
||||||
|
app.include_router(chats.router)
|
||||||
|
app.include_router(messages.router)
|
||||||
|
app.include_router(attachments.router)
|
||||||
|
|
||||||
|
app.add_middleware(telemetry.HTTPMiddleware)
|
||||||
|
return app
|
||||||
|
|
||||||
|
|
||||||
|
# Экземпляр приложения для uvicorn
|
||||||
|
app = create_app()
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
"""RabbitMQ с подтверждаемой публикацией и ручным ack."""
|
||||||
|
|
||||||
|
import json
|
||||||
|
from contextlib import contextmanager
|
||||||
|
|
||||||
|
import pika
|
||||||
|
|
||||||
|
from src.config import setting
|
||||||
|
|
||||||
|
QUEUE = 'attachment.process.v1'
|
||||||
|
|
||||||
|
|
||||||
|
@contextmanager
|
||||||
|
def channel(heartbeat=90):
|
||||||
|
params = pika.URLParameters(setting('BROKER_URL'))
|
||||||
|
params.heartbeat = heartbeat
|
||||||
|
params.socket_timeout = 4
|
||||||
|
params.stack_timeout = 6
|
||||||
|
params.blocked_connection_timeout = 5
|
||||||
|
connection = pika.BlockingConnection(params)
|
||||||
|
try:
|
||||||
|
result = connection.channel()
|
||||||
|
result.queue_declare(queue=QUEUE, durable=True)
|
||||||
|
yield connection, result
|
||||||
|
finally:
|
||||||
|
if connection.is_open:
|
||||||
|
connection.close()
|
||||||
|
|
||||||
|
|
||||||
|
def publish(ch, message):
|
||||||
|
ch.basic_publish(
|
||||||
|
exchange='', routing_key=QUEUE, body=json.dumps(message, separators=(',', ':')).encode(),
|
||||||
|
properties=pika.BasicProperties(content_type='application/json', delivery_mode=2,
|
||||||
|
message_id=message['job_id']),
|
||||||
|
mandatory=True,
|
||||||
|
)
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
"""Необязательный кэш неизменяемого публичного профиля; ошибки обходятся через БД."""
|
||||||
|
import logging
|
||||||
|
import os
|
||||||
|
from concurrent.futures import ThreadPoolExecutor, TimeoutError as FutureTimeout
|
||||||
|
import threading
|
||||||
|
from redis import Redis, RedisError
|
||||||
|
from pydantic import ValidationError
|
||||||
|
from src.config import setting
|
||||||
|
from src.models import User
|
||||||
|
|
||||||
|
|
||||||
|
class ProfileCache:
|
||||||
|
def __init__(self):
|
||||||
|
url = setting('CACHE_URL')
|
||||||
|
self.client = Redis.from_url(url, decode_responses=True, socket_connect_timeout=0.2,
|
||||||
|
socket_timeout=0.2, max_connections=16) if url else None
|
||||||
|
self.ttl = int(os.getenv('PROFILE_CACHE_TTL_SECONDS','60'))
|
||||||
|
self.hits = self.misses = self.errors = 0
|
||||||
|
# DNS может ждать дольше socket timeout; один фоновый вызов ограничивает и время, и очередь.
|
||||||
|
self._executor = ThreadPoolExecutor(max_workers=1, thread_name_prefix='profile-cache')
|
||||||
|
self._pending = None
|
||||||
|
self._guard = threading.Lock()
|
||||||
|
|
||||||
|
def _bounded(self, action, *args, **kwargs):
|
||||||
|
with self._guard:
|
||||||
|
if self._pending is not None and not self._pending.done():
|
||||||
|
raise RedisError('кэш занят')
|
||||||
|
self._pending = self._executor.submit(action, *args, **kwargs)
|
||||||
|
future = self._pending
|
||||||
|
try:
|
||||||
|
return future.result(timeout=0.25)
|
||||||
|
except FutureTimeout:
|
||||||
|
raise RedisError('истекло время ожидания кэша') from None
|
||||||
|
|
||||||
|
def get(self, user_id):
|
||||||
|
if not self.client:
|
||||||
|
return None
|
||||||
|
try:
|
||||||
|
value = self._bounded(self.client.get, 'profile:v1:'+user_id)
|
||||||
|
if value:
|
||||||
|
user=User.model_validate_json(value)
|
||||||
|
if user.id != user_id:
|
||||||
|
raise ValueError('неверный ключ кэша')
|
||||||
|
self.hits += 1
|
||||||
|
return user
|
||||||
|
self.misses += 1
|
||||||
|
except (RedisError, ValidationError, ValueError):
|
||||||
|
self.errors += 1
|
||||||
|
logging.getLogger(__name__).warning('Кэш профиля недоступен; чтение из PostgreSQL')
|
||||||
|
return None
|
||||||
|
|
||||||
|
def put(self, user):
|
||||||
|
if self.client:
|
||||||
|
try:
|
||||||
|
self._bounded(self.client.set, 'profile:v1:'+user.id,user.model_dump_json(),ex=self.ttl)
|
||||||
|
except RedisError:
|
||||||
|
self.errors += 1
|
||||||
|
|
||||||
|
|
||||||
|
profile_cache = ProfileCache()
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
"""Настройки окружения и чтение секретов из файлов."""
|
||||||
|
import os
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
|
def setting(name, default=None):
|
||||||
|
path = os.getenv(name + '_FILE')
|
||||||
|
if path:
|
||||||
|
return Path(path).read_text(encoding='utf-8').strip()
|
||||||
|
return os.getenv(name, default)
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
"""Internal exporter: durable backlog, including jobs not yet published to broker."""
|
||||||
|
from http.server import BaseHTTPRequestHandler, HTTPServer
|
||||||
|
import signal
|
||||||
|
import sys
|
||||||
|
from src.storage import storage
|
||||||
|
|
||||||
|
|
||||||
|
class Handler(BaseHTTPRequestHandler):
|
||||||
|
def log_message(self, *args):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def do_GET(self):
|
||||||
|
try:
|
||||||
|
with storage.pool.connection() as conn:
|
||||||
|
row = conn.execute("SELECT count(*) AS depth, COALESCE(EXTRACT(EPOCH FROM "
|
||||||
|
"clock_timestamp()-min(created_at)),0) AS age FROM attachment_jobs "
|
||||||
|
"WHERE state IN ('queued','processing')").fetchone()
|
||||||
|
windows = {}
|
||||||
|
for window, seconds in [('15s',15),('30s',30),('1m',60),('2m',120),('5m',300)]:
|
||||||
|
result = conn.execute("SELECT count(*) AS total, count(*) FILTER (WHERE "
|
||||||
|
"state <> 'ready' OR updated_at-created_at > interval '5 seconds') AS bad "
|
||||||
|
"FROM attachments WHERE created_at <= clock_timestamp()-interval '5 seconds' "
|
||||||
|
"AND created_at > clock_timestamp()-(%s+5)*interval '1 second'", (seconds,)).fetchone()
|
||||||
|
windows[window] = result
|
||||||
|
values = {'messenger_queue_depth': row['depth'], 'messenger_queue_oldest_seconds': row['age'],
|
||||||
|
'messenger_diagnostics_db_up': 1}
|
||||||
|
data = ''.join(f'{key}' + ('{queue="attachment.process.v1"}' if key.startswith('messenger_queue_') else '')
|
||||||
|
+ f' {value}\n' for key, value in values.items()).encode()
|
||||||
|
for window, result in windows.items():
|
||||||
|
for kind in ('bad','total'):
|
||||||
|
data += f'messenger_ready_window_{kind}{{window="{window}"}} {result[kind]}\n'.encode()
|
||||||
|
except Exception:
|
||||||
|
data = b'messenger_diagnostics_db_up 0\n'
|
||||||
|
self.send_response(200)
|
||||||
|
self.send_header('Content-Type', 'text/plain; version=0.0.4')
|
||||||
|
self.end_headers()
|
||||||
|
self.wfile.write(data)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
signal.signal(signal.SIGTERM,lambda *_: sys.exit(0))
|
||||||
|
storage.pool.open(wait=True)
|
||||||
|
try:
|
||||||
|
HTTPServer(('0.0.0.0',9099), Handler).serve_forever()
|
||||||
|
finally:
|
||||||
|
storage.pool.close()
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user