{ "uid": "messenger-lab6", "title": "Messenger — наблюдаемость (lab6)", "tags": [ "messenger", "lab6" ], "timezone": "browser", "schemaVersion": 39, "version": 1, "editable": false, "refresh": "10s", "time": { "from": "now-30m", "to": "now" }, "graphTooltip": 1, "panels": [ { "id": 1, "type": "row", "title": "SLO (окно 30 мин) и алерты", "collapsed": false, "gridPos": { "x": 0, "y": 0, "w": 24, "h": 1 }, "panels": [] }, { "id": 2, "type": "stat", "title": "Доступность (SLO 99%)", "description": "1 - 5xx/все бизнес-запросы messenger-api за 30 мин. Health-пробы не инструментированы.", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 0, "y": 1, "w": 4, "h": 4 }, "fieldConfig": { "defaults": { "unit": "percentunit", "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": null }, { "color": "yellow", "value": 0.99 }, { "color": "green", "value": 0.995 } ] }, "decimals": 2 }, "overrides": [] }, "options": { "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "colorMode": "value", "graphMode": "area", "textMode": "auto" }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "messenger:slo_availability:ratio30m", "legendFormat": "Доступность (SLO 99%)", "refId": "A", "range": true, "instant": false } ] }, { "id": 3, "type": "stat", "title": "Латентность ≤500 ms (SLO 95%)", "description": "Доля запросов в bucket le=0.5 s за 30 мин.", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 4, "y": 1, "w": 4, "h": 4 }, "fieldConfig": { "defaults": { "unit": "percentunit", "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": null }, { "color": "yellow", "value": 0.95 }, { "color": "green", "value": 0.97 } ] }, "decimals": 2 }, "overrides": [] }, "options": { "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "colorMode": "value", "graphMode": "area", "textMode": "auto" }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "messenger:slo_latency:ratio30m", "legendFormat": "Латентность ≤500 ms (SLO 95%)", "refId": "A", "range": true, "instant": false } ] }, { "id": 4, "type": "stat", "title": "Error ratio 5xx (2m)", "description": "", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 8, "y": 1, "w": 4, "h": 4 }, "fieldConfig": { "defaults": { "unit": "percentunit", "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 0.05 } ] }, "decimals": 2 }, "overrides": [] }, "options": { "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "colorMode": "value", "graphMode": "area", "textMode": "auto" }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "messenger:http_error_ratio:rate2m", "legendFormat": "Error ratio 5xx (2m)", "refId": "A", "range": true, "instant": false } ] }, { "id": 5, "type": "stat", "title": "Старейшее задание", "description": "", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 12, "y": 1, "w": 4, "h": 4 }, "fieldConfig": { "defaults": { "unit": "s", "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 60 } ] } }, "overrides": [] }, "options": { "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "colorMode": "value", "graphMode": "area", "textMode": "auto" }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "max(messenger_queue_oldest_age_seconds{queue=\"attachments.process\"})", "legendFormat": "Старейшее задание", "refId": "A", "range": true, "instant": false } ] }, { "id": 6, "type": "alertlist", "title": "Алерты Prometheus (firing/pending)", "gridPos": { "x": 16, "y": 1, "w": 8, "h": 8 }, "options": { "alertInstanceLabelFilter": "", "alertName": "", "dashboardAlerts": false, "groupBy": [], "groupMode": "default", "maxItems": 20, "sortOrder": 1, "stateFilter": { "firing": true, "pending": true, "noData": false, "normal": false, "error": true }, "viewMode": "list", "datasource": "Prometheus" } }, { "id": 7, "type": "stat", "title": "RPS API", "description": "", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 0, "y": 5, "w": 4, "h": 4 }, "fieldConfig": { "defaults": { "unit": "reqps", "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "decimals": 1 }, "overrides": [] }, "options": { "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "colorMode": "value", "graphMode": "area", "textMode": "auto" }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "messenger:http_requests:rate2m", "legendFormat": "RPS API", "refId": "A", "range": true, "instant": false } ] }, { "id": 8, "type": "stat", "title": "p95 API (5m)", "description": "", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 4, "y": 5, "w": 4, "h": 4 }, "fieldConfig": { "defaults": { "unit": "s", "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 1 } ] } }, "overrides": [] }, "options": { "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "colorMode": "value", "graphMode": "area", "textMode": "auto" }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "messenger:http_latency_p95:rate5m", "legendFormat": "p95 API (5m)", "refId": "A", "range": true, "instant": false } ] }, { "id": 9, "type": "stat", "title": "Загрузка worker", "description": "", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 8, "y": 5, "w": 4, "h": 4 }, "fieldConfig": { "defaults": { "unit": "percentunit", "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "orange", "value": 0.9 } ] } }, "overrides": [] }, "options": { "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "colorMode": "value", "graphMode": "area", "textMode": "auto" }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "messenger:worker_saturation:ratio", "legendFormat": "Загрузка worker", "refId": "A", "range": true, "instant": false } ] }, { "id": 10, "type": "stat", "title": "Ожидают пул БД", "description": "", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 12, "y": 5, "w": 4, "h": 4 }, "fieldConfig": { "defaults": { "unit": "short", "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 1 } ] } }, "overrides": [] }, "options": { "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "colorMode": "value", "graphMode": "area", "textMode": "auto" }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "max(db_client_connection_pending_requests)", "legendFormat": "Ожидают пул БД", "refId": "A", "range": true, "instant": false } ] }, { "id": 11, "type": "row", "title": "API (messenger-api, все реплики)", "collapsed": false, "gridPos": { "x": 0, "y": 9, "w": 24, "h": 1 }, "panels": [] }, { "id": 12, "type": "timeseries", "title": "RPS по маршруту и методу", "description": "Counter = _count гистограммы http.server.request.duration; route — шаблон, не реальный UUID.", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 0, "y": 10, "w": 12, "h": 8 }, "fieldConfig": { "defaults": { "unit": "reqps", "custom": { "lineWidth": 1, "fillOpacity": 10, "stacking": { "mode": "none" }, "showPoints": "never" } }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "bottom", "calcs": [ "lastNotNull", "max" ] }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum by (http_request_method, http_route) (rate(http_server_request_duration_seconds_count{service_name=\"messenger-api\"}[$__rate_interval]))", "legendFormat": "{{http_request_method}} {{http_route}}", "refId": "A", "range": true, "instant": false } ] }, { "id": 13, "type": "timeseries", "title": "RPS по классу статуса", "description": "", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 12, "y": 10, "w": 12, "h": 8 }, "fieldConfig": { "defaults": { "unit": "reqps", "custom": { "lineWidth": 1, "fillOpacity": 10, "stacking": { "mode": "normal" }, "showPoints": "never" } }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "bottom", "calcs": [ "lastNotNull", "max" ] }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum by (status_class) (label_replace(rate(http_server_request_duration_seconds_count{service_name=\"messenger-api\"}[$__rate_interval]), \"status_class\", \"${1}xx\", \"http_response_status_code\", \"(\\\\d)..\")) ", "legendFormat": "{{status_class}}", "refId": "A", "range": true, "instant": false } ] }, { "id": 14, "type": "timeseries", "title": "Латентность API p50/p95/p99 (из histogram buckets)", "description": "histogram_quantile по сумме buckets всех реплик; не среднее и не усреднение p99 реплик.", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 0, "y": 18, "w": 12, "h": 8 }, "fieldConfig": { "defaults": { "unit": "s", "custom": { "lineWidth": 1, "fillOpacity": 10, "stacking": { "mode": "none" }, "showPoints": "never" } }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "bottom", "calcs": [ "lastNotNull", "max" ] }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "histogram_quantile(0.5, sum by (le) (rate(http_server_request_duration_seconds_bucket{service_name=\"messenger-api\"}[$__rate_interval])))", "legendFormat": "p50", "refId": "A", "range": true, "instant": false }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "histogram_quantile(0.95, sum by (le) (rate(http_server_request_duration_seconds_bucket{service_name=\"messenger-api\"}[$__rate_interval])))", "legendFormat": "p95", "refId": "B", "range": true, "instant": false }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "histogram_quantile(0.99, sum by (le) (rate(http_server_request_duration_seconds_bucket{service_name=\"messenger-api\"}[$__rate_interval])))", "legendFormat": "p99", "refId": "C", "range": true, "instant": false } ] }, { "id": 15, "type": "timeseries", "title": "Доля ошибок 5xx", "description": "Числитель: 5xx; знаменатель: все бизнес-запросы (health исключён). 4xx не считаются отказом.", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 12, "y": 18, "w": 12, "h": 8 }, "fieldConfig": { "defaults": { "unit": "percentunit", "custom": { "lineWidth": 1, "fillOpacity": 10, "stacking": { "mode": "none" }, "showPoints": "never" } }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "bottom", "calcs": [ "lastNotNull", "max" ] }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "(sum(rate(http_server_request_duration_seconds_count{service_name=\"messenger-api\",http_response_status_code=~\"5..\"}[$__rate_interval])) or vector(0)) / sum(rate(http_server_request_duration_seconds_count{service_name=\"messenger-api\"}[$__rate_interval]))", "legendFormat": "5xx / все", "refId": "A", "range": true, "instant": false } ] }, { "id": 16, "type": "timeseries", "title": "p95 по маршруту", "description": "", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 0, "y": 26, "w": 12, "h": 8 }, "fieldConfig": { "defaults": { "unit": "s", "custom": { "lineWidth": 1, "fillOpacity": 10, "stacking": { "mode": "none" }, "showPoints": "never" } }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "bottom", "calcs": [ "lastNotNull", "max" ] }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "histogram_quantile(0.95, sum by (le, http_route) (rate(http_server_request_duration_seconds_bucket{service_name=\"messenger-api\"}[$__rate_interval])))", "legendFormat": "{{http_route}}", "refId": "A", "range": true, "instant": false } ] }, { "id": 17, "type": "timeseries", "title": "Запросы в обработке", "description": "", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 12, "y": 26, "w": 12, "h": 8 }, "fieldConfig": { "defaults": { "unit": "short", "custom": { "lineWidth": 1, "fillOpacity": 10, "stacking": { "mode": "none" }, "showPoints": "never" } }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "bottom", "calcs": [ "lastNotNull", "max" ] }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum by (instance) (http_server_active_requests{service_name=\"messenger-api\"})", "legendFormat": "{{instance}}", "refId": "A", "range": true, "instant": false } ] }, { "id": 18, "type": "row", "title": "Очередь и worker", "collapsed": false, "gridPos": { "x": 0, "y": 34, "w": 24, "h": 1 }, "panels": [] }, { "id": 19, "type": "timeseries", "title": "Jobs по исходу (в сек.)", "description": "succeeded / retry / failed / noop / lost / dlq / requeued; job_type=attachment.process.v1", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 0, "y": 35, "w": 12, "h": 8 }, "fieldConfig": { "defaults": { "unit": "ops", "custom": { "lineWidth": 1, "fillOpacity": 10, "stacking": { "mode": "normal" }, "showPoints": "never" } }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "bottom", "calcs": [ "lastNotNull", "max" ] }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum by (outcome) (rate(messenger_jobs_processed_total[$__rate_interval]))", "legendFormat": "{{outcome}}", "refId": "A", "range": true, "instant": false } ] }, { "id": 20, "type": "timeseries", "title": "Длительность job (succeeded) p50/p95/p99", "description": "", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 12, "y": 35, "w": 12, "h": 8 }, "fieldConfig": { "defaults": { "unit": "s", "custom": { "lineWidth": 1, "fillOpacity": 10, "stacking": { "mode": "none" }, "showPoints": "never" } }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "bottom", "calcs": [ "lastNotNull", "max" ] }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "histogram_quantile(0.5, sum by (le) (rate(messenger_job_duration_seconds_bucket{outcome=\"succeeded\"}[$__rate_interval])))", "legendFormat": "p50", "refId": "A", "range": true, "instant": false }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "histogram_quantile(0.95, sum by (le) (rate(messenger_job_duration_seconds_bucket{outcome=\"succeeded\"}[$__rate_interval])))", "legendFormat": "p95", "refId": "B", "range": true, "instant": false }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "histogram_quantile(0.99, sum by (le) (rate(messenger_job_duration_seconds_bucket{outcome=\"succeeded\"}[$__rate_interval])))", "legendFormat": "p99", "refId": "C", "range": true, "instant": false } ] }, { "id": 21, "type": "timeseries", "title": "Глубина очереди (из PostgreSQL)", "description": "max() по репликам API: каждая публикует одно и то же значение из БД.", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 0, "y": 43, "w": 12, "h": 8 }, "fieldConfig": { "defaults": { "unit": "short", "custom": { "lineWidth": 1, "fillOpacity": 10, "stacking": { "mode": "none" }, "showPoints": "never" } }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "bottom", "calcs": [ "lastNotNull", "max" ] }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "max by (queue, state) (messenger_queue_depth)", "legendFormat": "{{queue}} {{state}}", "refId": "A", "range": true, "instant": false } ] }, { "id": 22, "type": "timeseries", "title": "Возраст старейшей job", "description": "От durable acceptance (COMMIT job) до сейчас; это backlog, не processing latency.", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 12, "y": 43, "w": 12, "h": 8 }, "fieldConfig": { "defaults": { "unit": "s", "custom": { "lineWidth": 2, "fillOpacity": 10, "showPoints": "never", "thresholdsStyle": { "mode": "line" } }, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 60 } ] } }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "bottom", "calcs": [ "lastNotNull", "max" ] }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "max(messenger_queue_oldest_age_seconds{queue=\"attachments.process\"})", "legendFormat": "oldest age", "refId": "A", "range": true, "instant": false } ] }, { "id": 23, "type": "timeseries", "title": "Время до ready p50/p95/p99", "description": "messenger.attachment.time_to_ready: от 202 (COMMIT job) до COMMIT ready.", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 0, "y": 51, "w": 12, "h": 8 }, "fieldConfig": { "defaults": { "unit": "s", "custom": { "lineWidth": 1, "fillOpacity": 10, "stacking": { "mode": "none" }, "showPoints": "never" } }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "bottom", "calcs": [ "lastNotNull", "max" ] }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "histogram_quantile(0.5, sum by (le) (rate(messenger_attachment_time_to_ready_seconds_bucket[$__rate_interval])))", "legendFormat": "p50", "refId": "A", "range": true, "instant": false }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "histogram_quantile(0.95, sum by (le) (rate(messenger_attachment_time_to_ready_seconds_bucket[$__rate_interval])))", "legendFormat": "p95", "refId": "B", "range": true, "instant": false }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "histogram_quantile(0.99, sum by (le) (rate(messenger_attachment_time_to_ready_seconds_bucket[$__rate_interval])))", "legendFormat": "p99", "refId": "C", "range": true, "instant": false } ] }, { "id": 24, "type": "timeseries", "title": "Насыщение worker: занято / ёмкость", "description": "", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 12, "y": 51, "w": 12, "h": 8 }, "fieldConfig": { "defaults": { "unit": "short", "custom": { "lineWidth": 1, "fillOpacity": 10, "stacking": { "mode": "none" }, "showPoints": "never" } }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "bottom", "calcs": [ "lastNotNull", "max" ] }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum(messenger_worker_busy)", "legendFormat": "busy", "refId": "A", "range": true, "instant": false }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum(messenger_worker_capacity)", "legendFormat": "capacity", "refId": "B", "range": true, "instant": false }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "messenger:worker_saturation:ratio", "legendFormat": "saturation", "refId": "C", "range": true, "instant": false } ] }, { "id": 25, "type": "row", "title": "Ресурсы: пул БД, CPU, RAM", "collapsed": false, "gridPos": { "x": 0, "y": 59, "w": 24, "h": 1 }, "panels": [] }, { "id": 26, "type": "timeseries", "title": "Пул БД: used / idle / waiting", "description": "", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 0, "y": 60, "w": 12, "h": 8 }, "fieldConfig": { "defaults": { "unit": "short", "custom": { "lineWidth": 1, "fillOpacity": 10, "stacking": { "mode": "none" }, "showPoints": "never" } }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "bottom", "calcs": [ "lastNotNull", "max" ] }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum by (service_name, db_client_connection_state) (db_client_connection_count)", "legendFormat": "{{service_name}} {{db_client_connection_state}}", "refId": "A", "range": true, "instant": false }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum by (service_name) (db_client_connection_pending_requests)", "legendFormat": "{{service_name}} waiting", "refId": "B", "range": true, "instant": false }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum by (service_name) (db_client_connection_max)", "legendFormat": "{{service_name}} max", "refId": "C", "range": true, "instant": false } ] }, { "id": 27, "type": "timeseries", "title": "CPU процессов (ядра)", "description": "worker: self + завершённые дочерние процессы обработки изображений.", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 12, "y": 60, "w": 12, "h": 8 }, "fieldConfig": { "defaults": { "unit": "percentunit", "custom": { "lineWidth": 1, "fillOpacity": 10, "stacking": { "mode": "none" }, "showPoints": "never" } }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "bottom", "calcs": [ "lastNotNull", "max" ] }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum by (service_name, instance) (rate(process_cpu_time_seconds_total[$__rate_interval]))", "legendFormat": "{{service_name}} {{instance}}", "refId": "A", "range": true, "instant": false }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "rate(otelcol_process_cpu_seconds_total[$__rate_interval])", "legendFormat": "otel-collector", "refId": "B", "range": true, "instant": false } ] }, { "id": 28, "type": "timeseries", "title": "RSS процессов", "description": "", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 0, "y": 68, "w": 12, "h": 8 }, "fieldConfig": { "defaults": { "unit": "bytes", "custom": { "lineWidth": 1, "fillOpacity": 10, "stacking": { "mode": "none" }, "showPoints": "never" } }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "bottom", "calcs": [ "lastNotNull", "max" ] }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "process_memory_usage_bytes", "legendFormat": "{{service_name}} {{instance}}", "refId": "A", "range": true, "instant": false }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "otelcol_process_memory_rss_bytes", "legendFormat": "otel-collector", "refId": "B", "range": true, "instant": false } ] }, { "id": 29, "type": "timeseries", "title": "Telemetry pipeline: принято / отправлено / ошибки (items/s)", "description": "", "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "x": 12, "y": 68, "w": 12, "h": 8 }, "fieldConfig": { "defaults": { "unit": "short", "custom": { "lineWidth": 1, "fillOpacity": 10, "stacking": { "mode": "none" }, "showPoints": "never" } }, "overrides": [] }, "options": { "legend": { "displayMode": "table", "placement": "bottom", "calcs": [ "lastNotNull", "max" ] }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum(rate(otelcol_receiver_accepted_spans_total[$__rate_interval]))", "legendFormat": "accepted spans", "refId": "A", "range": true, "instant": false }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum(rate(otelcol_receiver_accepted_log_records_total[$__rate_interval]))", "legendFormat": "accepted log records", "refId": "E", "range": true, "instant": false }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum(rate(otelcol_receiver_accepted_metric_points_total[$__rate_interval]))", "legendFormat": "accepted metric points", "refId": "F", "range": true, "instant": false }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum by (exporter) (rate({__name__=~\"otelcol_exporter_sent_(spans|log_records|metric_points)_total\"}[$__rate_interval]))", "legendFormat": "sent {{exporter}}", "refId": "B", "range": true, "instant": false }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum(rate(otelcol_exporter_send_failed_spans_total[$__rate_interval])) or vector(0)", "legendFormat": "send failed spans", "refId": "C", "range": true, "instant": false }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum(rate(otelcol_exporter_enqueue_failed_spans_total[$__rate_interval])) or vector(0)", "legendFormat": "dropped spans (queue full)", "refId": "G", "range": true, "instant": false }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum(rate(otelcol_exporter_send_failed_log_records_total[$__rate_interval])) or vector(0)", "legendFormat": "send failed logs", "refId": "H", "range": true, "instant": false }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum(rate(otelcol_exporter_enqueue_failed_log_records_total[$__rate_interval])) or vector(0)", "legendFormat": "dropped logs (queue full)", "refId": "I", "range": true, "instant": false }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum by (exporter) (otelcol_exporter_queue_size)", "legendFormat": "queue {{exporter}}", "refId": "D", "range": true, "instant": false } ] }, { "id": 30, "type": "row", "title": "Логи и трассы", "collapsed": false, "gridPos": { "x": 0, "y": 76, "w": 24, "h": 1 }, "panels": [] }, { "id": 31, "type": "logs", "title": "Логи API и worker (warning/error)", "datasource": { "type": "loki", "uid": "loki" }, "gridPos": { "x": 0, "y": 77, "w": 12, "h": 10 }, "options": { "showTime": true, "wrapLogMessage": true, "sortOrder": "Descending", "enableLogDetails": true }, "targets": [ { "datasource": { "type": "loki", "uid": "loki" }, "refId": "A", "expr": "{service_name=~\"messenger-api|messenger-worker\"} | severity_text=~\"WARN.*|ERROR\"" } ] }, { "id": 32, "type": "table", "title": "Трассы с ошибками или медленнее 500 ms (TraceQL)", "datasource": { "type": "tempo", "uid": "tempo" }, "gridPos": { "x": 12, "y": 77, "w": 12, "h": 10 }, "targets": [ { "datasource": { "type": "tempo", "uid": "tempo" }, "refId": "A", "queryType": "traceql", "limit": 20, "query": "{resource.service.name=~\"messenger-.*\" && (status=error || duration>500ms)}" } ] } ], "annotations": { "list": [ { "builtIn": 1, "datasource": { "type": "grafana", "uid": "-- Grafana --" }, "enable": true, "hide": true, "name": "Annotations & Alerts", "type": "dashboard" } ] }, "templating": { "list": [] } }