Add domain traffic metrics and Grafana dashboard
Build and Deploy Gateway / build-and-push (push) Successful in 14s
Build and Deploy Gateway / deploy (push) Successful in 13s

This commit is contained in:
2026-08-08 01:57:00 +03:00
parent 10888ac012
commit ca53b671ee
20 changed files with 612 additions and 17 deletions
+144 -2
View File
@@ -128,9 +128,17 @@
"editorMode": "code",
"expr": "time() - min(harbor_traffic_last_observed_timestamp_seconds)",
"instant": true,
"legendFormat": "Возраст данных",
"legendFormat": "Общий трафик",
"range": false,
"refId": "A"
},
{
"editorMode": "code",
"expr": "time() - harbor_domain_traffic_last_observed_timestamp_seconds",
"instant": true,
"legendFormat": "Домены",
"range": false,
"refId": "B"
}
],
"title": "Свежесть счётчиков",
@@ -443,6 +451,140 @@
],
"title": "Объём выбранных устройств",
"type": "bargauge"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"decimals": 1,
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 10,
"x": 0,
"y": 32
},
"id": 8,
"options": {
"displayMode": "gradient",
"maxVizHeight": 300,
"minVizHeight": 16,
"minVizWidth": 8,
"namePlacement": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showUnfilled": true,
"sizing": "auto",
"valueMode": "color"
},
"targets": [
{
"editorMode": "code",
"expr": "topk(15, sum by (service) (increase(harbor_device_domain_traffic_bytes_total[$__range])))",
"instant": true,
"legendFormat": "{{service}}",
"range": false,
"refId": "A"
}
],
"title": "Сервисы за выбранный период",
"type": "bargauge"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"align": "auto",
"cellOptions": {
"type": "auto"
},
"inspect": false
},
"decimals": 1,
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 14,
"x": 10,
"y": 32
},
"id": 9,
"options": {
"cellHeight": "sm",
"footer": {
"countRows": false,
"enablePagination": true,
"fields": "",
"reducer": [
"sum"
],
"show": false
},
"showHeader": true
},
"targets": [
{
"editorMode": "code",
"expr": "topk(50, sum by (device_id, service, domain) (increase(harbor_device_domain_traffic_bytes_total[$__range])) * on (device_id) group_left (name, ip) max by (device_id, name, ip) (harbor_device_info{name=~\"$device\"}))",
"format": "table",
"instant": true,
"legendFormat": "{{name}} · {{service}} · {{domain}}",
"range": false,
"refId": "A"
}
],
"title": "Домены выбранных устройств",
"transformations": [
{
"id": "organize",
"options": {
"excludeByName": {
"Time": true,
"device_id": true
},
"indexByName": {
"name": 0,
"ip": 1,
"service": 2,
"domain": 3,
"Value": 4
},
"renameByName": {
"Value": "Трафик за период",
"domain": "Домен",
"ip": "IP",
"name": "Устройство",
"service": "Сервис"
}
}
}
],
"type": "table"
}
],
"refresh": "30s",
@@ -492,6 +634,6 @@
"timezone": "browser",
"title": "Harbor Gateway Traffic",
"uid": "harbor-gateway-traffic",
"version": 1,
"version": 2,
"weekStart": "monday"
}