Files
netrunner-data/observability/grafana-dashboards/backend.json
T
nineap 414667062c
Deploy Observability / Deploy Observability Stack (push) Failing after 20s
Deploy / Deploy to Data VPS (push) Failing after 19s
Единый observability-стек: Prometheus + Loki + Grafana + Caddy auth-гейт
Отдельный от db+vaultwarden compose-файл (разный жизненный цикл, свой
deploy-workflow) — единственное место сбора для backend, лендинга и
каждой прокси-ноды, которые физически живут на других серверах.

Prometheus скрейпит наружу (сам ходит в /metrics на тех хостах — там
нужно только открыть порт метрик для IP этого VPS). Loki, наоборот,
принимает пуши логов ИЗВНЕ — порт 3100 публикуется наружу и обязательно
фильтруется firewall'ом по IP тех хостов.

Grafana не торчит в интернет напрямую (127.0.0.1-only) — единственный
вход через Caddy с forward_auth, гейтящим по cookie-сессии
netrunner-backend (GET /api/v1/admin/observability/check,
Owner/Moderator). 3 provisioned дашборда (backend/landing/прокси-ноды).

Список scrape-таргетов для прокси-нод (observability/targets/nodes.json)
генерится и заливается автоматически из netrunner-proxy при каждом
деплое нод — вручную ничего не поддерживается.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-09 23:22:11 +07:00

109 lines
3.4 KiB
JSON

{
"uid": "netrunner-backend",
"title": "Netrunner — Backend",
"timezone": "utc",
"schemaVersion": 39,
"version": 1,
"refresh": "30s",
"time": { "from": "now-6h", "to": "now" },
"panels": [
{
"id": 1,
"title": "HTTP requests/sec (by status)",
"type": "timeseries",
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 0 },
"datasource": { "type": "prometheus", "uid": "Prometheus" },
"targets": [
{
"expr": "sum(rate(http_requests_total{job=\"netrunner-backend\"}[5m])) by (status)",
"legendFormat": "{{status}}"
}
]
},
{
"id": 2,
"title": "HTTP latency p95/p50",
"type": "timeseries",
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 0 },
"datasource": { "type": "prometheus", "uid": "Prometheus" },
"targets": [
{
"expr": "histogram_quantile(0.95, sum(rate(http_request_duration_seconds_bucket{job=\"netrunner-backend\"}[5m])) by (le))",
"legendFormat": "p95"
},
{
"expr": "histogram_quantile(0.50, sum(rate(http_request_duration_seconds_bucket{job=\"netrunner-backend\"}[5m])) by (le))",
"legendFormat": "p50"
}
]
},
{
"id": 3,
"title": "Errors/sec (by type)",
"type": "timeseries",
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 8 },
"datasource": { "type": "prometheus", "uid": "Prometheus" },
"targets": [
{
"expr": "sum(rate(app_errors_total{job=\"netrunner-backend\"}[5m])) by (type)",
"legendFormat": "{{type}}"
}
]
},
{
"id": 4,
"title": "Payments/sec (by provider, status)",
"type": "timeseries",
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 8 },
"datasource": { "type": "prometheus", "uid": "Prometheus" },
"targets": [
{
"expr": "sum(rate(payments_total{job=\"netrunner-backend\"}[5m])) by (provider, status)",
"legendFormat": "{{provider}}/{{status}}"
}
]
},
{
"id": 5,
"title": "VPN nodes online / total",
"type": "timeseries",
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 16 },
"datasource": { "type": "prometheus", "uid": "Prometheus" },
"targets": [
{ "expr": "nodes_online{job=\"netrunner-backend\"}", "legendFormat": "online" },
{ "expr": "nodes_total{job=\"netrunner-backend\"}", "legendFormat": "total" }
]
},
{
"id": 6,
"title": "Support tickets/hour (created vs closed)",
"type": "timeseries",
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 16 },
"datasource": { "type": "prometheus", "uid": "Prometheus" },
"targets": [
{
"expr": "sum(rate(support_tickets_total{job=\"netrunner-backend\"}[1h])) by (status) * 3600",
"legendFormat": "{{status}}"
}
]
},
{
"id": 7,
"title": "Referral signups + partner commission",
"type": "timeseries",
"gridPos": { "h": 8, "w": 24, "x": 0, "y": 24 },
"datasource": { "type": "prometheus", "uid": "Prometheus" },
"targets": [
{
"expr": "sum(rate(referral_signups_total{job=\"netrunner-backend\"}[1h])) * 3600",
"legendFormat": "referral signups/hour"
},
{
"expr": "sum(rate(partner_commission_total{job=\"netrunner-backend\"}[1h])) by (currency) * 3600",
"legendFormat": "commission/hour {{currency}}"
}
]
}
]
}