{ "__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 и Proxy. Физический и Direct-трафик вне Harbor не включён.", "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": "Сколько секунд прошло с последнего успешного обновления. До 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": 6, "w": 6, "x": 0, "y": 1 }, "id": 2, "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto", "wideLayout": true }, "targets": [ { "editorMode": "code", "expr": "time() - min(harbor_traffic_last_observed_timestamp_seconds)", "instant": true, "legendFormat": "Общий трафик", "range": false, "refId": "A" }, { "editorMode": "code", "expr": "time() - harbor_domain_traffic_last_observed_timestamp_seconds", "instant": true, "legendFormat": "Домены", "range": false, "refId": "B" } ], "title": "Свежесть данных сейчас", "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "description": "Текущая суммарная скорость всех устройств, сглаженная за последние 5 минут.", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "drawStyle": "line", "fillOpacity": 10, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 4, "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" } } ] } ] }, "gridPos": { "h": 6, "w": 18, "x": 6, "y": 1 }, "id": 3, "options": { "legend": { "calcs": [ "lastNotNull", "mean" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "editorMode": "code", "expr": "sum(rate(harbor_device_traffic_bytes_total{direction=\"download\"}[5m]))", "legendFormat": "Скачивание", "range": true, "refId": "A" }, { "editorMode": "code", "expr": "sum(rate(harbor_device_traffic_bytes_total{direction=\"upload\"}[5m]))", "legendFormat": "Отправка", "range": true, "refId": "B" } ], "title": "Скорость сейчас, средняя за 5 минут", "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\"]}" } ] } ] } ] }, "gridPos": { "h": 9, "w": 24, "x": 0, "y": 7 }, "id": 5, "options": { "cellHeight": "sm", "footer": { "countRows": false, "enablePagination": true, "fields": "", "reducer": [ "sum" ], "show": false }, "showHeader": true, "sortBy": [ { "desc": true, "displayName": "За период" } ] }, "targets": [ { "editorMode": "code", "expr": "topk(10, (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": "Топ-10 устройств за выбранный период", "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": 16 }, "id": 11, "panels": [], "title": "Устройство", "type": "row" }, { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "description": "Скорость одного выбранного устройства по Gateway/Proxy и upload/download, средняя за последние 5 минут.", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "drawStyle": "line", "fillOpacity": 8, "lineInterpolation": "smooth", "lineWidth": 2, "pointSize": 4, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" } }, "decimals": 1, "noValue": "Нет данных за период", "unit": "Bps" }, "overrides": [] }, "gridPos": { "h": 9, "w": 24, "x": 0, "y": 17 }, "id": 6, "options": { "legend": { "calcs": [ "lastNotNull", "mean", "max" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "editorMode": "code", "expr": "sum by (source, direction) (rate(harbor_device_traffic_bytes_total{device_id=\"$device_id\"}[5m]))", "legendFormat": "{{source}} · {{direction}}", "range": true, "refId": "A" } ], "title": "${device_id:text}: скорость сейчас", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "description": "Накопленные счётчики выбранного устройства за всё время хранения Harbor. Нулевые серии скрыты.", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "decimals": 1, "noValue": "Трафик не учтён", "unit": "bytes" }, "overrides": [] }, "gridPos": { "h": 7, "w": 24, "x": 0, "y": 26 }, "id": 7, "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, direction) (harbor_device_traffic_bytes_total{device_id=\"$device_id\"}) > 0", "instant": true, "legendFormat": "{{source}} · {{direction}}", "range": false, "refId": "A" } ], "title": "${device_id:text}: накоплено", "type": "bargauge" }, { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 33 }, "id": 12, "panels": [], "title": "Сервисы и домены", "type": "row" }, { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "description": "Сервисы выбранного устройства по объёму domain traffic в текущем диапазоне времени. Нулевые серии скрыты.", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "decimals": 1, "noValue": "Нет данных за период", "unit": "bytes" }, "overrides": [] }, "gridPos": { "h": 10, "w": 10, "x": 0, "y": 34 }, "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": "${device_id:text}: сервисы за период", "type": "bargauge" }, { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "description": "Домены выбранного устройства в текущем диапазоне времени. Устройство и IP не повторяются в строках.", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "inspect": false }, "decimals": 1, "noValue": "Нет данных за период", "unit": "bytes" }, "overrides": [] }, "gridPos": { "h": 10, "w": 14, "x": 10, "y": 34 }, "id": 9, "options": { "cellHeight": "sm", "footer": { "countRows": false, "enablePagination": true, "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": "${device_id:text}: домены за период", "transformations": [ { "id": "organize", "options": { "excludeByName": { "Time": true }, "indexByName": { "service": 0, "domain": 1, "Value": 2 }, "renameByName": { "Value": "Трафик за период", "domain": "Домен", "service": "Сервис" } } } ], "type": "table" }, { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 44 }, "id": 13, "panels": [], "title": "Техническая детализация", "type": "row" }, { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "description": "Накопленный объём всех счётчиков Harbor за всё время хранения.", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "decimals": 1, "noValue": "Нет данных", "unit": "bytes" }, "overrides": [] }, "gridPos": { "h": 6, "w": 8, "x": 0, "y": 45 }, "id": 1, "options": { "colorMode": "none", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto", "wideLayout": true }, "targets": [ { "editorMode": "code", "expr": "sum(harbor_traffic_bytes_total)", "instant": true, "legendFormat": "Учтено Harbor", "range": false, "refId": "A" } ], "title": "Накоплено: весь Harbor", "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "description": "Накопленные счётчики за всё время хранения отдельно для Gateway и Proxy.", "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": 6, "w": 16, "x": 8, "y": 45 }, "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) (harbor_traffic_bytes_total) > 0", "instant": true, "legendFormat": "{{source}}", "range": false, "refId": "A" } ], "title": "Накоплено: источники", "type": "bargauge" } ], "refresh": "30s", "schemaVersion": 39, "tags": [ "harbor", "gateway", "traffic" ], "templating": { "list": [ { "current": {}, "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "definition": "query_result(label_join(max by (device_id, name, ip) (harbor_device_info), \"display\", \" · \", \"name\", \"ip\"))", "description": "Одно устройство для графиков, сервисов и доменов ниже. Значение фильтра — стабильный device_id.", "hide": 0, "includeAll": false, "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": 1, "regex": "/display=\"(?[^\"]+)\"|device_id=\"(?[^\"]+)\"/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": 3, "weekStart": "monday" }