lab 6 observability

This commit is contained in:
2026-11-21 00:02:11 +03:00
parent 470d9d6f1e
commit 1b349de454
69 changed files with 8694 additions and 4877 deletions
+5 -5
View File
@@ -1,5 +1,5 @@
# Доказательства
Храните небольшие обезличенные результаты: команды и stdout проверок, JSON/CSV агрегатов нагрузки, EXPLAIN, dashboard JSON, текст разбора отказа. Укажите дату, commit, аппаратные лимиты и профиль нагрузки.
Не добавляйте .env, session tokens, cookies, приватные ключи, credentials, реальные сообщения, raw dumps и signed URLs. Для скриншотов скрывайте секреты. Большие логи/бинарные traces сохраняйте отдельно по правилам преподавателя; одного скриншота без методики недостаточно.
# Доказательства
Храните небольшие обезличенные результаты: команды и stdout проверок, JSON/CSV агрегатов нагрузки, EXPLAIN, dashboard JSON, текст разбора отказа. Укажите дату, commit, аппаратные лимиты и профиль нагрузки.
Не добавляйте .env, session tokens, cookies, приватные ключи, credentials, реальные сообщения, raw dumps и signed URLs. Для скриншотов скрывайте секреты. Большие логи/бинарные traces сохраняйте отдельно по правилам преподавателя; одного скриншота без методики недостаточно.
+68
View File
@@ -0,0 +1,68 @@
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab6/mtusi2026lab6-fork$
make check && make validate
python3 scripts/check_contract.py
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
python3 scripts/validate_openapi.py
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab6/mtusi2026lab6-fork$
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab6/mtusi2026lab6-fork$
docker compose --env-file .env config --quiet
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab6/mtusi2026lab6-fork$
User@DESKTOP-8Q26HPT MINGW64 ~/Desktop/MTUCI/4_course/highload_apps/lab6/mtusi2026lab6-fork (solution/bvt2302-mironov)
$ docker compose --env-file .env up --build
[+] Running 28/28
✔ loki Pulled 41.0s
✔ prometheus Pulled 106.1s
✔ otel-collector Pulled 119.1s
✔ tempo Pulled 25.7s
✔ grafana Pulled 166.1s
[+] Building 87.0s (8/12) docker:desktop-linux
=> => resolve docker.io/library/python:3.12.11-slim-bookworm@sha256:519591d6871b7bc437060736b9f7 0.1s
=> CACHED [migrate 2/8] WORKDIR /app 0.0s
=> CACHED [migrate 3/8] RUN addgroup --system app && adduser --system --ingroup app app 0.0s
=> [migrate 4/8] COPY requirements.txt ./requirements.txt 0.0s
=> [migrate 5/8] RUN python -m pip install --no-cache-dir -r requirements.txt 81.5s
=> => # Downloading opentelemetry_semantic_conventions-0.66b1-py3-none-any.whl (206 kB)
=> => # Downloading opentelemetry_util_http-0.66b1-py3-none-any.whl (8.4 kB)
=> => # Downloading psycopg_binary-3.2.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4
=> => # .4 MB)
=> => # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.4/4.4 MB 1.4 MB/s eta 0:00:00
=> => # Downloading botocore-1.40.76-py3-none-any.whl (14.2 MB)
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab6/mtusi2026lab6-fork$
until curl -fs http://localhost:8080/health/ready; do sleep 2; done
{"status":"ok"}thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab6/mtusi2026lab6-fork$
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab6/mtusi2026lab6-fork$
make test
python3 tests/smoke.py --base-url "http://localhost:8080"
PASS: lab6 public API scenario; infrastructure and grading evidence remain separate.
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab6/mtusi2026lab6-fork$
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab6/mtusi2026lab6-fork$
python3 tests/load.py --duration 30 --concurrency 4 --output evidence/load.json
{
"lab": 6,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.078,
"concurrency": 4,
"successful_requests": 1278,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 42.49,
"successful_latency_ms": {
"p50": 69.861,
"p95": 236.929,
"p99": 397.268
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab6/mtusi2026lab6-fork$
+22
View File
@@ -0,0 +1,22 @@
PASS trace_chain: trace dcc088e178af4fd97d573719cf4161a5 spans: ['messenger-api:INSERT', 'messenger-api:POST /api/v1/chats/{chat_id}/attachments', 'messenger-api:POST /api/v1/chats/{chat_id}/attachments http receive', 'messenger-api:POST /api/v1/chats/{chat_id}/attachments http send', 'messenger-api:S3.PutObject', 'messenger-api:SELECT', 'messenger-api:outbox.enqueue', 'messenger-dispatcher:attachment-jobs publish', 'messenger-worker:INSERT', 'messenger-worker:S3.DeleteObject', 'messenger-worker:S3.GetObject', 'messenger-worker:S3.HeadObject', 'messenger-worker:S3.PutObject', 'messenger-worker:SELECT', 'messenger-worker:UPDATE', 'messenger-worker:attachment-jobs process', 'messenger-worker:imgproc.run', 'messenger-worker:job.claim', 'messenger-worker:job.commit_ready', 'messenger-worker:job.pipeline', 'messenger-worker:s3.download_staging', 'messenger-worker:s3.upload_final']
queue_lag: FIRING after ~117s, oldest_job_age=105s, depth=1
PASS queue_lag: ready after worker restart; RESOLVED after ~23s
db_slow: FIRING after ~89s; 5xx so far: 111 of 133
PASS db_slow: lock released; RESOLVED after ~49s
PASS telemetry_down: 0 failed writes with all telemetry stores down; collector memory 79.39MiB / 256MiB (limit 256MiB); stores restarted
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab6/mtusi2026lab6-fork$ python3 student-tests/level4_observability.py all | tee evidence/level4-observability.txt
FATAL: terminating connection due to administrator command
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
connection to server was lost
PASS trace_chain: trace dcc088e178af4fd97d573719cf4161a5 spans: ['messenger-api:INSERT', 'messenger-api:POST /api/v1/chats/{chat_id}/attachments', 'messenger-api:POST /api/v1/chats/{chat_id}/attachments http receive', 'messenger-api:POST /api/v1/chats/{chat_id}/attachments http send', 'messenger-api:S3.PutObject', 'messenger-api:SELECT', 'messenger-api:outbox.enqueue', 'messenger-dispatcher:attachment-jobs publish', 'messenger-worker:INSERT', 'messenger-worker:S3.DeleteObject', 'messenger-worker:S3.GetObject', 'messenger-worker:S3.HeadObject', 'messenger-worker:S3.PutObject', 'messenger-worker:SELECT', 'messenger-worker:UPDATE', 'messenger-worker:attachment-jobs process', 'messenger-worker:imgproc.run', 'messenger-worker:job.claim', 'messenger-worker:job.commit_ready', 'messenger-worker:job.pipeline', 'messenger-worker:s3.download_staging', 'messenger-worker:s3.upload_final']
queue_lag: FIRING after ~117s, oldest_job_age=105s, depth=1
PASS queue_lag: ready after worker restart; RESOLVED after ~23s
db_slow: FIRING after ~89s; 5xx so far: 111 of 133
PASS db_slow: lock released; RESOLVED after ~49s
PASS telemetry_down: 0 failed writes with all telemetry stores down; collector memory 79.39MiB / 256MiB (limit 256MiB); stores restarted
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab6/mtusi2026lab6-fork$
+17
View File
@@ -0,0 +1,17 @@
{
"lab": 6,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.042,
"concurrency": 4,
"successful_requests": 1499,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 49.897,
"successful_latency_ms": {
"p50": 60.461,
"p95": 203.526,
"p99": 322.168
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}