lab6: отчёт и доказательства итогового прогона

This commit is contained in:
2026-11-12 14:44:17 +03:00
parent d90aef716a
commit 9ea03528c3
61 changed files with 4255 additions and 18 deletions
+929
View File
@@ -0,0 +1,929 @@
{
"scenario": "signals",
"result": {
"request": {
"request_id": "obs-msg-249e829f8c1e4049",
"trace_id": "c275fd38f588c08d29aea802ac7c9c83",
"spans": [
{
"service": "messenger-api",
"name": "POST /api/v1/chats/{chat_id}/messages",
"kind": "SPAN_KIND_SERVER",
"ms": 6.55,
"parent": null,
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "get",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.11,
"parent": "messenger-api: POST /api/v1/chats/{chat_id}/messages",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "ttl",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.06,
"parent": "messenger-api: POST /api/v1/chats/{chat_id}/messages",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "pool.acquire",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.01,
"parent": "messenger-api: POST /api/v1/chats/{chat_id}/messages",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "SELECT",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.38,
"parent": "messenger-api: POST /api/v1/chats/{chat_id}/messages",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "SELECT",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.18,
"parent": "messenger-api: SELECT",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "pool.acquire",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.0,
"parent": "messenger-api: POST /api/v1/chats/{chat_id}/messages",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "SELECT",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.79,
"parent": "messenger-api: POST /api/v1/chats/{chat_id}/messages",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "SELECT",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.29,
"parent": "messenger-api: SELECT",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "pool.acquire",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.0,
"parent": "messenger-api: POST /api/v1/chats/{chat_id}/messages",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "BEGIN",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.18,
"parent": "messenger-api: POST /api/v1/chats/{chat_id}/messages",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "DELETE",
"kind": "SPAN_KIND_CLIENT",
"ms": 1.54,
"parent": "messenger-api: POST /api/v1/chats/{chat_id}/messages",
"outcome": null,
"attempt": null,
"status": ""
}
],
"log": {
"line": "http request",
"labels": {
"detected_level": "info",
"event": "http.request",
"request_id": "obs-msg-249e829f8c1e4049",
"route": "/api/v1/chats/{chat_id}/messages",
"service_name": "messenger-api",
"severity_text": "INFO",
"span_id": "ce40a5e763ec9dd8",
"status": "201",
"trace_id": "c275fd38f588c08d29aea802ac7c9c83"
}
}
},
"upload": {
"request_id": "obs-upload-e0c3f49f30f5446d",
"trace_id": "cf8628e62914dd27bef25fbfca80ba11",
"services": [
"messenger-api",
"messenger-relay",
"messenger-worker"
],
"links": {
"api server → relay producer": true,
"relay producer → worker consumer": true,
"worker consumer → S3 PUT": true,
"worker consumer → image.decode": true
},
"span_count": 65,
"worker_db_spans": [
"BEGIN",
"COMMIT",
"INSERT",
"SELECT",
"UPDATE",
"batch start",
"pool.acquire"
],
"tree": [
{
"service": "messenger-api",
"name": "POST /api/v1/chats/{chat_id}/attachments",
"kind": "SPAN_KIND_SERVER",
"ms": 14.68,
"parent": null,
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "get",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.07,
"parent": "messenger-api: POST /api/v1/chats/{chat_id}/attachments",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "ttl",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.06,
"parent": "messenger-api: POST /api/v1/chats/{chat_id}/attachments",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "pool.acquire",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.01,
"parent": "messenger-api: POST /api/v1/chats/{chat_id}/attachments",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "SELECT",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.2,
"parent": "messenger-api: POST /api/v1/chats/{chat_id}/attachments",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "pool.acquire",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.0,
"parent": "messenger-api: POST /api/v1/chats/{chat_id}/attachments",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "SELECT",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.37,
"parent": "messenger-api: POST /api/v1/chats/{chat_id}/attachments",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "SELECT",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.1,
"parent": "messenger-api: SELECT",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "pool.acquire",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.0,
"parent": "messenger-api: POST /api/v1/chats/{chat_id}/attachments",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "INSERT",
"kind": "SPAN_KIND_CLIENT",
"ms": 1.69,
"parent": "messenger-api: POST /api/v1/chats/{chat_id}/attachments",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "INSERT",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.46,
"parent": "messenger-api: INSERT",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "S3 PUT",
"kind": "SPAN_KIND_CLIENT",
"ms": 4.93,
"parent": "messenger-api: POST /api/v1/chats/{chat_id}/attachments",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "pool.acquire",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.01,
"parent": "messenger-api: POST /api/v1/chats/{chat_id}/attachments",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "BEGIN",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.13,
"parent": "messenger-api: POST /api/v1/chats/{chat_id}/attachments",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "UPDATE",
"kind": "SPAN_KIND_CLIENT",
"ms": 1.34,
"parent": "messenger-api: POST /api/v1/chats/{chat_id}/attachments",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "UPDATE",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.26,
"parent": "messenger-api: UPDATE",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "INSERT",
"kind": "SPAN_KIND_CLIENT",
"ms": 1.56,
"parent": "messenger-api: POST /api/v1/chats/{chat_id}/attachments",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "INSERT",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.44,
"parent": "messenger-api: INSERT",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "INSERT",
"kind": "SPAN_KIND_CLIENT",
"ms": 1.48,
"parent": "messenger-api: POST /api/v1/chats/{chat_id}/attachments",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "INSERT",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.29,
"parent": "messenger-api: INSERT",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "INSERT",
"kind": "SPAN_KIND_CLIENT",
"ms": 1.82,
"parent": "messenger-api: POST /api/v1/chats/{chat_id}/attachments",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "INSERT",
"kind": "SPAN_KIND_CLIENT",
"ms": 1.19,
"parent": "messenger-api: INSERT",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-api",
"name": "COMMIT",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.23,
"parent": "messenger-api: POST /api/v1/chats/{chat_id}/attachments",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-relay",
"name": "attachment.process publish",
"kind": "SPAN_KIND_PRODUCER",
"ms": 1.79,
"parent": "messenger-api: POST /api/v1/chats/{chat_id}/attachments",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-worker",
"name": "attachment.process process",
"kind": "SPAN_KIND_CONSUMER",
"ms": 39.52,
"parent": "messenger-relay: attachment.process publish",
"outcome": "done",
"attempt": "1",
"status": ""
},
{
"service": "messenger-worker",
"name": "pool.acquire",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.16,
"parent": "messenger-worker: attachment.process process",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-worker",
"name": "BEGIN",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.12,
"parent": "messenger-worker: attachment.process process",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-worker",
"name": "SELECT",
"kind": "SPAN_KIND_CLIENT",
"ms": 3.24,
"parent": "messenger-worker: attachment.process process",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-worker",
"name": "SELECT",
"kind": "SPAN_KIND_CLIENT",
"ms": 1.66,
"parent": "messenger-worker: SELECT",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-worker",
"name": "SELECT",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.33,
"parent": "messenger-worker: attachment.process process",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-worker",
"name": "SELECT",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.2,
"parent": "messenger-worker: SELECT",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-worker",
"name": "SELECT",
"kind": "SPAN_KIND_CLIENT",
"ms": 1.33,
"parent": "messenger-worker: attachment.process process",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-worker",
"name": "SELECT",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.43,
"parent": "messenger-worker: SELECT",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-worker",
"name": "UPDATE",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.65,
"parent": "messenger-worker: attachment.process process",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-worker",
"name": "UPDATE",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.13,
"parent": "messenger-worker: UPDATE",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-worker",
"name": "UPDATE",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.66,
"parent": "messenger-worker: attachment.process process",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-worker",
"name": "UPDATE",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.11,
"parent": "messenger-worker: UPDATE",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-worker",
"name": "INSERT",
"kind": "SPAN_KIND_CLIENT",
"ms": 1.52,
"parent": "messenger-worker: attachment.process process",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-worker",
"name": "INSERT",
"kind": "SPAN_KIND_CLIENT",
"ms": 1.03,
"parent": "messenger-worker: INSERT",
"outcome": null,
"attempt": null,
"status": ""
},
{
"service": "messenger-worker",
"name": "COMMIT",
"kind": "SPAN_KIND_CLIENT",
"ms": 0.27,
"parent": "messenger-worker: attachment.process process",
"outcome": null,
"attempt": null,
"status": ""
}
],
"worker_log_events": [
"job.claimed",
"job.done"
]
},
"metrics": {
"found": {
"http requests (counter = _count)": {
"series": 11,
"names": [
"http_server_request_duration_seconds_count"
]
},
"http duration histogram (s)": {
"series": 154,
"names": [
"http_server_request_duration_seconds_bucket"
]
},
"jobs processed by outcome": {
"series": 1,
"names": [
"messenger_jobs_processed_total"
]
},
"job duration histogram (s)": {
"series": 14,
"names": [
"messenger_job_duration_seconds_bucket"
]
},
"time to ready histogram (s)": {
"series": 14,
"names": [
"messenger_attachment_time_to_ready_seconds_bucket"
]
},
"queue backlog by state": {
"series": 3,
"names": [
"messenger_jobs_backlog"
]
},
"oldest job age (s)": {
"series": 1,
"names": [
"messenger_jobs_oldest_age_seconds"
]
},
"outbox pending": {
"series": 1,
"names": [
"messenger_outbox_pending"
]
},
"rabbitmq queue messages": {
"series": 2,
"names": [
"rabbitmq_queue_messages_ready"
]
},
"worker busy": {
"series": 1,
"names": [
"messenger_worker_busy"
]
},
"worker capacity": {
"series": 1,
"names": [
"messenger_worker_capacity"
]
},
"db pool acquired": {
"series": 4,
"names": [
"pgxpool_acquired_connections"
]
},
"db pool waits": {
"series": 8,
"names": [
"pgxpool_empty_acquire_total",
"pgxpool_empty_acquire_wait_time_nanoseconds_total"
]
},
"process cpu": {
"series": 8,
"names": [
"process_cpu_time_seconds_total"
]
},
"go memory": {
"series": 8,
"names": [
"go_memory_used_bytes"
]
}
},
"labels_total": 131,
"forbidden_labels": [],
"http_route_values": [
"/api/v1/attachments/{attachment_id}",
"/api/v1/auth/sessions",
"/api/v1/chats",
"/api/v1/chats/{chat_id}/attachments",
"/api/v1/chats/{chat_id}/messages",
"/api/v1/users",
"/health/live",
"/health/ready"
],
"example_series_labels": [
"__name__",
"http_request_method",
"http_response_status_class",
"http_response_status_code",
"http_route",
"instance",
"job"
]
},
"leak_check": {
"loki:password": 0,
"loki:session_token": 0,
"loki:message_text": 0,
"loki:bearer_header": 0,
"tempo:password": 0,
"tempo:session_token": 0,
"tempo:message_text": 0,
"tempo:bearer_header": 0,
"stdout:password": 0,
"stdout:session_token": 0,
"stdout:message_text": 0,
"stdout:bearer_header": 0
},
"grafana": {
"datasources": [
"loki:loki",
"prometheus:prometheus",
"tempo:tempo"
],
"dashboard": "Messenger — API, worker, очередь",
"panels": 30,
"prometheus_targets": 39,
"targets_without_data_now": [
{
"panel": "Ready быстрее 30 s (5m)",
"legend": "",
"series": 0
},
{
"panel": "Доля ошибок 5xx и 4xx",
"legend": "4xx / все (ошибки клиента)",
"series": 0
}
],
"targets": [
{
"panel": "RPS API (бизнес)",
"legend": "",
"series": 1
},
{
"panel": "Доля 5xx (1m)",
"legend": "",
"series": 1
},
{
"panel": "Быстрее 250 ms (5m)",
"legend": "",
"series": 1
},
{
"panel": "Ready быстрее 30 s (5m)",
"legend": "",
"series": 0
},
{
"panel": "Старейшая job",
"legend": "",
"series": 1
},
{
"panel": "Alerts firing",
"legend": "",
"series": 1
},
{
"panel": "RPS по маршруту и классу ответа",
"legend": "{{http_route}} {{http_response_status_class}}",
"series": 6
},
{
"panel": "Задержка API p50 / p95 / p99 (все реплики)",
"legend": "p50",
"series": 1
},
{
"panel": "Задержка API p50 / p95 / p99 (все реплики)",
"legend": "p95",
"series": 1
},
{
"panel": "Задержка API p50 / p95 / p99 (все реплики)",
"legend": "p99",
"series": 1
},
{
"panel": "Доля ошибок 5xx и 4xx",
"legend": "5xx / все",
"series": 1
},
{
"panel": "Доля ошибок 5xx и 4xx",
"legend": "4xx / все (ошибки клиента)",
"series": 0
},
{
"panel": "p95 по маршруту",
"legend": "{{http_route}}",
"series": 6
},
{
"panel": "Запросы в обработке (in-flight) по реплике",
"legend": "{{instance}}",
"series": 2
},
{
"panel": "Jobs по исходу (rate)",
"legend": "{{outcome}}",
"series": 1
},
{
"panel": "Длительность обработки job p50 / p95 / p99",
"legend": "p50",
"series": 1
},
{
"panel": "Длительность обработки job p50 / p95 / p99",
"legend": "p95",
"series": 1
},
{
"panel": "Длительность обработки job p50 / p95 / p99",
"legend": "p99",
"series": 1
},
{
"panel": "Время до ready (202 → ready) p50 / p95",
"legend": "p50",
"series": 1
},
{
"panel": "Время до ready (202 → ready) p50 / p95",
"legend": "p95",
"series": 1
},
{
"panel": "Очередь: jobs по состоянию (PostgreSQL)",
"legend": "{{state}}",
"series": 3
},
{
"panel": "Очередь: jobs по состоянию (PostgreSQL)",
"legend": "outbox не опубликовано",
"series": 1
},
{
"panel": "Возраст старейшей job / outbox",
"legend": "job (queued/processing)",
"series": 1
},
{
"panel": "Возраст старейшей job / outbox",
"legend": "outbox",
"series": 1
},
{
"panel": "RabbitMQ: сообщения в очередях",
"legend": "ready {{queue}}",
"series": 2
},
{
"panel": "RabbitMQ: сообщения в очередях",
"legend": "unacked {{queue}}",
"series": 2
},
{
"panel": "Saturation worker (busy / capacity)",
"legend": "занято слотов",
"series": 1
},
{
"panel": "Publish outbox → broker (confirm) p95",
"legend": "p95",
"series": 1
},
{
"panel": "Publish outbox → broker (confirm) p95",
"legend": "сообщений/с",
"series": 1
},
{
"panel": "Пул БД: занято / ожидания",
"legend": "занято {{job}}",
"series": 3
},
{
"panel": "Пул БД: занято / ожидания",
"legend": "max {{job}}",
"series": 3
},
{
"panel": "Пул БД: занято / ожидания",
"legend": "ожиданий/с {{job}}",
"series": 3
},
{
"panel": "CPU процессов",
"legend": "{{job}} {{instance}}",
"series": 4
},
{
"panel": "Память Go (used)",
"legend": "{{job}} {{instance}}",
"series": 4
},
{
"panel": "Collector: принято / отправлено / потеряно spans",
"legend": "принято",
"series": 1
},
{
"panel": "Collector: принято / отправлено / потеряно spans",
"legend": "отправлено",
"series": 1
},
{
"panel": "Collector: принято / отправлено / потеряно spans",
"legend": "не доставлено",
"series": 1
},
{
"panel": "Collector: принято / отправлено / потеряно spans",
"legend": "отклонено (memory_limiter)",
"series": 1
},
{
"panel": "Collector: принято / отправлено / потеряно spans",
"legend": "очередь экспортёров",
"series": 1
}
]
},
"attachment": {
"id": "ec322ba6-ae46-4757-b0c8-0d79d3ba2b42",
"status": "ready"
}
}
}