Files
mtusi2026lab7/infra/grafana/dashboards/messenger.json
T
zemiles 9cc80d2529
Application / app (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s
ЛР 7 — БПИ2303 — Лазарев — на 3
Перенесена реализация lab6; бизнес-API без изменений, транспорт — HTTPS.

- Внешний HTTPS (public-ca) на 127.0.0.1:8443; HSTS, TLS >= 1.2.
- Обязательное mTLS LB -> каждая API-реплика: API проверяет цепочку
  internal-ca и SAN клиента (allowlist: lb); health только на 127.0.0.1.
- TLS с проверкой сервера ко всем зависимостям: PostgreSQL verify-full
  (pg_hba только hostssl), HTTPS S3, AMQPS, OTLP/HTTPS с client cert,
  mTLS Collector -> Prometheus/Loki/Tempo, Grafana -> datasources, scrape.
- OpenBao 2.7.2 не в dev-mode: Raft на volume, init/unseal оператором,
  auth/cert с ролью и policy на сервис, TTL 15 мин + renew/re-login.
- Отдельные роли PostgreSQL с грантами по таблицам; разные ключи S3 и
  пользователи брокера выдаются из OpenBao.
- Argon2id (m=19 MiB, t=2, p=1, замер на стенде) и rehash при входе.
- Случайный X-Instance-Id; hardening контейнеров (non-root, cap_drop ALL,
  no-new-privileges, read-only, лимиты); TCP_NODELAY на сокете API.
- Модель угроз, trust matrix, отрицательные тесты TLS/mTLS, API, OpenBao,
  hardening; evidence, в т.ч. прогон из чистого clone.
2026-11-18 23:59:35 +03:00

3300 lines
64 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"uid": "messenger-overview",
"title": "Messenger — наблюдаемость (lab6)",
"description": "API, worker, очередь, PostgreSQL, S3, ресурсы, конвейер телеметрии. Provisioning из Git.",
"tags": [
"messenger",
"lab6",
"otel"
],
"timezone": "browser",
"editable": false,
"graphTooltip": 1,
"refresh": "10s",
"schemaVersion": 39,
"version": 1,
"time": {
"from": "now-30m",
"to": "now"
},
"templating": {
"list": [
{
"name": "instance",
"label": "API-реплика",
"type": "query",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"query": {
"query": "label_values(http_server_request_duration_seconds_count{job=\"messenger-api\"}, instance)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"definition": "label_values(http_server_request_duration_seconds_count{job=\"messenger-api\"}, instance)",
"includeAll": true,
"multi": true,
"allValue": ".*",
"current": {
"text": "All",
"value": "$__all"
},
"refresh": 2,
"sort": 1
}
]
},
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"panels": [
{
"type": "row",
"id": 1,
"title": "Обзор и SLO",
"collapsed": false,
"gridPos": {
"x": 0,
"y": 0,
"w": 24,
"h": 1
},
"panels": []
},
{
"type": "stat",
"id": 2,
"title": "RPS бизнес-запросов",
"description": "sum(rate(http_server_request_duration_seconds_count{job=messenger-api, без /health}[2m]))",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 1,
"w": 3,
"h": 4
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "messenger:http_requests:rate2m",
"legendFormat": "__auto",
"refId": "A",
"range": false,
"instant": true
}
],
"fieldConfig": {
"defaults": {
"unit": "reqps",
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"options": {
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"colorMode": "background",
"graphMode": "area",
"textMode": "value"
}
},
{
"type": "stat",
"id": 3,
"title": "5xx, доля (2m)",
"description": "Числитель: 5xx бизнес-запросов; знаменатель: все бизнес-запросы (без /health, unmatched).",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 3,
"y": 1,
"w": 3,
"h": 4
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "messenger:http_error_ratio:rate2m",
"legendFormat": "__auto",
"refId": "A",
"range": false,
"instant": true
}
],
"fieldConfig": {
"defaults": {
"unit": "percentunit",
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "orange",
"value": 0.01
},
{
"color": "red",
"value": 0.05
}
]
},
"decimals": 2
},
"overrides": []
},
"options": {
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"colorMode": "background",
"graphMode": "area",
"textMode": "value"
}
},
{
"type": "stat",
"id": 4,
"title": "p95 API (5m)",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 6,
"y": 1,
"w": 3,
"h": 4
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "messenger:http_latency_seconds:p95_5m",
"legendFormat": "__auto",
"refId": "A",
"range": false,
"instant": true
}
],
"fieldConfig": {
"defaults": {
"unit": "s",
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "orange",
"value": 0.5
},
{
"color": "red",
"value": 1
}
]
},
"decimals": 3
},
"overrides": []
},
"options": {
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"colorMode": "background",
"graphMode": "area",
"textMode": "value"
}
},
{
"type": "stat",
"id": 5,
"title": "SLO доступности, 7d",
"description": "SLO: 99.5 % бизнес-запросов без 5xx за скользящие 7 дней.",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 9,
"y": 1,
"w": 3,
"h": 4
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "messenger:slo_availability:ratio_7d",
"legendFormat": "__auto",
"refId": "A",
"range": false,
"instant": true
}
],
"fieldConfig": {
"defaults": {
"unit": "percentunit",
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "red",
"value": null
},
{
"color": "green",
"value": 0.995
}
]
},
"decimals": 3
},
"overrides": []
},
"options": {
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"colorMode": "background",
"graphMode": "area",
"textMode": "value"
}
},
{
"type": "stat",
"id": 6,
"title": "Остаток error budget, 7d",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 1,
"w": 3,
"h": 4
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "messenger:slo_availability:error_budget_remaining_7d",
"legendFormat": "__auto",
"refId": "A",
"range": false,
"instant": true
}
],
"fieldConfig": {
"defaults": {
"unit": "percentunit",
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "red",
"value": null
},
{
"color": "orange",
"value": 0.25
},
{
"color": "green",
"value": 0.5
}
]
},
"decimals": 1
},
"overrides": []
},
"options": {
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"colorMode": "background",
"graphMode": "area",
"textMode": "value"
}
},
{
"type": "stat",
"id": 7,
"title": "Time to ready p95",
"description": "От durable acceptance (COMMIT enqueue) до COMMIT ready. SLO: 99 % не дольше 30 с.",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 15,
"y": 1,
"w": 3,
"h": 4
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "messenger:time_to_ready_seconds:p95_5m",
"legendFormat": "__auto",
"refId": "A",
"range": false,
"instant": true
}
],
"fieldConfig": {
"defaults": {
"unit": "s",
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "orange",
"value": 10
},
{
"color": "red",
"value": 30
}
]
},
"decimals": 2
},
"overrides": []
},
"options": {
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"colorMode": "background",
"graphMode": "area",
"textMode": "value"
}
},
{
"type": "stat",
"id": 8,
"title": "Ready lag очереди",
"description": "Сколько ждёт worker самое старое созревшее задание (PostgreSQL jobs).",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 18,
"y": 1,
"w": 3,
"h": 4
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "max(messenger_jobs_ready_lag_seconds) or vector(0)",
"legendFormat": "__auto",
"refId": "A",
"range": false,
"instant": true
}
],
"fieldConfig": {
"defaults": {
"unit": "s",
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "orange",
"value": 10
},
{
"color": "red",
"value": 30
}
]
},
"decimals": 0
},
"overrides": []
},
"options": {
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"colorMode": "background",
"graphMode": "area",
"textMode": "value"
}
},
{
"type": "stat",
"id": 9,
"title": "Alerts firing",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 21,
"y": 1,
"w": 3,
"h": 4
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "count(ALERTS{alertstate=\"firing\"}) or vector(0)",
"legendFormat": "__auto",
"refId": "A",
"range": false,
"instant": true
}
],
"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": "background",
"graphMode": "area",
"textMode": "value"
}
},
{
"type": "state-timeline",
"id": 10,
"title": "История alerts (pending/firing -> resolved)",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 5,
"w": 24,
"h": 6
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "max by (alertname, source, alertstate) (ALERTS)",
"legendFormat": "{{alertname}} {{source}} {{alertstate}}",
"refId": "A",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "transparent",
"value": null
},
{
"color": "red",
"value": 1
}
]
}
},
"overrides": []
},
"options": {
"showValue": "never",
"mergeValues": true,
"rowHeight": 0.8,
"legend": {
"showLegend": false
}
}
},
{
"type": "row",
"id": 11,
"title": "API: трафик, ошибки, задержка",
"collapsed": false,
"gridPos": {
"x": 0,
"y": 11,
"w": 24,
"h": 1
},
"panels": []
},
{
"type": "timeseries",
"id": 12,
"title": "RPS по маршруту",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 12,
"w": 8,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum by (http_route) (rate(http_server_request_duration_seconds_count{job=\"messenger-api\", instance=~\"$instance\"}[1m]))",
"legendFormat": "{{http_route}}",
"refId": "A",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "reqps",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "normal"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 13,
"title": "Ответы по классу статуса",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 8,
"y": 12,
"w": 8,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum by (http_response_status_class) (rate(http_server_request_duration_seconds_count{job=\"messenger-api\", instance=~\"$instance\", http_route!~\"/health/.*|unmatched\"}[1m]))",
"legendFormat": "{{http_response_status_class}}",
"refId": "A",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "reqps",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "normal"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 14,
"title": "Доля 5xx: API и LB",
"description": "Если БД недоступна, реплики не ready и 503 отдаёт LB: эти запросы видны только в метрике LB.",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 16,
"y": 12,
"w": 8,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "messenger:http_error_ratio:rate2m",
"legendFormat": "API (без /health)",
"refId": "A",
"range": true,
"instant": false
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "messenger:lb_error_ratio:rate2m",
"legendFormat": "HAProxy fe_api",
"refId": "B",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "percentunit",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
},
"thresholdsStyle": {
"mode": "line+area"
}
},
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "transparent",
"value": null
},
{
"color": "red",
"value": 0.05
}
]
}
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 15,
"title": "Задержка API p50/p95/p99 (из histogram)",
"description": "Точки-exemplars ведут в трассу Tempo конкретного запроса.",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 20,
"w": 12,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "histogram_quantile(0.50, sum by (le) (rate(http_server_request_duration_seconds_bucket{job=\"messenger-api\", instance=~\"$instance\", http_route!~\"/health/.*|unmatched\"}[1m])))",
"legendFormat": "p50",
"refId": "A",
"range": true,
"instant": false,
"exemplar": true
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "histogram_quantile(0.95, sum by (le) (rate(http_server_request_duration_seconds_bucket{job=\"messenger-api\", instance=~\"$instance\", http_route!~\"/health/.*|unmatched\"}[1m])))",
"legendFormat": "p95",
"refId": "B",
"range": true,
"instant": false,
"exemplar": true
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "histogram_quantile(0.99, sum by (le) (rate(http_server_request_duration_seconds_bucket{job=\"messenger-api\", instance=~\"$instance\", http_route!~\"/health/.*|unmatched\"}[1m])))",
"legendFormat": "p99",
"refId": "C",
"range": true,
"instant": false,
"exemplar": true
}
],
"fieldConfig": {
"defaults": {
"unit": "s",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 16,
"title": "p95 по маршруту",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 20,
"w": 12,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "histogram_quantile(0.95, sum by (le, http_route) (rate(http_server_request_duration_seconds_bucket{job=\"messenger-api\", instance=~\"$instance\", http_route!~\"/health/.*|unmatched\"}[5m])))",
"legendFormat": "{{http_route}}",
"refId": "A",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "s",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 17,
"title": "5xx по причине (error.type)",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 28,
"w": 8,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum by (error_type, http_route) (rate(http_server_request_duration_seconds_count{job=\"messenger-api\", instance=~\"$instance\", http_response_status_class=\"5xx\"}[1m]))",
"legendFormat": "{{error_type}} {{http_route}}",
"refId": "A",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "reqps",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "normal"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 18,
"title": "Запросы в обработке (saturation API)",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 8,
"y": 28,
"w": 8,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum by (instance) (http_server_active_requests{job=\"messenger-api\", instance=~\"$instance\"})",
"legendFormat": "{{instance}}",
"refId": "A",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "short",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 19,
"title": "HAProxy: UP-реплики и очередь LB",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 16,
"y": 28,
"w": 8,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "haproxy_backend_active_servers{proxy=\"be_api\"}",
"legendFormat": "UP реплик",
"refId": "A",
"range": true,
"instant": false
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "haproxy_backend_current_queue{proxy=\"be_api\"}",
"legendFormat": "очередь LB",
"refId": "B",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "short",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "row",
"id": 20,
"title": "Worker и очередь заданий",
"collapsed": false,
"gridPos": {
"x": 0,
"y": 36,
"w": 24,
"h": 1
},
"panels": []
},
{
"type": "timeseries",
"id": 21,
"title": "Задания по исходу (в минуту)",
"description": "ready / retry / failed / duplicate / lease_lost / rejected / requeued",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 37,
"w": 8,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum by (messenger_job_outcome) (increase(messenger_jobs_processed_total[1m]))",
"legendFormat": "{{messenger_job_outcome}}",
"refId": "A",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "short",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "normal"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 22,
"title": "Длительность обработки job p50/p95/p99",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 8,
"y": 37,
"w": 8,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "histogram_quantile(0.50, sum by (le) (rate(messenger_job_duration_seconds_bucket{messenger_job_outcome=\"ready\"}[5m])))",
"legendFormat": "p50",
"refId": "A",
"range": true,
"instant": false,
"exemplar": true
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "histogram_quantile(0.95, sum by (le) (rate(messenger_job_duration_seconds_bucket{messenger_job_outcome=\"ready\"}[5m])))",
"legendFormat": "p95",
"refId": "B",
"range": true,
"instant": false,
"exemplar": true
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "histogram_quantile(0.99, sum by (le) (rate(messenger_job_duration_seconds_bucket{messenger_job_outcome=\"ready\"}[5m])))",
"legendFormat": "p99",
"refId": "C",
"range": true,
"instant": false,
"exemplar": true
}
],
"fieldConfig": {
"defaults": {
"unit": "s",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 23,
"title": "Time to ready p50/p95/p99",
"description": "Backlog-ожидание + обработка: время от 202 (COMMIT) до ready.",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 16,
"y": 37,
"w": 8,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "histogram_quantile(0.50, sum by (le) (rate(messenger_attachment_time_to_ready_seconds_bucket{outcome=\"ready\"}[5m])))",
"legendFormat": "p50",
"refId": "A",
"range": true,
"instant": false,
"exemplar": true
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "histogram_quantile(0.95, sum by (le) (rate(messenger_attachment_time_to_ready_seconds_bucket{outcome=\"ready\"}[5m])))",
"legendFormat": "p95",
"refId": "B",
"range": true,
"instant": false,
"exemplar": true
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "histogram_quantile(0.99, sum by (le) (rate(messenger_attachment_time_to_ready_seconds_bucket{outcome=\"ready\"}[5m])))",
"legendFormat": "p99",
"refId": "C",
"range": true,
"instant": false,
"exemplar": true
}
],
"fieldConfig": {
"defaults": {
"unit": "s",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 24,
"title": "Глубина очереди: PostgreSQL и RabbitMQ",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 45,
"w": 8,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "max by (messenger_job_status) (messenger_jobs_count{messenger_job_status=~\"queued|processing\"})",
"legendFormat": "jobs {{messenger_job_status}} (БД)",
"refId": "A",
"range": true,
"instant": false
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "max(messenger_outbox_pending)",
"legendFormat": "outbox не опубликовано",
"refId": "B",
"range": true,
"instant": false
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum(rabbitmq_detailed_queue_messages_ready{queue=\"attachments.process.v1\"})",
"legendFormat": "RabbitMQ ready",
"refId": "C",
"range": true,
"instant": false
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum(rabbitmq_detailed_queue_messages_unacked{queue=\"attachments.process.v1\"})",
"legendFormat": "RabbitMQ unacked",
"refId": "D",
"range": true,
"instant": false
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum(rabbitmq_detailed_queue_messages{queue=\"attachments.dlq\"})",
"legendFormat": "DLQ",
"refId": "E",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "short",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 25,
"title": "Возраст старейшего задания и lag",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 8,
"y": 45,
"w": 8,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "max by (messenger_job_status) (messenger_jobs_oldest_age_seconds)",
"legendFormat": "oldest {{messenger_job_status}}",
"refId": "A",
"range": true,
"instant": false
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "max(messenger_jobs_ready_lag_seconds)",
"legendFormat": "ready lag",
"refId": "B",
"range": true,
"instant": false
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "max(messenger_outbox_oldest_age_seconds)",
"legendFormat": "outbox oldest",
"refId": "C",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "s",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
},
"thresholdsStyle": {
"mode": "line+area"
}
},
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "transparent",
"value": null
},
{
"color": "red",
"value": 30
}
]
}
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 26,
"title": "Ожидание в очереди p95 (до claim)",
"description": "Backlog (сколько ждут) отдельно от processing latency (сколько обрабатываются).",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 16,
"y": 45,
"w": 8,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "histogram_quantile(0.95, sum by (le) (rate(messenger_job_queue_wait_seconds_bucket[5m])))",
"legendFormat": "p95 queue wait",
"refId": "A",
"range": true,
"instant": false
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "histogram_quantile(0.95, sum by (le) (rate(messenger_outbox_publish_delay_seconds_bucket[5m])))",
"legendFormat": "p95 outbox -> broker",
"refId": "B",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "s",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 27,
"title": "Saturation worker: занятость потребителей",
"description": "1.0 = все WORKER_CONCURRENCY потоков всех реплик заняты; очередь растёт быстрее обработки.",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 53,
"w": 8,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum(rate(messenger_worker_busy_time_seconds_total[1m])) / sum(last_over_time(messenger_worker_capacity[30s]))",
"legendFormat": "utilization (busy_time/capacity)",
"refId": "A",
"range": true,
"instant": false
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum(messenger_worker_busy) / sum(last_over_time(messenger_worker_capacity[30s]))",
"legendFormat": "busy/capacity (мгновенно)",
"refId": "B",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "percentunit",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 28,
"title": "Relay: публикации outbox",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 8,
"y": 53,
"w": 8,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum by (outcome) (rate(messenger_outbox_published_total[1m]))",
"legendFormat": "{{outcome}}",
"refId": "A",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "short",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "row",
"id": 29,
"title": "PostgreSQL и S3",
"collapsed": false,
"gridPos": {
"x": 0,
"y": 61,
"w": 24,
"h": 1
},
"panels": []
},
{
"type": "timeseries",
"id": 30,
"title": "Пул соединений API: used / idle / max",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 62,
"w": 8,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum by (instance, db_client_connection_state) (db_client_connection_count{job=\"messenger-api\", instance=~\"$instance\"})",
"legendFormat": "{{instance}} {{db_client_connection_state}}",
"refId": "A",
"range": true,
"instant": false
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "max(db_client_connection_max{job=\"messenger-api\", instance=~\"$instance\"})",
"legendFormat": "max на реплику",
"refId": "B",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "short",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 31,
"title": "Ожидающие соединение и таймауты пула",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 8,
"y": 62,
"w": 8,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum by (instance) (db_client_connection_pending_requests{job=\"messenger-api\", instance=~\"$instance\"})",
"legendFormat": "pending {{instance}}",
"refId": "A",
"range": true,
"instant": false
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum by (instance) (increase(db_client_connection_timeouts_total{job=\"messenger-api\", instance=~\"$instance\"}[1m]))",
"legendFormat": "timeouts/мин {{instance}}",
"refId": "B",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "short",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 32,
"title": "Ожидание соединения пула p95",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 16,
"y": 62,
"w": 8,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "histogram_quantile(0.95, sum by (le) (rate(db_client_connection_wait_time_seconds_bucket{job=\"messenger-api\", instance=~\"$instance\"}[1m])))",
"legendFormat": "p95 wait",
"refId": "A",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "s",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 33,
"title": "Операции БД p95 по операции (API)",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 70,
"w": 12,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "histogram_quantile(0.95, sum by (le, db_operation_name) (rate(db_client_operation_duration_seconds_bucket{job=\"messenger-api\", instance=~\"$instance\"}[1m])))",
"legendFormat": "{{db_operation_name}}",
"refId": "A",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "s",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 34,
"title": "Операции БД worker/relay p95",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 70,
"w": 12,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "histogram_quantile(0.95, sum by (le, db_operation_name) (rate(db_client_operation_duration_seconds_bucket{job=~\"messenger-worker|messenger-relay\"}[5m])))",
"legendFormat": "{{db_operation_name}}",
"refId": "A",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "s",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 35,
"title": "Ошибки операций БД",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 78,
"w": 8,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum by (job, db_operation_name, error_type) (rate(db_client_operation_duration_seconds_count{error_type!=\"\"}[1m]))",
"legendFormat": "{{job}} {{db_operation_name}} {{error_type}}",
"refId": "A",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "short",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 36,
"title": "S3 p95 по операции",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 8,
"y": 78,
"w": 8,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "histogram_quantile(0.95, sum by (le, messenger_s3_operation) (rate(messenger_s3_operation_duration_seconds_bucket[5m])))",
"legendFormat": "{{messenger_s3_operation}}",
"refId": "A",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "s",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 37,
"title": "S3 ошибки",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 16,
"y": 78,
"w": 8,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum by (job, messenger_s3_operation, outcome) (rate(messenger_s3_operation_duration_seconds_count{outcome!=\"ok\"}[1m]))",
"legendFormat": "{{job}} {{messenger_s3_operation}} {{outcome}}",
"refId": "A",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "short",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "row",
"id": 38,
"title": "Ресурсы контейнеров (CPU/RAM)",
"collapsed": false,
"gridPos": {
"x": 0,
"y": 86,
"w": 24,
"h": 1
},
"panels": []
},
{
"type": "timeseries",
"id": 39,
"title": "CPU, ядер (cgroup контейнера)",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 87,
"w": 12,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum by (job, instance) (rate(container_cpu_time_seconds_total[1m]))",
"legendFormat": "{{job}} {{instance}}",
"refId": "A",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "short",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 40,
"title": "CPU saturation: доля лимита",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 87,
"w": 12,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "rate(container_cpu_time_seconds_total[1m]) / on(job, instance) container_cpu_limit",
"legendFormat": "{{job}} {{instance}}",
"refId": "A",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "percentunit",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 41,
"title": "Память контейнеров приложений",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 95,
"w": 12,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "container_memory_usage_bytes",
"legendFormat": "{{job}} {{instance}}",
"refId": "A",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "bytes",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 42,
"title": "Память: доля лимита",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 95,
"w": 12,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "container_memory_usage_bytes / on(job, instance) container_memory_limit_bytes",
"legendFormat": "{{job}} {{instance}}",
"refId": "A",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "percentunit",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 43,
"title": "Память telemetry-стека (RSS)",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 103,
"w": 12,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "process_resident_memory_bytes{job=~\"prometheus|loki|tempo\"}",
"legendFormat": "{{job}}",
"refId": "A",
"range": true,
"instant": false
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "{__name__=~\"otelcol_process_memory_rss(_bytes)?\"}",
"legendFormat": "otel-collector RSS (вкл. страницы бинарника)",
"refId": "B",
"range": true,
"instant": false
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "otelcol_process_runtime_heap_alloc_bytes",
"legendFormat": "otel-collector Go heap",
"refId": "C",
"range": true,
"instant": false
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "rabbitmq_process_resident_memory_bytes",
"legendFormat": "rabbitmq",
"refId": "D",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "bytes",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 44,
"title": "CPU telemetry-стека",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 103,
"w": 12,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "rate(process_cpu_seconds_total{job=~\"prometheus|loki|tempo\"}[1m])",
"legendFormat": "{{job}}",
"refId": "A",
"range": true,
"instant": false
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "rate({__name__=~\"otelcol_process_cpu_seconds(_total)?\"}[1m])",
"legendFormat": "otel-collector",
"refId": "B",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "short",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "row",
"id": 45,
"title": "Конвейер телеметрии (потери)",
"collapsed": false,
"gridPos": {
"x": 0,
"y": 111,
"w": 24,
"h": 1
},
"panels": []
},
{
"type": "timeseries",
"id": 46,
"title": "Collector: принято / отправлено / потеряно (spans)",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 112,
"w": 8,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum(rate({__name__=~\"otelcol_receiver_accepted_spans(_total)?\"}[1m]))",
"legendFormat": "принято",
"refId": "A",
"range": true,
"instant": false
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum(rate({__name__=~\"otelcol_exporter_sent_spans(_total)?\"}[1m]))",
"legendFormat": "отправлено в Tempo",
"refId": "B",
"range": true,
"instant": false
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum(rate({__name__=~\"otelcol_exporter_send_failed_spans(_total)?\"}[1m]))",
"legendFormat": "ошибка отправки",
"refId": "C",
"range": true,
"instant": false
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum(rate({__name__=~\"otelcol_exporter_enqueue_failed_spans(_total)?\"}[1m]))",
"legendFormat": "очередь полна (потеря)",
"refId": "D",
"range": true,
"instant": false
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum(rate({__name__=~\"otelcol_receiver_refused_spans(_total)?\"}[1m]))",
"legendFormat": "отказ приёма (memory_limiter)",
"refId": "E",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "short",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 47,
"title": "Collector: логи",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 8,
"y": 112,
"w": 8,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum(rate({__name__=~\"otelcol_receiver_accepted_log_records(_total)?\"}[1m]))",
"legendFormat": "принято",
"refId": "A",
"range": true,
"instant": false
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum(rate({__name__=~\"otelcol_exporter_sent_log_records(_total)?\"}[1m]))",
"legendFormat": "отправлено в Loki",
"refId": "B",
"range": true,
"instant": false
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum(rate({__name__=~\"otelcol_exporter_send_failed_log_records(_total)?\"}[1m]))",
"legendFormat": "ошибка отправки",
"refId": "C",
"range": true,
"instant": false
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum(rate({__name__=~\"otelcol_exporter_enqueue_failed_log_records(_total)?\"}[1m]))",
"legendFormat": "очередь полна (потеря)",
"refId": "D",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "short",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 48,
"title": "Collector: очередь экспортёров",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 16,
"y": 112,
"w": 8,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "max by (exporter) (otelcol_exporter_queue_size)",
"legendFormat": "size {{exporter}}",
"refId": "A",
"range": true,
"instant": false
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "max by (exporter) (otelcol_exporter_queue_capacity)",
"legendFormat": "capacity {{exporter}}",
"refId": "B",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "short",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 49,
"title": "SDK приложений: потери на стороне процесса",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 120,
"w": 12,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum by (job, error_type) (rate(otel_sdk_processor_span_processed_total{error_type!=\"\"}[1m]))",
"legendFormat": "spans dropped {{job}} {{error_type}}",
"refId": "A",
"range": true,
"instant": false
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum by (job, error_type) (rate(otel_sdk_processor_log_processed_total{error_type!=\"\"}[1m]))",
"legendFormat": "logs dropped {{job}} {{error_type}}",
"refId": "B",
"range": true,
"instant": false
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "sum by (job, error_type) (rate(otel_sdk_exporter_span_exported_total{error_type!=\"\"}[1m]))",
"legendFormat": "span export failed {{job}} {{error_type}}",
"refId": "C",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "short",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "timeseries",
"id": 50,
"title": "SDK: заполнение очереди BatchSpanProcessor",
"description": "",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 120,
"w": 12,
"h": 8
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "max by (job, instance) (otel_sdk_processor_span_queue_size)",
"legendFormat": "{{job}} {{instance}}",
"refId": "A",
"range": true,
"instant": false
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "max(otel_sdk_processor_span_queue_capacity)",
"legendFormat": "capacity",
"refId": "B",
"range": true,
"instant": false
}
],
"fieldConfig": {
"defaults": {
"unit": "short",
"custom": {
"lineWidth": 1,
"fillOpacity": 10,
"showPoints": "never",
"stacking": {
"mode": "none"
}
},
"min": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "table",
"placement": "bottom",
"calcs": [
"lastNotNull",
"max"
]
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
}
},
{
"type": "row",
"id": 51,
"title": "Логи и трассы",
"collapsed": false,
"gridPos": {
"x": 0,
"y": 128,
"w": 24,
"h": 1
},
"panels": []
},
{
"type": "logs",
"id": 52,
"title": "Логи WARN/ERROR приложений (Loki)",
"datasource": {
"type": "loki",
"uid": "loki"
},
"gridPos": {
"x": 0,
"y": 129,
"w": 24,
"h": 10
},
"targets": [
{
"datasource": {
"type": "loki",
"uid": "loki"
},
"refId": "A",
"queryType": "range",
"expr": "{service_name=~\"messenger-.+\"} | severity_text=~\"WARN.*|ERROR.*|CRITICAL\""
}
],
"options": {
"showTime": true,
"wrapLogMessage": true,
"enableLogDetails": true,
"sortOrder": "Descending",
"dedupStrategy": "none",
"prettifyLogMessage": false
}
},
{
"type": "logs",
"id": 53,
"title": "HTTP 5xx (event=http.request)",
"datasource": {
"type": "loki",
"uid": "loki"
},
"gridPos": {
"x": 0,
"y": 139,
"w": 12,
"h": 10
},
"targets": [
{
"datasource": {
"type": "loki",
"uid": "loki"
},
"refId": "A",
"queryType": "range",
"expr": "{service_name=\"messenger-api\"} | event=\"http.request\" | http_response_status_code >= 500"
}
],
"options": {
"showTime": true,
"wrapLogMessage": true,
"enableLogDetails": true,
"sortOrder": "Descending"
}
},
{
"type": "table",
"id": 54,
"title": "Последние трассы обработки заданий (Tempo)",
"datasource": {
"type": "tempo",
"uid": "tempo"
},
"gridPos": {
"x": 12,
"y": 139,
"w": 12,
"h": 10
},
"targets": [
{
"datasource": {
"type": "tempo",
"uid": "tempo"
},
"refId": "A",
"queryType": "traceql",
"limit": 20,
"tableType": "traces",
"query": "{ resource.service.name = \"messenger-worker\" && name = \"attachments.process.v1 process\" }"
}
]
},
{
"type": "table",
"id": 55,
"title": "Медленные запросы API > 1 s (Tempo)",
"datasource": {
"type": "tempo",
"uid": "tempo"
},
"gridPos": {
"x": 0,
"y": 149,
"w": 12,
"h": 10
},
"targets": [
{
"datasource": {
"type": "tempo",
"uid": "tempo"
},
"refId": "A",
"queryType": "traceql",
"limit": 20,
"tableType": "traces",
"query": "{ resource.service.name = \"messenger-api\" && kind = server && duration > 1s }"
}
]
},
{
"type": "table",
"id": 56,
"title": "Трассы с ошибкой (Tempo)",
"datasource": {
"type": "tempo",
"uid": "tempo"
},
"gridPos": {
"x": 12,
"y": 149,
"w": 12,
"h": 10
},
"targets": [
{
"datasource": {
"type": "tempo",
"uid": "tempo"
},
"refId": "A",
"queryType": "traceql",
"limit": 20,
"tableType": "traces",
"query": "{ status = error }"
}
]
}
]
}