Files
docker-infrastructure/logging/grafana-dashboards/tailscale-proxy.json
T
pipistrelloandClaude Opus 4.8 46bb775939 Add tailscale-proxy stack + Grafana dashboard
New stack tailscale-proxy: a LAN HTTP proxy (192.168.0.35:3128) that egresses
through the dedicated Hetzner Tailscale exit node fedora-technohim, so proxied
LAN clients appear on the internet as 89.167.72.79 without routing the docker
host itself through the tunnel.

- ts-proxy: Tailscale in userspace mode (--exit-node=100.121.234.85), exposing a
  SOCKS5 proxy on :1055. Userspace mode makes no host route/firewall changes.
- tinyproxy: LAN-facing forward proxy on :3128 (Allow 192.168.0.0/22), upstream
  socks5 to ts-proxy. Access log shipped to Alloy/Loki via the syslog
  log-driver (tag tailscale-proxy).

The Tailscale auth key stays outside Git in /mnt/containers/tailscale-proxy/
ts.env (0600); node state persists in the state/ dir. tinyproxy.conf is tracked
here as source of truth. See tailscale-proxy/README.md.

Also adds logging/grafana-dashboards/tailscale-proxy.json: a Loki dashboard
(request rate by method, top destinations, top clients, totals, live access
log) built from the tinyproxy syslog stream, matching the existing dashboards'
schemaVersion 39 + ${datasource} template-var pattern.

Full build record in ops-knowledge
diagnostics/2026-07-23-02-tekhnohim-docker-tailscale-exit-proxy-stack.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 16:43:43 +03:00

403 lines
8.9 KiB
JSON

{
"uid": "tailscale-proxy",
"title": "Tailscale прокси — трафик LAN",
"tags": [
"proxy",
"tailscale",
"loki"
],
"schemaVersion": 39,
"version": 1,
"editable": true,
"refresh": "30s",
"time": {
"from": "now-6h",
"to": "now"
},
"timezone": "",
"templating": {
"list": [
{
"name": "datasource",
"type": "datasource",
"query": "loki",
"current": {},
"hide": 0,
"refresh": 1,
"includeAll": false,
"multi": false,
"regex": ""
}
]
},
"annotations": {
"list": []
},
"panels": [
{
"id": 1,
"type": "stat",
"title": "Всего запросов",
"datasource": {
"type": "loki",
"uid": "${datasource}"
},
"gridPos": {
"h": 4,
"w": 8,
"x": 0,
"y": 0
},
"options": {
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"colorMode": "value",
"graphMode": "none",
"textMode": "auto",
"justifyMode": "auto"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "fixed",
"fixedColor": "blue"
},
"unit": "short"
},
"overrides": []
},
"targets": [
{
"datasource": {
"type": "loki",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum(count_over_time({source_ip=\"192.168.0.35\"} |= \"Request (file descriptor\" [$__range]))",
"refId": "A",
"queryType": "instant"
}
]
},
{
"id": 2,
"type": "stat",
"title": "Уникальных клиентов",
"datasource": {
"type": "loki",
"uid": "${datasource}"
},
"gridPos": {
"h": 4,
"w": 8,
"x": 8,
"y": 0
},
"options": {
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"colorMode": "value",
"graphMode": "none",
"textMode": "auto",
"justifyMode": "auto"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "fixed",
"fixedColor": "blue"
},
"unit": "short"
},
"overrides": []
},
"targets": [
{
"datasource": {
"type": "loki",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "count(sum by (client)(count_over_time({source_ip=\"192.168.0.35\"} |= \"Connect (file descriptor\" | pattern \"<_>): <client>\" [$__range])))",
"refId": "A",
"queryType": "instant"
}
]
},
{
"id": 3,
"type": "stat",
"title": "Уникальных назначений",
"datasource": {
"type": "loki",
"uid": "${datasource}"
},
"gridPos": {
"h": 4,
"w": 8,
"x": 16,
"y": 0
},
"options": {
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"colorMode": "value",
"graphMode": "none",
"textMode": "auto",
"justifyMode": "auto"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "fixed",
"fixedColor": "blue"
},
"unit": "short"
},
"overrides": []
},
"targets": [
{
"datasource": {
"type": "loki",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "count(sum by (dest)(count_over_time({source_ip=\"192.168.0.35\"} |= \"Found upstream proxy\" | pattern \"<_>for <dest>\" [$__range])))",
"refId": "A",
"queryType": "instant"
}
]
},
{
"id": 4,
"type": "timeseries",
"title": "Запросы по методам",
"datasource": {
"type": "loki",
"uid": "${datasource}"
},
"gridPos": {
"h": 8,
"w": 24,
"x": 0,
"y": 4
},
"fieldConfig": {
"defaults": {
"custom": {
"drawStyle": "line",
"fillOpacity": 15,
"stacking": {
"mode": "normal",
"group": "A"
}
},
"unit": "cps"
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
},
"targets": [
{
"datasource": {
"type": "loki",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "sum by (method)(count_over_time({source_ip=\"192.168.0.35\"} |= \"Request (file descriptor\" | pattern \"<_>): <method> <_>\" [$__auto]))",
"refId": "A",
"queryType": "range",
"legendFormat": "{{method}}"
}
]
},
{
"id": 5,
"type": "table",
"title": "Топ назначений",
"datasource": {
"type": "loki",
"uid": "${datasource}"
},
"gridPos": {
"h": 9,
"w": 12,
"x": 0,
"y": 12
},
"options": {
"showHeader": true,
"sortBy": [
{
"displayName": "запросов",
"desc": true
}
]
},
"fieldConfig": {
"defaults": {
"custom": {
"align": "auto",
"filterable": true
}
},
"overrides": []
},
"transformations": [
{
"id": "labelsToFields",
"options": {}
},
{
"id": "organize",
"options": {
"excludeByName": {
"Time": true
},
"renameByName": {
"dest": "dest",
"Value #A": "запросов",
"Value": "запросов"
}
}
}
],
"targets": [
{
"datasource": {
"type": "loki",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "topk(15, sum by (dest)(count_over_time({source_ip=\"192.168.0.35\"} |= \"Found upstream proxy\" | pattern \"<_>for <dest>\" [$__range])))",
"refId": "A",
"queryType": "instant"
}
]
},
{
"id": 6,
"type": "table",
"title": "Топ клиентов",
"datasource": {
"type": "loki",
"uid": "${datasource}"
},
"gridPos": {
"h": 9,
"w": 12,
"x": 12,
"y": 12
},
"options": {
"showHeader": true,
"sortBy": [
{
"displayName": "запросов",
"desc": true
}
]
},
"fieldConfig": {
"defaults": {
"custom": {
"align": "auto",
"filterable": true
}
},
"overrides": []
},
"transformations": [
{
"id": "labelsToFields",
"options": {}
},
{
"id": "organize",
"options": {
"excludeByName": {
"Time": true
},
"renameByName": {
"client": "client",
"Value #A": "запросов",
"Value": "запросов"
}
}
}
],
"targets": [
{
"datasource": {
"type": "loki",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "topk(15, sum by (client)(count_over_time({source_ip=\"192.168.0.35\"} |= \"Connect (file descriptor\" | pattern \"<_>): <client>\" [$__range])))",
"refId": "A",
"queryType": "instant"
}
]
},
{
"id": 7,
"type": "logs",
"title": "Журнал доступа (live)",
"datasource": {
"type": "loki",
"uid": "${datasource}"
},
"gridPos": {
"h": 10,
"w": 24,
"x": 0,
"y": 21
},
"options": {
"showTime": true,
"wrapLogMessage": false,
"enableLogDetails": true,
"dedupStrategy": "none",
"sortOrder": "Descending"
},
"targets": [
{
"datasource": {
"type": "loki",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "{source_ip=\"192.168.0.35\"} |= \"Request (file descriptor\"",
"queryType": "range",
"refId": "A"
}
]
}
]
}