diff --git a/logging/grafana-dashboards/tailscale-proxy.json b/logging/grafana-dashboards/tailscale-proxy.json index f8fc760..a0b3fa7 100644 --- a/logging/grafana-dashboards/tailscale-proxy.json +++ b/logging/grafana-dashboards/tailscale-proxy.json @@ -4,10 +4,12 @@ "tags": [ "proxy", "tailscale", - "loki" + "loki", + "telemt", + "zabbix" ], "schemaVersion": 39, - "version": 3, + "version": 4, "editable": true, "refresh": "30s", "time": { @@ -469,20 +471,675 @@ "panels": [] }, { - "type": "text", - "title": "Telegram-прокси (Telemt) — наблюдение", + "id": 20, + "type": "stat", + "title": "Уникальных пользователей сейчас (IP)", + "description": "Текущее число уникальных активных клиентских IP для Telemt user secret `tekhnohim`. Это наиболее близкая доступная метрика к числу подключённых пользователей: несколько клиентов за одним NAT считаются как один IP, а один пользователь с нескольких внешних IP — как несколько.", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "zabbix-02" + }, "gridPos": { - "h": 7, - "w": 24, + "h": 5, + "w": 10, "x": 0, "y": 33 }, "options": { - "mode": "markdown", - "content": "### Telegram MTProto прокси — `ts-lan-telemt` (Telemt), порт `192.168.0.35:1080`\n\nFake-TLS MTProto-прокси для Telegram. Егресс к Telegram DC идёт через `ts-proxy` (Tailscale userspace SOCKS5) → выходной узел Hetzner `89.167.72.79`.\n\nЛоги Telemt **не** отправляются в Loki (формат tracing плохо ложится в syslog-драйвер), поэтому здесь панелей нет. Наблюдать за ним:\n\n- `docker logs ts-lan-telemt` на docker-хосте (подключения `peer=`, `user=tekhnohim`, трафик `c2s_bytes/s2c_bytes`, ошибки апстрима к DC);\n- при необходимости включить Prometheus-метрики Telemt (`[server] metrics_port`) и снимать их Zabbix-ом, как на Hetzner.\n\nВнешний вход `p.technohim.com:1080` (роутер Kirochnaya, port-forward + NAT-loopback для LAN). HTTP-трафик Telegram API (`149.154.167.x`) виден и в панелях HTTP-прокси выше." + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "colorMode": "background", + "graphMode": "area", + "textMode": "value_and_name", + "justifyMode": "center", + "wideLayout": true }, - "pluginVersion": "", - "datasource": null + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "unit": "short", + "decimals": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-gray", + "value": null + }, + { + "color": "green", + "value": 1 + } + ] + } + }, + "overrides": [] + }, + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggers": true, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "zabbix-02" + }, + "evaltype": "0", + "functions": [], + "group": { + "filter": "Linux servers" + }, + "host": { + "filter": "Fedora Kirochnaya" + }, + "item": { + "filter": "/^Current number of unique active IPs by tekhnohim$/" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "minSeverity": 3, + "mode": 0, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ] + }, + { + "id": 21, + "type": "stat", + "title": "Активных соединений", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "zabbix-02" + }, + "gridPos": { + "h": 5, + "w": 7, + "x": 10, + "y": 33 + }, + "options": { + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "colorMode": "value", + "graphMode": "area", + "textMode": "value_and_name", + "justifyMode": "center" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "fixed", + "fixedColor": "blue" + }, + "unit": "short", + "decimals": 0 + }, + "overrides": [] + }, + "targets": [ + { + "application": { + "filter": "" + }, + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "zabbix-02" + }, + "functions": [], + "group": { + "filter": "Linux servers" + }, + "host": { + "filter": "Fedora Kirochnaya" + }, + "item": { + "filter": "/^Active connections by tekhnohim$/" + }, + "itemTag": { + "filter": "" + }, + "mode": 0, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12 + } + ] + }, + { + "id": 22, + "type": "stat", + "title": "Всего подключений", + "description": "Накопительный счётчик подключений user secret `tekhnohim` с момента запуска Telemt.", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "zabbix-02" + }, + "gridPos": { + "h": 5, + "w": 7, + "x": 17, + "y": 33 + }, + "options": { + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "colorMode": "value", + "graphMode": "area", + "textMode": "value_and_name", + "justifyMode": "center" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "fixed", + "fixedColor": "purple" + }, + "unit": "short", + "decimals": 0 + }, + "overrides": [] + }, + "targets": [ + { + "application": { + "filter": "" + }, + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "zabbix-02" + }, + "functions": [], + "group": { + "filter": "Linux servers" + }, + "host": { + "filter": "Fedora Kirochnaya" + }, + "item": { + "filter": "/^Total connections by tekhnohim$/" + }, + "itemTag": { + "filter": "" + }, + "mode": 0, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12 + } + ] + }, + { + "id": 23, + "type": "timeseries", + "title": "Пользователи и соединения", + "description": "Текущее число уникальных активных IP и параллельных Telemt-соединений.", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "zabbix-02" + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 38 + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "drawStyle": "line", + "fillOpacity": 15, + "lineInterpolation": "stepAfter", + "lineWidth": 2, + "pointSize": 3, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + } + }, + "unit": "short", + "decimals": 0 + }, + "overrides": [] + }, + "options": { + "legend": { + "calcs": [ + "lastNotNull", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "application": { + "filter": "" + }, + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "zabbix-02" + }, + "functions": [], + "group": { + "filter": "Linux servers" + }, + "host": { + "filter": "Fedora Kirochnaya" + }, + "item": { + "filter": "/^(Current number of unique active IPs|Active connections) by tekhnohim$/" + }, + "itemTag": { + "filter": "" + }, + "mode": 0, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12 + } + ] + }, + { + "id": 24, + "type": "timeseries", + "title": "Трафик Telemt (накопительно)", + "description": "Накопительные байтовые счётчики Telemt по user secret `tekhnohim`; сбрасываются при перезапуске сервиса.", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "zabbix-02" + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 38 + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "drawStyle": "line", + "fillOpacity": 15, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 3, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + } + }, + "unit": "bytes" + }, + "overrides": [] + }, + "options": { + "legend": { + "calcs": [ + "lastNotNull", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "application": { + "filter": "" + }, + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "zabbix-02" + }, + "functions": [], + "group": { + "filter": "Linux servers" + }, + "host": { + "filter": "Fedora Kirochnaya" + }, + "item": { + "filter": "/^Bytes (received from|sent to) tekhnohim$/" + }, + "itemTag": { + "filter": "" + }, + "mode": 0, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12 + } + ] + }, + { + "id": 25, + "type": "stat", + "title": "Аптайм Telemt", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "zabbix-02" + }, + "gridPos": { + "h": 4, + "w": 8, + "x": 0, + "y": 46 + }, + "options": { + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "colorMode": "value", + "graphMode": "none", + "textMode": "value_and_name", + "justifyMode": "center" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "fixed", + "fixedColor": "green" + }, + "unit": "s" + }, + "overrides": [] + }, + "targets": [ + { + "application": { + "filter": "" + }, + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "zabbix-02" + }, + "functions": [], + "group": { + "filter": "Linux servers" + }, + "host": { + "filter": "Fedora Kirochnaya" + }, + "item": { + "filter": "/^Telemt Uptime$/" + }, + "itemTag": { + "filter": "" + }, + "mode": 0, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12 + } + ] + }, + { + "id": 26, + "type": "stat", + "title": "Получено от клиентов", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "zabbix-02" + }, + "gridPos": { + "h": 4, + "w": 8, + "x": 8, + "y": 46 + }, + "options": { + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "colorMode": "value", + "graphMode": "none", + "textMode": "value_and_name", + "justifyMode": "center" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "fixed", + "fixedColor": "semi-dark-blue" + }, + "unit": "bytes" + }, + "overrides": [] + }, + "targets": [ + { + "application": { + "filter": "" + }, + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "zabbix-02" + }, + "functions": [], + "group": { + "filter": "Linux servers" + }, + "host": { + "filter": "Fedora Kirochnaya" + }, + "item": { + "filter": "/^Bytes received from tekhnohim$/" + }, + "itemTag": { + "filter": "" + }, + "mode": 0, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12 + } + ] + }, + { + "id": 27, + "type": "stat", + "title": "Отправлено клиентам", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "zabbix-02" + }, + "gridPos": { + "h": 4, + "w": 8, + "x": 16, + "y": 46 + }, + "options": { + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "colorMode": "value", + "graphMode": "none", + "textMode": "value_and_name", + "justifyMode": "center" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "fixed", + "fixedColor": "semi-dark-purple" + }, + "unit": "bytes" + }, + "overrides": [] + }, + "targets": [ + { + "application": { + "filter": "" + }, + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "zabbix-02" + }, + "functions": [], + "group": { + "filter": "Linux servers" + }, + "host": { + "filter": "Fedora Kirochnaya" + }, + "item": { + "filter": "/^Bytes sent to tekhnohim$/" + }, + "itemTag": { + "filter": "" + }, + "mode": 0, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12 + } + ] } ] -} \ No newline at end of file +}