forked from mtusi2026/mtusi2026lab6
Перенесён минимум lab5 без изменения API и добавлена наблюдаемость: - OTel SDK в API и worker: traces, metrics, logs по OTLP; W3C trace context API -> outbox -> RabbitMQ -> worker (producer/consumer spans, retry в той же трассе); - OTel Collector (memory_limiter, scrub, batch, ограниченные очереди, профиль tail sampling), Prometheus, Loki, Tempo, Grafana с provisioning, dashboard и 6 alert rules с runbooks; - проверки: наблюдаемость и приватность, инциденты A/B/C, насыщение worker, переполнение очереди exporter, эксперимент трека 1 (4 конфигурации x 3 прогона); - CI job со сборкой и запуском стенда; REPORT.md с доказательствами в evidence/.
37 lines
1.4 KiB
YAML
37 lines
1.4 KiB
YAML
name: Application stand
|
|
# Student job: builds the application, starts the whole Compose stand and runs the public smoke and the
|
|
# observability check. Credentials are random, generated inside the job, and thrown away with it.
|
|
# Triggers deliberately exclude pull_request_target: code from a fork never gets repository secrets.
|
|
on: [push, pull_request]
|
|
permissions:
|
|
contents: read
|
|
jobs:
|
|
stand:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 25
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.12'
|
|
- name: Create local .env and random credentials
|
|
run: sh scripts/init-secrets.sh
|
|
- name: Validate Compose configuration
|
|
run: docker compose --env-file .env config --quiet
|
|
- name: Build and start the stand, wait for readiness
|
|
run: docker compose --env-file .env up -d --build --wait --wait-timeout 300
|
|
- name: Contract structure
|
|
run: make check
|
|
- name: Public API smoke with telemetry enabled
|
|
run: make test
|
|
- name: Traces, logs, metrics correlation and privacy
|
|
run: python3 student-tests/test_observability.py
|
|
- name: Service state and application logs on failure
|
|
if: failure()
|
|
run: |
|
|
docker compose ps -a
|
|
docker compose logs --tail 80 api-1 api-2 worker otel-collector tempo loki prometheus
|
|
- name: Remove the stand
|
|
if: always()
|
|
run: docker compose down -v
|