Files
harbor-net/monitoring/grafana/harbor-gateway.json
T
dokril 0b39211fbd
Build and Deploy Gateway / build-and-push (push) Successful in 22s
Build and Deploy Gateway / deploy (push) Successful in 7s
Refactor Harbor client connection flow
2026-08-17 12:19:26 +03:00

1050 lines
30 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.
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "Prometheus data source with the Harbor Gateway target",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
],
"annotations": {
"list": []
},
"description": "Трафик, который Harbor учёл для всех устройств или выбранного устройства. Физическая пропускная способность канала и трафик вне Gateway не измеряются.",
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 1,
"id": null,
"links": [],
"panels": [
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 0
},
"id": 10,
"panels": [],
"title": "Обзор",
"type": "row"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"description": "Скорость скачивания в конце выбранного периода с адаптивным окном усреднения. Если диапазон заканчивается сейчас, это текущая скорость. Это наблюдаемый Harbor трафик, а не пропускная способность интернет-канала.",
"fieldConfig": {
"defaults": {
"color": {
"fixedColor": "blue",
"mode": "fixed"
},
"decimals": 1,
"noValue": "Нет активности",
"unit": "Bps"
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 4,
"x": 0,
"y": 1
},
"id": 6,
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "value",
"wideLayout": true
},
"targets": [
{
"editorMode": "code",
"expr": "sum(rate(harbor_device_traffic_bytes_total{device_id=~\"$device_id\", direction=\"download\"}[$__rate_interval]))",
"instant": true,
"legendFormat": "Скачивание",
"range": false,
"refId": "A"
}
],
"title": "Скачивание в конце",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"description": "Скорость отправки в конце выбранного периода с адаптивным окном усреднения. Если диапазон заканчивается сейчас, это текущая скорость. Это наблюдаемый Harbor трафик, а не пропускная способность интернет-канала.",
"fieldConfig": {
"defaults": {
"color": {
"fixedColor": "orange",
"mode": "fixed"
},
"decimals": 1,
"noValue": "Нет активности",
"unit": "Bps"
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 4,
"x": 4,
"y": 1
},
"id": 7,
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "value",
"wideLayout": true
},
"targets": [
{
"editorMode": "code",
"expr": "sum(rate(harbor_device_traffic_bytes_total{device_id=~\"$device_id\", direction=\"upload\"}[$__rate_interval]))",
"instant": true,
"legendFormat": "Отправка",
"range": false,
"refId": "A"
}
],
"title": "Отправка в конце",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"description": "Скачивание и отправка, учтённые Harbor для выбранных устройств в текущем диапазоне времени.",
"fieldConfig": {
"defaults": {
"color": {
"fixedColor": "green",
"mode": "fixed"
},
"decimals": 1,
"noValue": "Нет данных",
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 4,
"x": 8,
"y": 1
},
"id": 1,
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "value",
"wideLayout": true
},
"targets": [
{
"editorMode": "code",
"expr": "sum(increase(harbor_device_traffic_bytes_total{device_id=~\"$device_id\"}[$__range]))",
"instant": true,
"legendFormat": "Учтено Harbor",
"range": false,
"refId": "A"
}
],
"title": "Трафик за период",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"description": "Наблюдённые sing-box байты для выбранных устройств по фактически выбранному выходу. Direct IPv4 мимо sing-box учитывается отдельно в технической детализации.",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"decimals": 1,
"noValue": "Нет трафика",
"unit": "bytes"
},
"overrides": [
{
"matcher": {
"id": "byFrameRefID",
"options": "A"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "green",
"mode": "fixed"
}
}
]
},
{
"matcher": {
"id": "byFrameRefID",
"options": "B"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "orange",
"mode": "fixed"
}
}
]
},
{
"matcher": {
"id": "byFrameRefID",
"options": "C"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "gray",
"mode": "fixed"
}
}
]
}
]
},
"gridPos": {
"h": 4,
"w": 8,
"x": 12,
"y": 1
},
"id": 15,
"options": {
"displayMode": "basic",
"maxVizHeight": 300,
"minVizHeight": 16,
"minVizWidth": 8,
"namePlacement": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showUnfilled": false,
"sizing": "auto",
"valueMode": "text"
},
"targets": [
{
"editorMode": "code",
"expr": "sum(increase(harbor_device_singbox_tracked_bytes_total{device_id=~\"$device_id\", outbound=\"vpn\"}[$__range])) > 0",
"instant": true,
"legendFormat": "VPN",
"range": false,
"refId": "A"
},
{
"editorMode": "code",
"expr": "sum(increase(harbor_device_singbox_tracked_bytes_total{device_id=~\"$device_id\", outbound=\"direct\"}[$__range])) > 0",
"instant": true,
"legendFormat": "Direct",
"range": false,
"refId": "B"
},
{
"editorMode": "code",
"expr": "sum(increase(harbor_device_singbox_tracked_bytes_total{device_id=~\"$device_id\", outbound=\"unknown\"}[$__range])) > 0",
"instant": true,
"legendFormat": "Не определено",
"range": false,
"refId": "C"
}
],
"title": "VPN / Direct за период",
"type": "bargauge"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"description": "Возраст самых старых данных среди общего трафика, сайтов / sing-box и Direct IPv4 к концу выбранного периода. До 60 секунд — штатно, 60–119 — задержка, от 120 — данные устарели.",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"decimals": 0,
"noValue": "Нет данных",
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "orange",
"value": 60
},
{
"color": "red",
"value": 120
}
]
},
"unit": "s"
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 4,
"x": 20,
"y": 1
},
"id": 2,
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "value",
"wideLayout": false
},
"targets": [
{
"editorMode": "code",
"expr": "max(label_replace(time() - min(harbor_traffic_last_observed_timestamp_seconds), \"freshness_source\", \"traffic\", \"__name__\", \".*\") or label_replace(time() - harbor_domain_traffic_last_observed_timestamp_seconds, \"freshness_source\", \"domains\", \"__name__\", \".*\") or label_replace(time() - harbor_direct_ipv4_packet_last_observed_timestamp_seconds, \"freshness_source\", \"direct\", \"__name__\", \".*\"))",
"instant": true,
"legendFormat": "Секунд назад",
"range": false,
"refId": "A"
}
],
"title": "Обновление данных",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"description": "Скорость трафика выбранных устройств. Окно усреднения адаптируется к масштабу времени; скачивание показано вверх, отправка — вниз. Это наблюдаемый Harbor трафик, а не скорость интернет-канала.",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": true,
"drawStyle": "line",
"fillOpacity": 10,
"lineInterpolation": "smooth",
"lineWidth": 2,
"pointSize": 4,
"scaleDistribution": {
"linearThreshold": 1048576,
"log": 2,
"type": "symlog"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
}
},
"decimals": 1,
"noValue": "Нет данных",
"unit": "Bps"
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Скачивание"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "blue",
"mode": "fixed"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "Отправка"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "orange",
"mode": "fixed"
}
}
]
},
{
"matcher": {
"id": "byFrameRefID",
"options": "B"
},
"properties": [
{
"id": "custom.transform",
"value": "negative-Y"
}
]
}
]
},
"gridPos": {
"h": 12,
"w": 16,
"x": 0,
"y": 5
},
"id": 3,
"options": {
"legend": {
"calcs": [
"lastNotNull",
"mean",
"max"
],
"displayMode": "table",
"placement": "right",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "desc"
}
},
"targets": [
{
"editorMode": "code",
"expr": "sum(rate(harbor_device_traffic_bytes_total{device_id=~\"$device_id\", direction=\"download\"}[$__rate_interval])) > 0",
"legendFormat": "Скачивание",
"range": true,
"refId": "A"
},
{
"editorMode": "code",
"expr": "sum(rate(harbor_device_traffic_bytes_total{device_id=~\"$device_id\", direction=\"upload\"}[$__rate_interval])) > 0",
"legendFormat": "Отправка",
"range": true,
"refId": "B"
}
],
"title": "Скорость трафика",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"description": "Все устройства с учтённым трафиком в текущем диапазоне времени. Сортируйте столбец «За период», чтобы увидеть самые активные или самые экономные; нажмите название, чтобы применить фильтр к остальным панелям.",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"align": "auto",
"cellOptions": {
"type": "auto"
},
"inspect": false
},
"decimals": 1,
"noValue": "Нет данных",
"unit": "bytes"
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "device_id"
},
"properties": [
{
"id": "custom.hidden",
"value": true
}
]
},
{
"matcher": {
"id": "byName",
"options": "name"
},
"properties": [
{
"id": "links",
"value": [
{
"targetBlank": false,
"title": "Выбрать устройство",
"url": "?${__url_time_range}&var-device_id=${__data.fields[\"device_id\"]}"
}
]
},
{
"id": "custom.width",
"value": 180
}
]
},
{
"matcher": {
"id": "byName",
"options": "ip"
},
"properties": [
{
"id": "custom.width",
"value": 110
}
]
},
{
"matcher": {
"id": "byName",
"options": "Value"
},
"properties": [
{
"id": "custom.width",
"value": 120
}
]
}
]
},
"gridPos": {
"h": 12,
"w": 8,
"x": 16,
"y": 5
},
"id": 5,
"options": {
"cellHeight": "sm",
"footer": {
"countRows": false,
"enablePagination": false,
"fields": "",
"reducer": [
"sum"
],
"show": false
},
"showHeader": true,
"sortBy": [
{
"desc": true,
"displayName": "За период"
}
]
},
"targets": [
{
"editorMode": "code",
"expr": "(sum by (device_id) (increase(harbor_device_traffic_bytes_total[$__range])) > 0) * on (device_id) group_left (name, ip) max by (device_id, name, ip) (harbor_device_info)",
"format": "table",
"instant": true,
"legendFormat": "{{name}} · {{ip}}",
"range": false,
"refId": "A"
}
],
"title": "Все устройства за период",
"transformations": [
{
"id": "organize",
"options": {
"excludeByName": {
"Time": true
},
"indexByName": {
"name": 0,
"ip": 1,
"Value": 2,
"device_id": 3
},
"renameByName": {
"Value": "За период",
"ip": "IP",
"name": "Устройство"
}
}
}
],
"type": "table"
},
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 17
},
"id": 12,
"panels": [],
"title": "Куда уходит трафик",
"type": "row"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"description": "Основные назначения выбранных устройств по объёму трафика. Известные связанные домены объединены в сервисы; остальные сохраняются под своим доменным именем.",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"decimals": 1,
"noValue": "Нет данных за период",
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 15,
"w": 9,
"x": 0,
"y": 18
},
"id": 8,
"options": {
"displayMode": "basic",
"maxVizHeight": 300,
"minVizHeight": 16,
"minVizWidth": 8,
"namePlacement": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showUnfilled": false,
"sizing": "auto",
"valueMode": "text"
},
"targets": [
{
"editorMode": "code",
"expr": "topk(10, sum by (service) (increase(harbor_device_domain_traffic_bytes_total{device_id=~\"$device_id\"}[$__range])) > 0)",
"instant": true,
"legendFormat": "{{service}}",
"range": false,
"refId": "A"
}
],
"title": "Основные назначения",
"type": "bargauge"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"description": "Самые активные сайты и домены выбранных устройств в текущем диапазоне времени. При выборе всех устройств одинаковые домены суммируются.",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"align": "auto",
"cellOptions": {
"type": "auto"
},
"inspect": false
},
"decimals": 1,
"noValue": "Нет данных за период",
"unit": "bytes"
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "service"
},
"properties": [
{
"id": "custom.width",
"value": 180
}
]
},
{
"matcher": {
"id": "byName",
"options": "domain"
},
"properties": [
{
"id": "custom.width",
"value": 300
}
]
},
{
"matcher": {
"id": "byName",
"options": "Value"
},
"properties": [
{
"id": "custom.width",
"value": 130
}
]
}
]
},
"gridPos": {
"h": 15,
"w": 15,
"x": 9,
"y": 18
},
"id": 9,
"options": {
"cellHeight": "sm",
"footer": {
"countRows": false,
"enablePagination": false,
"fields": "",
"reducer": [
"sum"
],
"show": false
},
"showHeader": true,
"sortBy": [
{
"desc": true,
"displayName": "Трафик за период"
}
]
},
"targets": [
{
"editorMode": "code",
"expr": "topk(15, sum by (service, domain) (increase(harbor_device_domain_traffic_bytes_total{device_id=~\"$device_id\"}[$__range])) > 0)",
"format": "table",
"instant": true,
"legendFormat": "{{service}} · {{domain}}",
"range": false,
"refId": "A"
}
],
"title": "Сайты и домены",
"transformations": [
{
"id": "organize",
"options": {
"excludeByName": {
"Time": true
},
"indexByName": {
"service": 0,
"domain": 1,
"Value": 2
},
"renameByName": {
"Value": "Трафик за период",
"domain": "Домен",
"service": "Сервис"
}
}
}
],
"type": "table"
},
{
"collapsed": true,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 33
},
"id": 13,
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"description": "Где выбранный трафик вошёл в Harbor: через Gateway или Proxy. Это техническая точка входа, а не выбор VPN / Direct.",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"decimals": 1,
"noValue": "Нет данных",
"unit": "bytes"
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "gateway"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "blue",
"mode": "fixed"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "proxy"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "purple",
"mode": "fixed"
}
}
]
}
]
},
"gridPos": {
"h": 7,
"w": 12,
"x": 0,
"y": 34
},
"id": 4,
"options": {
"displayMode": "basic",
"maxVizHeight": 300,
"minVizHeight": 16,
"minVizWidth": 8,
"namePlacement": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showUnfilled": false,
"sizing": "auto",
"valueMode": "text"
},
"targets": [
{
"editorMode": "code",
"expr": "sum by (source) (increase(harbor_device_traffic_bytes_total{device_id=~\"$device_id\"}[$__range])) > 0",
"instant": true,
"legendFormat": "{{source}}",
"range": false,
"refId": "A"
}
],
"title": "Точки входа Gateway / Proxy",
"type": "bargauge"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"description": "IPv4-пакеты выбранных устройств, которые Gateway направил напрямую вместо sing-box: policy Direct или работа при остановленном VPN runtime. Это L3 packet bytes с заголовками и retransmit; их нельзя складывать с sing-box tracker bytes.",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"decimals": 1,
"noValue": "Нет данных",
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 12,
"y": 34
},
"id": 16,
"options": {
"displayMode": "basic",
"maxVizHeight": 300,
"minVizHeight": 16,
"minVizWidth": 8,
"namePlacement": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showUnfilled": false,
"sizing": "auto",
"valueMode": "text"
},
"targets": [
{
"editorMode": "code",
"expr": "sum by (direction) (increase(harbor_device_direct_ipv4_packet_bytes_total{device_id=~\"$device_id\"}[$__range])) > 0",
"instant": true,
"legendFormat": "{{direction}}",
"range": false,
"refId": "A"
}
],
"title": "Direct IPv4 мимо sing-box",
"type": "bargauge"
}
],
"title": "Техническая детализация",
"type": "row"
}
],
"refresh": "30s",
"schemaVersion": 39,
"tags": [
"harbor",
"gateway",
"traffic"
],
"templating": {
"list": [
{
"allValue": ".*",
"current": {
"selected": true,
"text": "Все устройства",
"value": "$__all"
},
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"definition": "query_result(label_join(max by (device_id, name, ip) (harbor_device_info), \"display\", \" · \", \"name\", \"ip\"))",
"description": "Выберите все устройства или одно устройство. Фильтр управляет скоростью, общим трафиком, маршрутами, сервисами, доменами и технической детализацией.",
"hide": 0,
"includeAll": true,
"label": "Устройства",
"multi": false,
"name": "device_id",
"options": [],
"query": {
"query": "query_result(label_join(max by (device_id, name, ip) (harbor_device_info), \"display\", \" · \", \"name\", \"ip\"))",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 2,
"regex": "/display=\"(?<text>[^\"]+)\"|device_id=\"(?<value>[^\"]+)\"/g",
"skipUrlSync": false,
"sort": 1,
"type": "query"
}
]
},
"time": {
"from": "now-24h",
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"30s",
"1m",
"5m",
"15m",
"30m",
"1h"
]
},
"timezone": "browser",
"title": "Harbor Gateway: трафик",
"uid": "harbor-gateway-traffic",
"version": 9,
"weekStart": "monday"
}