Реализовать лабораторную 6: OpenTelemetry, Grafana, SLO и burn-rate alerts
- api и worker отдают traces, metrics и logs по OTLP в Collector (memory_limiter, redaction, batch, ограниченная очередь и retry); хранилища: Prometheus (OTLP receiver), Loki, Tempo; Grafana с provisioning datasources и dashboard «Messenger lab6» - W3C trace context через outbox и RabbitMQ: producer/consumer spans связывают upload, публикации и попытки worker в одном trace - SLO доступности API (SLI на HAProxy) и времени до ready, multiwindow burn-rate alerts, ApiHighErrorRate, JobQueueLagGrowing, DbPoolSaturated, TelemetryExportFailing; unit-тесты promtool, runbooks - кампания трека 2 (k6, 6 отказов по расписанию), разбор и графики; проверки сигналов и истории telemetry, evidence и REPORT.md
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
$ make check
|
||||
python3 scripts/check_contract.py
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
$ make validate PYTHON=.venv/bin/python
|
||||
.venv/bin/python scripts/validate_openapi.py
|
||||
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.
|
||||
$ make test BASE_URL=http://localhost:8096
|
||||
python3 tests/smoke.py --base-url "http://localhost:8096"
|
||||
PASS: lab6 public API scenario; infrastructure and grading evidence remain separate.
|
||||
@@ -0,0 +1,11 @@
|
||||
# replicas before
|
||||
messenger-lab6-api-1 81757059610d running
|
||||
messenger-lab6-api-2 71ee4d68b6e6 running
|
||||
$ make test-failover ACTION_SCRIPT=scripts/stop-one.sh BASE_URL=http://localhost:8096
|
||||
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://localhost:8096"
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 133, "failed_attempts": 0, "first_recovery_seconds": 2.942}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
# replicas after
|
||||
messenger-lab6-api-1 81757059610d running
|
||||
messenger-lab6-api-2 71ee4d68b6e6 exited
|
||||
@@ -0,0 +1,11 @@
|
||||
# replicas before (restored: docker compose start api)
|
||||
messenger-lab6-api-1 81757059610d running
|
||||
messenger-lab6-api-2 71ee4d68b6e6 running
|
||||
$ make test-failover ACTION_SCRIPT=scripts/stop-one.sh BASE_URL=http://localhost:8096
|
||||
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://localhost:8096"
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 105, "failed_attempts": 0, "first_recovery_seconds": 4.884}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
# replicas after
|
||||
messenger-lab6-api-1 81757059610d exited
|
||||
messenger-lab6-api-2 71ee4d68b6e6 running
|
||||
@@ -0,0 +1,42 @@
|
||||
# before 2026-10-30T22:03:31Z
|
||||
messenger-lab6-api-1 running started=2026-10-30T22:03:13.16572903Z
|
||||
messenger-lab6-api-2 running started=2026-10-30T22:03:13.472982214Z
|
||||
messenger-lab6-grafana-1 running started=2026-10-30T21:27:12.963076303Z
|
||||
messenger-lab6-lb-1 running started=2026-10-30T21:27:49.144940174Z
|
||||
messenger-lab6-loki-1 running started=2026-10-30T21:49:05.434203985Z
|
||||
messenger-lab6-migrate-1 exited started=2026-10-30T22:03:25.18357094Z
|
||||
messenger-lab6-otel-collector-1 running started=2026-10-30T21:49:04.841388966Z
|
||||
messenger-lab6-postgres-1 running started=2026-10-30T21:27:02.601334894Z
|
||||
messenger-lab6-prometheus-1 running started=2026-10-30T21:27:02.373327049Z
|
||||
messenger-lab6-rabbitmq-1 running started=2026-10-30T22:03:17.333799174Z
|
||||
messenger-lab6-reconciler-1 running started=2026-10-30T22:02:04.211864462Z
|
||||
messenger-lab6-s3-1 running started=2026-10-30T21:27:38.005413897Z
|
||||
messenger-lab6-s3-init-1 exited started=2026-10-30T22:03:25.701746746Z
|
||||
messenger-lab6-seaweedfs-1 running started=2026-10-30T21:27:22.289141705Z
|
||||
messenger-lab6-tempo-1 running started=2026-10-30T21:49:05.133731622Z
|
||||
messenger-lab6-worker-1 running started=2026-10-30T22:03:29.390180094Z
|
||||
messenger-lab6-worker-2 running started=2026-10-30T22:03:29.566901411Z
|
||||
|
||||
$ make test-persistence ACTION_SCRIPT=scripts/restart.sh BASE_URL=http://localhost:8096
|
||||
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://localhost:8096"
|
||||
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
|
||||
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
|
||||
# after 2026-10-30T22:04:27Z
|
||||
messenger-lab6-api-1 running started=2026-10-30T22:04:21.157055064Z
|
||||
messenger-lab6-api-2 running started=2026-10-30T22:04:20.940382017Z
|
||||
messenger-lab6-grafana-1 running started=2026-10-30T22:03:48.451183698Z
|
||||
messenger-lab6-lb-1 running started=2026-10-30T22:04:26.884395625Z
|
||||
messenger-lab6-loki-1 running started=2026-10-30T22:03:39.035816792Z
|
||||
messenger-lab6-migrate-1 exited started=2026-10-30T22:04:18.354473742Z
|
||||
messenger-lab6-otel-collector-1 running started=2026-10-30T22:03:39.13142939Z
|
||||
messenger-lab6-postgres-1 running started=2026-10-30T22:03:38.38063198Z
|
||||
messenger-lab6-prometheus-1 running started=2026-10-30T22:03:38.109558741Z
|
||||
messenger-lab6-rabbitmq-1 running started=2026-10-30T22:03:39.316004195Z
|
||||
messenger-lab6-reconciler-1 running started=2026-10-30T22:04:20.936750026Z
|
||||
messenger-lab6-s3-1 running started=2026-10-30T22:04:17.090338152Z
|
||||
messenger-lab6-s3-init-1 exited started=2026-10-30T22:04:19.79217583Z
|
||||
messenger-lab6-seaweedfs-1 running started=2026-10-30T22:03:57.426716035Z
|
||||
messenger-lab6-tempo-1 running started=2026-10-30T22:03:38.291222478Z
|
||||
messenger-lab6-worker-1 running started=2026-10-30T22:04:20.931270603Z
|
||||
messenger-lab6-worker-2 running started=2026-10-30T22:04:21.103570215Z
|
||||
@@ -0,0 +1,30 @@
|
||||
$ scripts/check-s3-security.sh
|
||||
PASS анонимный GET объекта: 403
|
||||
PASS анонимный LIST bucket: 403
|
||||
PASS анонимный PUT объекта: 403
|
||||
api GetObject own bucket: allowed
|
||||
api ListObjectsV2 own bucket: denied (403 AccessDenied)
|
||||
api CreateBucket other: denied (403 AccessDenied)
|
||||
api PutObject other bucket: denied (403 AccessDenied)
|
||||
api PutObject own bucket: allowed
|
||||
api DeleteObject own bucket: allowed
|
||||
reconciler GetObject own bucket: allowed
|
||||
reconciler ListObjectsV2 own bucket: allowed
|
||||
reconciler CreateBucket other: denied (403 AccessDenied)
|
||||
reconciler PutObject other bucket: denied (403 AccessDenied)
|
||||
reconciler PutObject own bucket: allowed
|
||||
reconciler DeleteObject own bucket: allowed
|
||||
PASS api GetObject: allowed
|
||||
PASS api ListObjectsV2 (не нужен API): denied
|
||||
PASS api CreateBucket: denied
|
||||
PASS api PutObject в чужой bucket: denied
|
||||
PASS reconciler ListObjectsV2: allowed
|
||||
PASS reconciler CreateBucket: denied
|
||||
PASS seaweedfs:8888 из контейнера api: unreachable
|
||||
PASS seaweedfs:9333 из контейнера api: unreachable
|
||||
PASS seaweedfs:8080 из контейнера api: unreachable
|
||||
PASS filer по IP 192.168.228.2:8888 из контейнера api: unreachable
|
||||
PASS сервисы с опубликованными портами: grafana lb
|
||||
PASS повторный s3-init: bucket messenger-attachments: exists
|
||||
PASS: bucket приватен, права минимальны, внутренние порты закрыты
|
||||
exit=0
|
||||
@@ -0,0 +1,3 @@
|
||||
$ make test BASE_URL=http://localhost:8096
|
||||
python3 tests/smoke.py --base-url "http://localhost:8096"
|
||||
PASS: lab6 public API scenario; infrastructure and grading evidence remain separate.
|
||||
@@ -0,0 +1,2 @@
|
||||
$ python3 student-tests/telemetry_history.py --grafana http://localhost:3096 --trace-id 8fc9d84548b361b4a5bb788aff701bed --before 1793397811 # trace из telemetry-check.txt, записан до restart.sh (2026-10-30T22:03:31Z)
|
||||
PASS история после перезапуска: trace 8fc9d84548b361b4a5bb788aff701bed (7 spans), 1 строк лога, 11 точек метрики API за 10 мин до перезапуска
|
||||
@@ -0,0 +1,14 @@
|
||||
$ python3 student-tests/worker_outage.py --base-url http://localhost:8096
|
||||
0.8 s docker compose stop worker
|
||||
0.9 s upload → 202 queued, attachment 5f65a400-9b2d-4582-be38-793474813edf
|
||||
0.9 s сообщение с queued-вложением → 201, message 5cdc6020-756a-433c-9cb1-63e3068a8d78
|
||||
0.9 s content и content?variant=thumbnail → 409 conflict
|
||||
1.0 s другие сообщения без worker: POST 201, история 200
|
||||
4.7 s job 164346fb-f5a9-41a5-af9e-13039146884a queued attempts=0; outbox опубликован (publisher confirm); очередь (messages, unacked, consumers) = (0, 0, 2)
|
||||
9.2 s docker compose restart api (обе реплики, SIGTERM)
|
||||
19.1 s docker compose restart rabbitmq; после рестарта очередь = (1, 0, 0)
|
||||
19.2 s вложение после рестартов: queued (прежний токен)
|
||||
24.4 s docker compose start worker
|
||||
25.8 s ready через 1.3 s после старта worker; job: done attempts=1
|
||||
25.9 s thumbnail 256x160 JPEG (sha256 = метаданным), оригинал совпадает побайтно; варианты: crop 128x128, optimized 320x200, thumbnail 256x160
|
||||
PASS: job accepted while worker was down survived API + broker restart and reached ready
|
||||
@@ -0,0 +1,9 @@
|
||||
$ python3 student-tests/telemetry_check.py --base-url http://localhost:8096 --grafana http://localhost:3096
|
||||
PASS 1 trace 3be3a52b1bc7592022498960d9b57175: server span POST /api/v1/chats/{chat_id}/messages (3 SQL), лог request_id=917016f0-d5b9-4e1d-b684-6036ed78bf5c
|
||||
PASS 2 404 request_id=1a485fd8-d0ae-4ad4-b55b-39f7a183c316 → лог → trace 6f8b505591fc6085762a3910b43302a7
|
||||
PASS 3 trace ceabc7efebed2673382e4eb476841b5e: upload → publish → process (39 spans), лог job.ready в том же trace
|
||||
PASS 4 trace d16e7fd868b0192702c0722769ff773a: publish#1 → process#1 (retry, S3 timeout) → publish#2 → process#2 (ready)
|
||||
PASS 5 метрики: 14 обязательных есть; 121 labels без id/URL; 10 шаблонов http_route
|
||||
PASS 6 секреты/контент не найдены в 8 ответах Tempo/Loki и во всём Loki за 30 мин
|
||||
PASS 7 dashboard «Messenger lab6»: 35 панелей, 58/60 запросов с данными (пусто: ['Потери telemetry (элементов/с)'])
|
||||
PASS: сигналы lab6 (traces, logs, metrics, связь через очередь, retry, отсутствие секретов, dashboard)
|
||||
@@ -0,0 +1 @@
|
||||
{"offered_rps":20,"write_share":0.3,"upload_share":0.05,"duration":"60m","requests":26590,"failed":3837,"failed_by_op":{"read":2463,"write":1166,"upload":208},"error_ratio":0.144302,"dropped_iterations":0,"latency_ms":{"avg":80.18475536630328,"p50":4.6814564999999995,"p95":94.78351894999982,"p99":2006.9032155,"max":10403.959261},"read_ms":{"avg":71.39350546413576,"p50":3.77024,"p95":60.99043939999983,"p99":2006.3473886000002,"max":10084.566864},"write_ms":{"avg":90.3292678894906,"p50":5.861717,"p95":117.37453039999987,"p99":2008.46800368,"max":10103.985914},"upload_ms":{"avg":136.07883343711194,"p50":23.393403499999998,"p95":345.18651789999916,"p99":2006.78961351,"max":10403.959261},"max_vus":100}
|
||||
@@ -0,0 +1,176 @@
|
||||
[
|
||||
{
|
||||
"name": "baseline",
|
||||
"actions": [],
|
||||
"watch": [
|
||||
"ApiHighErrorRate",
|
||||
"ApiAvailabilityFastBurn",
|
||||
"ApiAvailabilitySlowBurn",
|
||||
"DbPoolSaturated",
|
||||
"JobQueueLagGrowing",
|
||||
"ReadyLatencyFastBurn",
|
||||
"ReadyLatencySlowBurn",
|
||||
"TelemetryExportFailing"
|
||||
],
|
||||
"fault_start": 1793398480.189784,
|
||||
"fault_end": 1793398630.166636,
|
||||
"end": 1793398630.16669
|
||||
},
|
||||
{
|
||||
"name": "worker-stop",
|
||||
"actions": [
|
||||
[
|
||||
1793398630.1,
|
||||
"stop worker"
|
||||
],
|
||||
[
|
||||
1793398991.8,
|
||||
"start worker"
|
||||
]
|
||||
],
|
||||
"watch": [
|
||||
"JobQueueLagGrowing",
|
||||
"ReadyLatencyFastBurn",
|
||||
"ReadyLatencySlowBurn"
|
||||
],
|
||||
"fault_start": 1793398630.145775,
|
||||
"fault_end": 1793398993.755093,
|
||||
"end": 1793399323.7577658
|
||||
},
|
||||
{
|
||||
"name": "spike",
|
||||
"actions": [
|
||||
[
|
||||
1793398630.1,
|
||||
"pause postgres"
|
||||
],
|
||||
[
|
||||
1793398690.6,
|
||||
"unpause postgres"
|
||||
]
|
||||
],
|
||||
"watch": [
|
||||
"ApiHighErrorRate",
|
||||
"ApiAvailabilityFastBurn",
|
||||
"ApiAvailabilitySlowBurn",
|
||||
"DbPoolSaturated"
|
||||
],
|
||||
"fault_start": 1793398630.146558,
|
||||
"fault_end": 1793398690.735362,
|
||||
"end": 1793398960.736811
|
||||
},
|
||||
{
|
||||
"name": "telemetry-backends",
|
||||
"actions": [
|
||||
[
|
||||
1793398720.1,
|
||||
"stop tempo loki"
|
||||
],
|
||||
[
|
||||
1793398841.1,
|
||||
"start tempo loki"
|
||||
]
|
||||
],
|
||||
"watch": [
|
||||
"TelemetryExportFailing"
|
||||
],
|
||||
"fault_start": 1793398720.145841,
|
||||
"fault_end": 1793398842.366372,
|
||||
"end": 1793399142.367826
|
||||
},
|
||||
{
|
||||
"name": "handler-slow",
|
||||
"actions": [
|
||||
[
|
||||
1793398870.2,
|
||||
"messenger-lab6-api-1 --cpus 0.1"
|
||||
],
|
||||
[
|
||||
1793398990.3,
|
||||
"messenger-lab6-api-1 --cpus 1"
|
||||
]
|
||||
],
|
||||
"watch": [
|
||||
"ApiHighErrorRate",
|
||||
"ApiAvailabilityFastBurn",
|
||||
"ApiAvailabilitySlowBurn",
|
||||
"DbPoolSaturated"
|
||||
],
|
||||
"fault_start": 1793398870.152113,
|
||||
"fault_end": 1793398990.379742,
|
||||
"end": 1793399050.384289
|
||||
},
|
||||
{
|
||||
"name": "api-degradation",
|
||||
"actions": [
|
||||
[
|
||||
1793399050.2,
|
||||
"pause postgres"
|
||||
],
|
||||
[
|
||||
1793399075.3,
|
||||
"unpause postgres"
|
||||
],
|
||||
[
|
||||
1793399110.5,
|
||||
"pause postgres"
|
||||
],
|
||||
[
|
||||
1793399136.1,
|
||||
"unpause postgres"
|
||||
],
|
||||
[
|
||||
1793399171.5,
|
||||
"pause postgres"
|
||||
],
|
||||
[
|
||||
1793399197.6,
|
||||
"unpause postgres"
|
||||
],
|
||||
[
|
||||
1793399232.8,
|
||||
"pause postgres"
|
||||
],
|
||||
[
|
||||
1793399258.0,
|
||||
"unpause postgres"
|
||||
],
|
||||
[
|
||||
1793399293.3,
|
||||
"pause postgres"
|
||||
],
|
||||
[
|
||||
1793399318.5,
|
||||
"unpause postgres"
|
||||
]
|
||||
],
|
||||
"watch": [
|
||||
"ApiHighErrorRate",
|
||||
"ApiAvailabilityFastBurn",
|
||||
"ApiAvailabilitySlowBurn",
|
||||
"DbPoolSaturated"
|
||||
],
|
||||
"fault_start": 1793399050.1484978,
|
||||
"fault_end": 1793399350.1513112,
|
||||
"end": 1793399620.1672971
|
||||
},
|
||||
{
|
||||
"name": "collector-down",
|
||||
"actions": [
|
||||
[
|
||||
1793399630.2,
|
||||
"stop otel-collector"
|
||||
],
|
||||
[
|
||||
1793399691.9,
|
||||
"start otel-collector"
|
||||
]
|
||||
],
|
||||
"watch": [
|
||||
"TelemetryExportFailing"
|
||||
],
|
||||
"fault_start": 1793399630.1582222,
|
||||
"fault_end": 1793399692.265625,
|
||||
"end": 1793399752.266947
|
||||
}
|
||||
]
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,168 @@
|
||||
## Alerts по фазам (мин:с от начала отказа; снятие — от конца отказа)
|
||||
|
||||
| Фаза | Отказ | Alert | pending | firing | снят после конца | firing всего | интервалов |
|
||||
|---|---|---|---|---|---|---|---|
|
||||
| baseline | 2:30 | нет | — | — | — | — | — |
|
||||
| worker-stop | 6:04 | JobQueueLagGrowing | 2:10 | 3:10 | 0:36 | 3:30 | 1 |
|
||||
| worker-stop | 6:04 | ReadyLatencyFastBurn | — | 6:40 | — | 5:00 | 1 |
|
||||
| worker-stop | 6:04 | ReadyLatencySlowBurn | — | 6:40 | — | 5:04 | 1 |
|
||||
| spike | 1:01 | ApiAvailabilitySlowBurn | — | 1:00 | — | 4:41 | 1 |
|
||||
| spike | 1:01 | ApiHighErrorRate | 0:30 | 2:30 | — | 3:11 | 1 |
|
||||
| spike | 1:01 | DbPoolSaturated | 4:30 | — | — | 0:00 | 0 |
|
||||
| telemetry-backends | 2:02 | TelemetryExportFailing | 0:20 | 1:20 | — | 5:40 | 1 |
|
||||
| handler-slow | 2:00 | ApiAvailabilitySlowBurn (горел до отказа) | — | — | — | 3:10 | 1 |
|
||||
| handler-slow | 2:00 | ApiHighErrorRate (горел до отказа) | — | — | −0:10 | 1:50 | 1 |
|
||||
| handler-slow | 2:00 | DbPoolSaturated | 0:30 | — | — | 0:00 | 0 |
|
||||
| api-degradation | 5:00 | ApiAvailabilityFastBurn | — | 2:50 | 4:20 | 6:30 | 1 |
|
||||
| api-degradation | 5:00 | ApiAvailabilitySlowBurn (горел до отказа) | — | — | — | 9:40 | 1 |
|
||||
| api-degradation | 5:00 | ApiHighErrorRate | 0:30 | 2:30 | 4:20 | 6:50 | 1 |
|
||||
| api-degradation | 5:00 | DbPoolSaturated | 2:10 | — | — | 0:00 | 0 |
|
||||
| collector-down | 1:02 | нет | — | — | — | — | — |
|
||||
|
||||
## Firing за весь прогон (мин:с от начала baseline)
|
||||
|
||||
- ApiAvailabilityFastBurn: 12:20–18:50
|
||||
- ApiAvailabilitySlowBurn: 3:30–22:20
|
||||
- ApiHighErrorRate: 5:00–8:20, 12:00–18:50
|
||||
- JobQueueLagGrowing: 5:40–9:10
|
||||
- ReadyLatencyFastBurn: 9:10–14:10
|
||||
- ReadyLatencySlowBurn: 9:10–22:20
|
||||
- TelemetryExportFailing: 5:20–11:00
|
||||
|
||||
## Метрики в окне отказа (максимум)
|
||||
|
||||
| Фаза | sli_5xx_clients_5m | 5xx_clients_1m | 5xx_api_metrics_1m | api_p99_s | oldest_job_age_s | ready_p95_s | worker_saturation | queue_consumers | api_burn_5m | api_burn_1h | api_burn_6h | ready_burn_5m | ready_burn_1h |
|
||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||
| baseline | 0 | 0 | 0 | 0.22 | 0.0417 | 0.5625 | 0 | 2 | 0 | 1.4233 | 1.4213 | 0 | 0.0803 |
|
||||
| worker-stop | 0.2181 | 1 | 0.9172 | 10 | 296.8 | 0.4849 | 0 | 2 | 43.6168 | 9.0549 | 9.0335 | 0 | 0 |
|
||||
| spike | 0.188 | 1 | 0.9172 | 10 | 0.076 | 0.4849 | 0 | 2 | 37.6092 | 7.6014 | 7.5856 | 0 | 0 |
|
||||
| telemetry-backends | 0.21 | 0.441 | 0 | 0.2727 | 146.395 | — | — | 0 | 41.994 | 8.9979 | 8.976 | 0 | 0 |
|
||||
| handler-slow | 0.209 | 0.0041 | 0.001 | 2.3224 | 296.8 | — | — | 0 | 41.8051 | 8.2198 | 8.1931 | 0 | 0 |
|
||||
| api-degradation | 0.4491 | 0.5271 | 0.1225 | 10 | 2.9004 | 292.36 | 0.5 | 2 | 89.8276 | 18.7807 | 18.4425 | 81.3263 | 15.8051 |
|
||||
| collector-down | 0 | 0 | 0 | 0.0786 | 0 | 0.475 | 0 | 2 | 0 | 16.7316 | 16.2113 | 0 | 12.7508 |
|
||||
|
||||
## Насыщение по экземплярам (максимум в окне отказа)
|
||||
|
||||
**baseline**
|
||||
- sql_p99_by_job_s: messenger-api 0.0469, messenger-worker 0.035
|
||||
- pool_pending_by_job: messenger-api 0, messenger-worker 0
|
||||
- eventloop_p99_by_instance_s: api-2 messenger-api 0.0227, api-1 messenger-api 0.0247, worker-2 messenger-worker 0.0191, worker-1 messenger-worker 0.0192
|
||||
- cpu_by_instance: api-2 messenger-api 0.0536, api-1 messenger-api 0.0612, worker-2 messenger-worker 0.0408, worker-1 messenger-worker 0.043
|
||||
- api_p99_by_instance_s: api-2 0.2167, api-1 0.225
|
||||
- медленные trace (>300 мс), медианы мс: {'total_ms': 435, 'pool_wait_ms': 1, 'sql_ms': 108, 's3_ms': 237, 'self_ms': 90}; по репликам: {'api-2': 1}
|
||||
|
||||
**spike**
|
||||
- sql_p99_by_job_s: messenger-api 0.0342, messenger-worker 0.0359
|
||||
- pool_pending_by_job: messenger-api 0, messenger-worker 0
|
||||
- eventloop_p99_by_instance_s: api-2 messenger-api 0.0236, api-1 messenger-api 0.0264, worker-2 messenger-worker 0.0158, worker-1 messenger-worker 0.0182
|
||||
- cpu_by_instance: api-2 messenger-api 0.054, api-1 messenger-api 0.0583, worker-2 messenger-worker 0.0409, worker-1 messenger-worker 0.0498
|
||||
- api_p99_by_instance_s: api-2 10, api-1 10
|
||||
- медленные trace (>300 мс), медианы мс: {'total_ms': 2004, 'pool_wait_ms': 2001, 'sql_ms': 0, 's3_ms': 0, 'self_ms': 2}; по репликам: {'api-2': 11, 'api-1': 9}
|
||||
|
||||
**handler-slow**
|
||||
- sql_p99_by_job_s: messenger-api 0.4658
|
||||
- pool_pending_by_job: messenger-api 7
|
||||
- eventloop_p99_by_instance_s: api-2 messenger-api 0.0694, api-1 messenger-api 7.3065
|
||||
- cpu_by_instance: api-2 messenger-api 0.0915, api-1 messenger-api 0.0894
|
||||
- api_p99_by_instance_s: api-2 0.6508, api-1 4.975
|
||||
- медленные trace (>300 мс), медианы мс: {'total_ms': 898, 'pool_wait_ms': 1, 'sql_ms': 600, 's3_ms': 0, 'self_ms': 4}; по репликам: {'api-1': 18, 'api-2': 1}
|
||||
|
||||
**api-degradation**
|
||||
- sql_p99_by_job_s: messenger-api 0.9968, messenger-worker 0.372
|
||||
- pool_pending_by_job: messenger-api 11, messenger-worker 0
|
||||
- eventloop_p99_by_instance_s: api-2 messenger-api 0.0976, api-1 messenger-api 0.0863, worker-2 messenger-worker 0.0871, worker-1 messenger-worker 0.0891
|
||||
- cpu_by_instance: api-2 messenger-api 0.0848, api-1 messenger-api 0.0906, worker-2 messenger-worker 0.1838, worker-1 messenger-worker 0.1913
|
||||
- api_p99_by_instance_s: api-2 10, api-1 10
|
||||
- медленные trace (>300 мс), медианы мс: {'total_ms': 2001, 'pool_wait_ms': 1999, 'sql_ms': 0, 's3_ms': 0, 'self_ms': 1}; по репликам: {'api-1': 11, 'api-2': 9}
|
||||
|
||||
## События ERROR/WARN в логах за фазу
|
||||
|
||||
- baseline: нет
|
||||
- worker-stop: messenger-api http.dependency_unavailable 369, messenger-api http.request 354, messenger-api sweeper.error 70, messenger-api relay.db_unavailable 6, messenger-api s3.error 1
|
||||
- spike: messenger-api http.dependency_unavailable 63, messenger-api http.request 62, messenger-api sweeper.error 24, messenger-api relay.db_unavailable 2
|
||||
- telemetry-backends: messenger-api http.dependency_unavailable 112, messenger-api http.request 106, messenger-api sweeper.error 20, messenger-api relay.db_unavailable 1
|
||||
- handler-slow: messenger-api http.dependency_unavailable 3, messenger-api http.request 3
|
||||
- api-degradation: messenger-api http.dependency_unavailable 303, messenger-api http.request 289, messenger-api sweeper.error 46, messenger-api relay.db_unavailable 4, messenger-api s3.error 1
|
||||
- collector-down: messenger-api http.request 2, messenger-api http.dependency_unavailable 1, messenger-worker job.requeued 1, messenger-api s3.error 1
|
||||
|
||||
## Недоступность telemetry
|
||||
|
||||
```json
|
||||
{
|
||||
"backends_down_s": 121,
|
||||
"collector_dropped": {
|
||||
"__name__=otelcol_exporter_send_failed_log_records_total exporter=otlp_http/loki": 174,
|
||||
"__name__=otelcol_exporter_send_failed_spans_total exporter=otlp_grpc/tempo": 1102
|
||||
},
|
||||
"collector_refused_memory_limiter": {
|
||||
"__name__=otelcol_receiver_refused_metric_points_total": 0,
|
||||
"__name__=otelcol_receiver_refused_log_records_total": 0,
|
||||
"__name__=otelcol_receiver_refused_spans_total": 0
|
||||
},
|
||||
"collector_queue_max": {
|
||||
"otlp_grpc/tempo": {
|
||||
"max": 19368.0,
|
||||
"mean": 3405.4651
|
||||
},
|
||||
"otlp_http/loki": {
|
||||
"max": 2325.0,
|
||||
"mean": 362.7674
|
||||
},
|
||||
"otlp_http/prometheus": {
|
||||
"max": 0.0,
|
||||
"mean": 0.0
|
||||
}
|
||||
},
|
||||
"collector_rss_mib": {
|
||||
"all": {
|
||||
"max": 121.4258,
|
||||
"mean": 103.1724
|
||||
}
|
||||
},
|
||||
"lb_responses_during_phase": {
|
||||
"1xx": 0,
|
||||
"2xx": 7349,
|
||||
"3xx": 0,
|
||||
"4xx": 0,
|
||||
"5xx": 1087,
|
||||
"other": 0
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Недоступность telemetry
|
||||
|
||||
```json
|
||||
{
|
||||
"collector_down_s": 62,
|
||||
"sdk_spans_started_during_phase": {
|
||||
"job=messenger-api": 19095,
|
||||
"job=messenger-worker": 2932
|
||||
},
|
||||
"tempo_api_traces_found_while_collector_down": 117,
|
||||
"api_rss_mib": {
|
||||
"api-2": {
|
||||
"max": 100.25,
|
||||
"mean": 95.7406
|
||||
},
|
||||
"api-1": {
|
||||
"max": 97.8281,
|
||||
"mean": 95.6253
|
||||
}
|
||||
},
|
||||
"lb_responses_during_phase": {
|
||||
"1xx": 0,
|
||||
"2xx": 1155,
|
||||
"3xx": 0,
|
||||
"4xx": 0,
|
||||
"5xx": 0,
|
||||
"other": 0
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## k6
|
||||
|
||||
```json
|
||||
[{"offered_rps": 20, "write_share": 0.3, "upload_share": 0.05, "duration": "60m", "requests": 26590, "failed": 3837, "failed_by_op": {"read": 2463, "write": 1166, "upload": 208}, "error_ratio": 0.144302, "dropped_iterations": 0, "latency_ms": {"avg": 80.18475536630328, "p50": 4.6814564999999995, "p95": 94.78351894999982, "p99": 2006.9032155, "max": 10403.959261}, "read_ms": {"avg": 71.39350546413576, "p50": 3.77024, "p95": 60.99043939999983, "p99": 2006.3473886000002, "max": 10084.566864}, "write_ms": {"avg": 90.3292678894906, "p50": 5.861717, "p95": 117.37453039999987, "p99": 2008.46800368, "max": 10103.985914}, "upload_ms": {"avg": 136.07883343711194, "p50": 23.393403499999998, "p95": 345.18651789999916, "p99": 2006.78961351, "max": 10403.959261}, "max_vus": 100}]
|
||||
```
|
||||
@@ -0,0 +1,34 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="1300" height="430" font-family="sans-serif" font-size="11">
|
||||
<rect width="1300" height="430" fill="white"/>
|
||||
<rect x="300.9" y="20" width="52.9" height="260" fill="#eeeeee"/><text x="303.9" y="32" fill="#555">spike</text>
|
||||
<rect x="510.3" y="20" width="104.9" height="260" fill="#eeeeee"/><text x="513.3" y="44" fill="#555">handler-slow</text>
|
||||
<rect x="667.3" y="20" width="261.8" height="260" fill="#eeeeee"/><text x="670.3" y="56" fill="#555">api-degradation</text>
|
||||
<rect x="1173.4" y="20" width="54.2" height="260" fill="#eeeeee"/><text x="1176.4" y="68" fill="#555">collector-down</text>
|
||||
<line x1="170" x2="1280" y1="280.0" y2="280.0" stroke="#ddd"/><text x="164" y="284.0" text-anchor="end">0%</text>
|
||||
<line x1="170" x2="1280" y1="215.0" y2="215.0" stroke="#ddd"/><text x="164" y="219.0" text-anchor="end">25%</text>
|
||||
<line x1="170" x2="1280" y1="150.0" y2="150.0" stroke="#ddd"/><text x="164" y="154.0" text-anchor="end">50%</text>
|
||||
<line x1="170" x2="1280" y1="85.0" y2="85.0" stroke="#ddd"/><text x="164" y="89.0" text-anchor="end">75%</text>
|
||||
<line x1="170" x2="1280" y1="20.0" y2="20.0" stroke="#ddd"/><text x="164" y="24.0" text-anchor="end">100%</text>
|
||||
<polyline fill="none" stroke="#d62728" stroke-width="1.5" points="170.0,280.0 196.2,280.0 222.4,280.0 248.5,280.0 274.7,280.0 300.9,280.0 327.1,140.3 353.2,20.0 379.4,165.3 405.6,280.0 431.8,280.0 458.0,280.0 484.1,280.0 510.3,280.0 536.5,280.0 562.7,280.0 588.8,280.0 615.0,278.9 641.2,278.4 667.4,280.0 693.6,143.5 719.7,190.7 745.9,143.0 772.1,185.0 798.3,145.6 824.4,180.3 850.6,144.3 876.8,177.9 903.0,145.8 929.2,176.8 955.3,280.0 981.5,280.0 1007.7,280.0 1033.9,280.0 1060.0,280.0 1086.2,280.0 1112.4,280.0 1138.6,280.0 1164.8,280.0 1190.9,280.0"/>
|
||||
<polyline fill="none" stroke="#d62728" stroke-width="1.5" points="1243.3,280.0 1269.5,280.0"/>
|
||||
<rect x="170" y="400" width="12" height="3" fill="#d62728"/><text x="186" y="405">5xx у клиентов (HAProxy), 1m</text>
|
||||
<polyline fill="none" stroke="#ff9896" stroke-width="1.5" points="170.0,280.0 196.2,280.0 222.4,280.0 248.5,280.0 274.7,280.0 300.9,280.0 327.1,251.3 353.2,41.5 379.4,280.0 405.6,280.0 431.8,280.0 458.0,280.0 484.1,280.0 510.3,280.0 536.5,280.0 562.7,280.0 588.8,280.0 615.0,279.7 641.2,279.2 667.4,280.0 693.6,255.0 719.7,279.6 745.9,254.8 772.1,280.0 798.3,253.6 824.4,275.8 850.6,249.4 876.8,273.4 903.0,252.5 929.2,272.6 955.3,280.0 981.5,280.0 1007.7,280.0 1033.9,280.0 1060.0,280.0 1086.2,280.0 1112.4,280.0 1138.6,280.0 1164.8,280.0 1190.9,280.0"/>
|
||||
<polyline fill="none" stroke="#ff9896" stroke-width="1.5" points="1243.3,280.0 1269.5,280.0"/>
|
||||
<rect x="430" y="400" width="12" height="3" fill="#ff9896"/><text x="446" y="405">5xx в метриках API, 1m</text>
|
||||
<polyline fill="none" stroke="#1f77b4" stroke-width="1.5" points="170.0,278.1 196.2,278.2 222.4,278.2 248.5,278.3 274.7,278.3 300.9,278.3 327.1,275.1 353.2,270.1 379.4,268.3 405.6,268.5 431.8,268.7 458.0,268.9 484.1,269.1 510.3,269.3 536.5,269.5 562.7,269.7 588.8,269.8 615.0,270.0 641.2,270.1 667.4,270.2 693.6,267.7 719.7,266.9 745.9,264.7 772.1,263.9 798.3,262.0 824.4,261.1 850.6,259.3 876.8,258.4 903.0,256.7 929.2,255.7 955.3,255.9 981.5,256.2 1007.7,256.4 1033.9,256.7 1060.0,257.0 1086.2,257.3 1112.4,257.6 1138.6,257.9 1164.8,258.2 1190.9,258.3 1217.1,258.3 1243.3,258.9 1269.5,259.2"/>
|
||||
<rect x="690" y="400" width="12" height="3" fill="#1f77b4"/><text x="706" y="405">SLI 1h (fast: > 7.2 %)</text>
|
||||
<polyline fill="none" stroke="#2ca02c" stroke-width="1.5" points="170.0,278.2 196.2,278.2 222.4,278.2 248.5,278.3 274.7,278.3 300.9,278.3 327.1,275.1 353.2,270.1 379.4,268.3 405.6,268.6 431.8,268.8 458.0,269.0 484.1,269.2 510.3,269.3 536.5,269.5 562.7,269.7 588.8,269.9 615.0,270.0 641.2,270.2 667.4,270.3 693.6,267.9 719.7,267.1 745.9,264.9 772.1,264.1 798.3,262.2 824.4,261.4 850.6,259.6 876.8,258.7 903.0,257.1 929.2,256.2 955.3,256.6 981.5,256.9 1007.7,257.2 1033.9,257.5 1060.0,257.8 1086.2,258.0 1112.4,258.3 1138.6,258.6 1164.8,258.8 1190.9,259.0 1217.1,259.0 1243.3,259.6 1269.5,259.8"/>
|
||||
<rect x="950" y="400" width="12" height="3" fill="#2ca02c"/><text x="966" y="405">SLI 6h (slow: > 3 %)</text>
|
||||
<text x="164" y="311" text-anchor="end">ApiHighErrorRate</text>
|
||||
<rect x="431.8" y="302" width="174.5" height="10" fill="#ff7f0e"/>
|
||||
<rect x="798.3" y="302" width="357.8" height="10" fill="#ff7f0e"/>
|
||||
<text x="164" y="325" text-anchor="end">ApiAvailabilityFastBurn</text>
|
||||
<rect x="815.7" y="316" width="340.3" height="10" fill="#ff7f0e"/>
|
||||
<text x="164" y="339" text-anchor="end">ApiAvailabilitySlowBurn</text>
|
||||
<rect x="353.2" y="330" width="933.7" height="10" fill="#ff7f0e"/>
|
||||
<text x="170.0" y="14" text-anchor="middle" fill="#555">0 мин</text>
|
||||
<text x="431.8" y="14" text-anchor="middle" fill="#555">5 мин</text>
|
||||
<text x="693.6" y="14" text-anchor="middle" fill="#555">10 мин</text>
|
||||
<text x="955.3" y="14" text-anchor="middle" fill="#555">15 мин</text>
|
||||
<text x="1217.1" y="14" text-anchor="middle" fill="#555">20 мин</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.9 KiB |
@@ -0,0 +1,28 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="1300" height="430" font-family="sans-serif" font-size="11">
|
||||
<rect width="1300" height="430" fill="white"/>
|
||||
<rect x="300.8" y="20" width="317.3" height="260" fill="#eeeeee"/><text x="303.8" y="32" fill="#555">worker-stop</text>
|
||||
<rect x="1173.4" y="20" width="54.2" height="260" fill="#eeeeee"/><text x="1176.4" y="44" fill="#555">collector-down</text>
|
||||
<line x1="170" x2="1280" y1="280.0" y2="280.0" stroke="#ddd"/><text x="164" y="284.0" text-anchor="end">0%</text>
|
||||
<line x1="170" x2="1280" y1="215.0" y2="215.0" stroke="#ddd"/><text x="164" y="219.0" text-anchor="end">25%</text>
|
||||
<line x1="170" x2="1280" y1="150.0" y2="150.0" stroke="#ddd"/><text x="164" y="154.0" text-anchor="end">50%</text>
|
||||
<line x1="170" x2="1280" y1="85.0" y2="85.0" stroke="#ddd"/><text x="164" y="89.0" text-anchor="end">75%</text>
|
||||
<line x1="170" x2="1280" y1="20.0" y2="20.0" stroke="#ddd"/><text x="164" y="24.0" text-anchor="end">100%</text>
|
||||
<polyline fill="none" stroke="#d62728" stroke-width="1.5" points="170.0,280.0 196.2,280.0 222.4,280.0 248.5,280.0 274.7,280.0 300.9,280.0 327.1,280.0 353.2,280.0 379.4,280.0 405.6,280.0 431.8,280.0 458.0,280.0 484.1,280.0 510.3,280.0 536.5,280.0"/>
|
||||
<polyline fill="none" stroke="#d62728" stroke-width="1.5" points="641.2,20.0 667.4,68.6 693.6,72.3 719.7,87.1 745.9,89.3 772.1,99.1 798.3,107.1 824.4,116.0 850.6,120.5 876.8,129.4 903.0,280.0 929.2,280.0 955.3,280.0 981.5,280.0 1007.7,280.0 1033.9,280.0 1060.0,280.0 1086.2,280.0 1112.4,280.0 1138.6,280.0 1164.8,280.0 1190.9,280.0 1217.1,280.0 1243.3,280.0 1269.5,280.0"/>
|
||||
<rect x="170" y="400" width="12" height="3" fill="#d62728"/><text x="186" y="405">плохие вложения, 5m</text>
|
||||
<polyline fill="none" stroke="#1f77b4" stroke-width="1.5" points="170.0,279.8 196.2,279.8 222.4,279.8 248.5,280.0 274.7,280.0 300.9,280.0 327.1,280.0 353.2,280.0 379.4,280.0 405.6,280.0 431.8,280.0 458.0,280.0 484.1,280.0 510.3,280.0 536.5,280.0 562.7,280.0 588.8,280.0 615.0,280.0 641.2,241.6 667.4,238.9 693.6,239.0 719.7,239.6 745.9,239.7 772.1,240.1 798.3,240.5 824.4,240.9 850.6,241.2 876.8,241.8 903.0,241.9 929.2,242.3 955.3,242.9 981.5,243.4 1007.7,244.0 1033.9,244.6 1060.0,245.2 1086.2,245.7 1112.4,246.2 1138.6,246.6 1164.8,246.8 1190.9,246.9 1217.1,246.9 1243.3,247.9 1269.5,248.3"/>
|
||||
<rect x="430" y="400" width="12" height="3" fill="#1f77b4"/><text x="446" y="405">SLI 1h (fast: > 14.4 %)</text>
|
||||
<polyline fill="none" stroke="#2ca02c" stroke-width="1.5" points="170.0,279.8 196.2,279.8 222.4,279.8 248.5,279.8 274.7,279.8 300.9,279.8 327.1,279.8 353.2,279.8 379.4,279.8 405.6,279.8 431.8,279.8 458.0,279.8 484.1,279.8 510.3,279.8 536.5,279.8 562.7,279.8 588.8,279.8 615.0,279.8 641.2,241.7 667.4,239.5 693.6,239.7 719.7,240.3 745.9,240.3 772.1,240.7 798.3,241.1 824.4,241.6 850.6,241.9 876.8,242.4 903.0,242.5 929.2,242.9 955.3,243.5 981.5,244.0 1007.7,244.5 1033.9,245.1 1060.0,245.7 1086.2,246.2 1112.4,246.7 1138.6,247.1 1164.8,247.3 1190.9,247.3 1217.1,247.3 1243.3,248.3 1269.5,248.7"/>
|
||||
<rect x="690" y="400" width="12" height="3" fill="#2ca02c"/><text x="706" y="405">SLI 6h (slow: > 6 %)</text>
|
||||
<text x="164" y="311" text-anchor="end">JobQueueLagGrowing</text>
|
||||
<rect x="466.7" y="302" width="183.2" height="10" fill="#ff7f0e"/>
|
||||
<text x="164" y="325" text-anchor="end">ReadyLatencyFastBurn</text>
|
||||
<rect x="649.9" y="316" width="261.8" height="10" fill="#ff7f0e"/>
|
||||
<text x="164" y="339" text-anchor="end">ReadyLatencySlowBurn</text>
|
||||
<rect x="649.9" y="330" width="637.0" height="10" fill="#ff7f0e"/>
|
||||
<text x="170.0" y="14" text-anchor="middle" fill="#555">0 мин</text>
|
||||
<text x="431.8" y="14" text-anchor="middle" fill="#555">5 мин</text>
|
||||
<text x="693.6" y="14" text-anchor="middle" fill="#555">10 мин</text>
|
||||
<text x="955.3" y="14" text-anchor="middle" fill="#555">15 мин</text>
|
||||
<text x="1217.1" y="14" text-anchor="middle" fill="#555">20 мин</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.8 KiB |
Reference in New Issue
Block a user