From 44982d80d7bc8b1695b09c268ca75743a92d42f5 Mon Sep 17 00:00:00 2001 From: aharper343 Date: Wed, 24 Dec 2025 01:05:57 -0500 Subject: [PATCH] Add Prometheus Country insights --- ...Poller_ Country Insights - Prometheus.json | 1186 +++++++++++++++++ 1 file changed, 1186 insertions(+) create mode 100644 v2.0.0/UniFi-Poller_ Country Insights - Prometheus.json diff --git a/v2.0.0/UniFi-Poller_ Country Insights - Prometheus.json b/v2.0.0/UniFi-Poller_ Country Insights - Prometheus.json new file mode 100644 index 0000000..1240607 --- /dev/null +++ b/v2.0.0/UniFi-Poller_ Country Insights - Prometheus.json @@ -0,0 +1,1186 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 1, + "id": 58, + "links": [ + { + "asDropdown": true, + "icon": "external link", + "includeVars": false, + "keepTime": true, + "tags": [], + "targetBlank": false, + "title": "UniFi Poller", + "tooltip": "", + "type": "dashboards", + "url": "" + }, + { + "asDropdown": false, + "icon": "external link", + "includeVars": false, + "keepTime": false, + "tags": [], + "targetBlank": false, + "title": "Help", + "tooltip": "", + "type": "link", + "url": "https://golift.io/unifi-poller/issues" + }, + { + "asDropdown": false, + "icon": "external link", + "includeVars": false, + "keepTime": false, + "tags": [], + "targetBlank": false, + "title": "Wiki", + "tooltip": "", + "type": "link", + "url": "https://golift.io/unifi-poller/wiki" + }, + { + "asDropdown": false, + "icon": "external link", + "includeVars": false, + "keepTime": false, + "tags": [], + "targetBlank": false, + "title": "Discord", + "tooltip": "", + "type": "link", + "url": "https://discord.gg/KnyKYt2" + } + ], + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "000000001" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "footer": { + "reducers": [] + }, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Value #A" + }, + "properties": [ + { + "id": "displayName", + "value": "Bytes Rx" + }, + { + "id": "unit", + "value": "decbytes" + }, + { + "id": "custom.align", + "value": "auto" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Value #B" + }, + "properties": [ + { + "id": "displayName", + "value": "Bytes Tx" + }, + { + "id": "unit", + "value": "decbytes" + }, + { + "id": "custom.align", + "value": "auto" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "code" + }, + "properties": [ + { + "id": "displayName", + "value": "Country code" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "name" + }, + "properties": [ + { + "id": "displayName", + "value": "Country name" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Time" + }, + "properties": [ + { + "id": "custom.hideFrom.viz", + "value": true + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "site_name" + }, + "properties": [ + { + "id": "displayName", + "value": "Site" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "source" + }, + "properties": [ + { + "id": "displayName", + "value": "Controller" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "region" + }, + "properties": [ + { + "id": "displayName", + "value": "Region" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "sub_region" + }, + "properties": [ + { + "id": "displayName", + "value": "Sub-Regiion" + } + ] + } + ] + }, + "gridPos": { + "h": 11, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 1, + "options": { + "cellHeight": "sm", + "frameIndex": 0, + "frozenColumns": {}, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "Bytes Rx" + } + ] + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "000000001" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum by(code, name, region, sub_region, site_name, source) (unpoller_countrytraffic_receive_bytes_total{site_name=~\"$Site\", source=~\"$Controller\", code=~\"$CountryCode\", region=~\"$Region\", sub_region=~\"$SubRegion\"})", + "format": "table", + "instant": true, + "legendFormat": "", + "range": false, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "000000001" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum by(code, name, region, sub_region, site_name, source) (unpoller_countrytraffic_transmit_bytes_total{site_name=~\"$Site\", source=~\"$Controller\", code=~\"$CountryCode\", region=~\"$Region\", sub_region=~\"$SubRegion\"})", + "format": "table", + "hide": false, + "instant": true, + "legendFormat": "", + "range": false, + "refId": "B" + } + ], + "title": "Country Traffic", + "transformations": [ + { + "id": "merge", + "options": {} + }, + { + "id": "organize", + "options": { + "excludeByName": {}, + "includeByName": {}, + "indexByName": { + "Time": 0, + "Value #A": 7, + "Value #B": 8, + "code": 1, + "name": 2, + "region": 3, + "site_name": 5, + "source": 6, + "sub_region": 4 + }, + "renameByName": {} + } + } + ], + "type": "table" + }, + { + "datasource": { + "type": "prometheus", + "uid": "000000001" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [], + "unit": "decbytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Value" + }, + "properties": [ + { + "id": "unit", + "value": "decbytes" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 11 + }, + "id": 2, + "options": { + "displayLabels": [], + "legend": { + "displayMode": "table", + "placement": "right", + "showLegend": true, + "values": [ + "percent", + "value" + ] + }, + "pieType": "pie", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "sort": "desc", + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "editorMode": "code", + "exemplar": false, + "expr": "sum by(code, name) (unpoller_countrytraffic_receive_bytes_total{site_name=~\"$Site\", source=~\"$Controller\", code=~\"$CountryCode\", region=~\"$Region\", sub_region=~\"$SubRegion\"})", + "instant": false, + "legendFormat": "{{name}}", + "range": true, + "refId": "A" + } + ], + "title": "Bytes Rx By Country", + "type": "piechart" + }, + { + "datasource": { + "type": "prometheus", + "uid": "000000001" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [] + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Value" + }, + "properties": [ + { + "id": "unit", + "value": "decbytes" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 11 + }, + "id": 3, + "options": { + "displayLabels": [], + "legend": { + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Value", + "sortDesc": true, + "values": [ + "percent", + "value" + ] + }, + "pieType": "pie", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "sort": "desc", + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "editorMode": "code", + "exemplar": false, + "expr": "sum by(code, name) (unpoller_countrytraffic_transmit_bytes_total{site_name=~\"$Site\", source=~\"$Controller\", code=~\"$CountryCode\", region=~\"$Region\", sub_region=~\"$SubRegion\"})", + "instant": false, + "legendFormat": "{{name}}", + "range": true, + "refId": "A" + } + ], + "title": "Bytes Tx By Country", + "type": "piechart" + }, + { + "datasource": { + "type": "prometheus", + "uid": "000000001" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "bytes /sec", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byValue", + "options": { + "op": "gte", + "reducer": "allIsNull", + "value": 0 + } + }, + "properties": [ + { + "id": "custom.hideFrom", + "value": { + "legend": true, + "tooltip": true, + "viz": false + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/Rx$/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + }, + { + "id": "unit", + "value": "decbytes" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/Tx$/" + }, + "properties": [ + { + "id": "unit", + "value": "decbytes" + } + ] + }, + { + "matcher": { + "id": "byValue", + "options": { + "op": "gte", + "reducer": "allIsZero", + "value": 0 + } + }, + "properties": [] + } + ] + }, + "gridPos": { + "h": 18, + "w": 24, + "x": 0, + "y": 21 + }, + "id": 4, + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "hideZeros": false, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "editorMode": "code", + "expr": "sum by (code, name) (rate(unpoller_countrytraffic_receive_bytes_total{site_name=~\"$Site\", source=~\"$Controller\", code=~\"$CountryCode\", region=~\"$Region\", sub_region=~\"$SubRegion\"}[$__interval]))", + "interval": "$Smooth", + "legendFormat": "{{name}} Rx", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "000000001" + }, + "editorMode": "code", + "expr": "sum by (code, name) (rate(unpoller_countrytraffic_transmit_bytes_total{site_name=~\"$Site\", source=~\"$Controller\", code=~\"$CountryCode\", region=~\"$Region\", sub_region=~\"$SubRegion\"}[$__interval]))", + "hide": false, + "instant": false, + "interval": "$Smooth", + "legendFormat": "{{name}} Tx", + "range": true, + "refId": "B" + } + ], + "title": "Traffic By Country", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "000000001" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [], + "unit": "decbytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Value" + }, + "properties": [ + { + "id": "unit", + "value": "decbytes" + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 39 + }, + "id": 5, + "options": { + "displayLabels": [], + "legend": { + "displayMode": "table", + "placement": "right", + "showLegend": true, + "values": [ + "percent", + "value" + ] + }, + "pieType": "pie", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "sort": "desc", + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "editorMode": "code", + "exemplar": false, + "expr": "sum by(region, sub_region) (unpoller_countrytraffic_receive_bytes_total{site_name=~\"$Site\", source=~\"$Controller\", code=~\"$CountryCode\", region=~\"$Region\", sub_region=~\"$SubRegion\"})", + "instant": false, + "legendFormat": "{{region}} / {{sub_region}}", + "range": true, + "refId": "A" + } + ], + "title": "Bytes Rx By Region", + "type": "piechart" + }, + { + "datasource": { + "type": "prometheus", + "uid": "000000001" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [] + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Value" + }, + "properties": [ + { + "id": "unit", + "value": "decbytes" + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 39 + }, + "id": 6, + "options": { + "displayLabels": [], + "legend": { + "displayMode": "table", + "placement": "right", + "showLegend": true, + "values": [ + "percent", + "value" + ] + }, + "pieType": "pie", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "sort": "desc", + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "editorMode": "code", + "exemplar": false, + "expr": "sum by(region, sub_region) (unpoller_countrytraffic_transmit_bytes_total{site_name=~\"$Site\", source=~\"$Controller\", code=~\"$CountryCode\", region=~\"$Region\", sub_region=~\"$SubRegion\"})", + "instant": false, + "legendFormat": "{{region}} / {{sub_region}}", + "range": true, + "refId": "A" + } + ], + "title": "Bytes Tx By Region", + "type": "piechart" + }, + { + "datasource": { + "type": "prometheus", + "uid": "000000001" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "bytes /sec", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byValue", + "options": { + "op": "gte", + "reducer": "allIsNull", + "value": 0 + } + }, + "properties": [ + { + "id": "custom.hideFrom", + "value": { + "legend": true, + "tooltip": true, + "viz": false + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/Rx$/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + }, + { + "id": "unit", + "value": "decbytes" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/Tx$/" + }, + "properties": [ + { + "id": "unit", + "value": "decbytes" + } + ] + }, + { + "matcher": { + "id": "byValue", + "options": { + "op": "gte", + "reducer": "allIsZero", + "value": 0 + } + }, + "properties": [] + } + ] + }, + "gridPos": { + "h": 18, + "w": 24, + "x": 0, + "y": 46 + }, + "id": 7, + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "hideZeros": false, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "12.3.1", + "targets": [ + { + "editorMode": "code", + "expr": "sum by (region, sub_region) (rate(unpoller_countrytraffic_receive_bytes_total{site_name=~\"$Site\", source=~\"$Controller\", code=~\"$CountryCode\", region=~\"$Region\", sub_region=~\"$SubRegion\"}[$__interval]))", + "interval": "$Smooth", + "legendFormat": "{{region}} / {{sub_region}} Rx", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "000000001" + }, + "editorMode": "code", + "expr": "sum by (region, sub_region) (rate(unpoller_countrytraffic_transmit_bytes_total{site_name=~\"$Site\", source=~\"$Controller\", code=~\"$CountryCode\", region=~\"$Region\", sub_region=~\"$SubRegion\"}[$__interval]))", + "hide": false, + "instant": false, + "interval": "$Smooth", + "legendFormat": "{{region}} / {{sub_region}} Tx", + "range": true, + "refId": "B" + } + ], + "title": "Traffic By Region / Sub-Region", + "type": "timeseries" + } + ], + "preload": false, + "schemaVersion": 42, + "tags": [ + "unifi", + "unifi-poller" + ], + "templating": { + "list": [ + { + "current": { + "text": [ + "All" + ], + "value": [ + "$__all" + ] + }, + "definition": "label_values(unpoller_countrytraffic_receive_bytes_total,region)", + "includeAll": true, + "multi": true, + "name": "Region", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(unpoller_countrytraffic_receive_bytes_total,region)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "sort": 1, + "type": "query" + }, + { + "current": { + "text": "All", + "value": [ + "$__all" + ] + }, + "definition": "label_values(unpoller_countrytraffic_receive_bytes_total{region=~\"$Region\"},sub_region)", + "includeAll": true, + "label": "Sub-Region", + "multi": true, + "name": "SubRegion", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(unpoller_countrytraffic_receive_bytes_total{region=~\"$Region\"},sub_region)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "sort": 1, + "type": "query" + }, + { + "current": { + "text": "All", + "value": [ + "$__all" + ] + }, + "definition": "label_values(unpoller_countrytraffic_receive_bytes_total{region=~\"$Region\"},code)", + "includeAll": true, + "label": "Country Code", + "multi": true, + "name": "CountryCode", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(unpoller_countrytraffic_receive_bytes_total{region=~\"$Region\"},code)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "type": "query" + }, + { + "current": { + "text": "All", + "value": "$__all" + }, + "definition": "label_values(unpoller_countrytraffic_receive_bytes_total,source)", + "includeAll": true, + "multi": true, + "name": "Controller", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(unpoller_countrytraffic_receive_bytes_total,source)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "sort": 1, + "type": "query" + }, + { + "current": { + "text": "All", + "value": "$__all" + }, + "definition": "label_values(unpoller_countrytraffic_receive_bytes_total,site_name)", + "includeAll": true, + "multi": true, + "name": "Site", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(unpoller_countrytraffic_receive_bytes_total,site_name)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "sort": 1, + "type": "query" + }, + { + "current": { + "text": "5m", + "value": "5m" + }, + "name": "Smooth", + "options": [ + { + "selected": false, + "text": "30s", + "value": "30s" + }, + { + "selected": false, + "text": "1m", + "value": "1m" + }, + { + "selected": false, + "text": "2m", + "value": "2m" + }, + { + "selected": true, + "text": "5m", + "value": "5m" + }, + { + "selected": false, + "text": "10m", + "value": "10m" + }, + { + "selected": false, + "text": "15m", + "value": "15m" + }, + { + "selected": false, + "text": "30m", + "value": "30m" + }, + { + "selected": false, + "text": "1h", + "value": "1h" + } + ], + "query": "30s,1m,2m,5m,10m,15m,30m,1h", + "type": "custom" + } + ] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h" + ] + }, + "timezone": "browser", + "title": "UniFi-Poller: Country Insights - Prometheus", + "uid": "adrwdnc", + "version": 21 +} \ No newline at end of file