From f3cb93eb6534686fd55d09dff71340b78c9a9d5f Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Sat, 16 May 2026 08:39:08 -0500 Subject: [PATCH] fix: remove v_hidden column, simplify probe queries in MokoWaaS dashboard - Replace excludeByName hack with explicit filterFieldsByName regex - Remove redundant `and on(site_name)` join from STATUS and API queries - Compact Performance/Backup/Uptime panel JSON formatting Authored-by: Moko Consulting Co-Authored-By: Claude Opus 4.6 (1M context) --- monitoring/grafana/mokowaas-dashboard.json | 260 +++------------------ 1 file changed, 32 insertions(+), 228 deletions(-) diff --git a/monitoring/grafana/mokowaas-dashboard.json b/monitoring/grafana/mokowaas-dashboard.json index 908fd73..38d3378 100644 --- a/monitoring/grafana/mokowaas-dashboard.json +++ b/monitoring/grafana/mokowaas-dashboard.json @@ -85,7 +85,7 @@ "targets": [ { "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "expr": "probe_success{site_name=~\"$site\", job=\"blackbox-http\"} and on(site_name) label_replace(joomla_site_online{site=~\"$site\"} == 1, \"site_name\", \"$1\", \"site\", \"(.+)\")", + "expr": "probe_success{site_name=~\"$site\", job=\"blackbox-http\"}", "instant": true, "format": "table", "refId": "STATUS" }, { @@ -100,7 +100,7 @@ }, { "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "expr": "label_replace(joomla_site_api_reachable{site=~\"$site\"}, \"site_name\", \"$1\", \"site\", \"(.+)\") and on(site_name) label_replace(joomla_site_online{site=~\"$site\"} == 1, \"site_name\", \"$1\", \"site\", \"(.+)\")", + "expr": "label_replace(joomla_site_api_reachable{site=~\"$site\"}, \"site_name\", \"$1\", \"site\", \"(.+)\")", "instant": true, "format": "table", "refId": "API" }, { @@ -290,108 +290,32 @@ "type": "row" }, { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "unit": "s" - } - }, - "gridPos": { - "h": 8, - "w": 16, - "x": 0, - "y": 47 - }, + "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, + "fieldConfig": { "defaults": { "unit": "s" } }, + "gridPos": { "h": 8, "w": 16, "x": 0, "y": 47 }, "id": 20, - "options": { - "legend": { - "displayMode": "list", - "placement": "bottom" - }, - "tooltip": { - "mode": "multi" - } - }, + "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" } }, "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "expr": "probe_http_duration_seconds{site_name=~\"$site\", job=\"blackbox-http\", phase=\"transfer\"}", - "legendFormat": "{{site_name}} transfer" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "expr": "probe_http_duration_seconds{site_name=~\"$site\", job=\"blackbox-http\", phase=\"processing\"}", - "legendFormat": "{{site_name}} processing" - } + { "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, "expr": "probe_http_duration_seconds{site_name=~\"$site\", job=\"blackbox-http\", phase=\"transfer\"}", "legendFormat": "{{site_name}} transfer" }, + { "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, "expr": "probe_http_duration_seconds{site_name=~\"$site\", job=\"blackbox-http\", phase=\"processing\"}", "legendFormat": "{{site_name}} processing" } ], "title": "Response Time", "type": "timeseries" }, { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "max": 10, - "min": 0, - "thresholds": { - "steps": [ - { - "color": "green", - "value": 0 - }, - { - "color": "yellow", - "value": 2 - }, - { - "color": "red", - "value": 5 - } - ] - }, - "unit": "s" - } - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 16, - "y": 47 - }, + "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, + "fieldConfig": { "defaults": { "max": 10, "min": 0, "thresholds": { "steps": [{ "color": "green", "value": 0 }, { "color": "yellow", "value": 2 }, { "color": "red", "value": 5 }] }, "unit": "s" } }, + "gridPos": { "h": 8, "w": 8, "x": 16, "y": 47 }, "id": 22, "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "expr": "probe_duration_seconds{site_name=~\"$site\", job=\"blackbox-http\"}", - "legendFormat": "{{site_name}}" - } + { "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, "expr": "probe_duration_seconds{site_name=~\"$site\", job=\"blackbox-http\"}", "legendFormat": "{{site_name}}" } ], "title": "Total Duration", "type": "gauge" }, { "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 55 - }, + "gridPos": { "h": 1, "w": 24, "x": 0, "y": 55 }, "id": 104, "title": "Backup Status", "type": "row" @@ -399,78 +323,26 @@ { "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, "fieldConfig": { - "defaults": { - "noValue": "—", - "custom": { "align": "center", "cellOptions": { "type": "auto" } } - }, + "defaults": { "noValue": "—", "custom": { "align": "center", "cellOptions": { "type": "auto" } } }, "overrides": [ - { - "matcher": { "id": "byName", "options": "Site" }, - "properties": [ - { "id": "custom.width", "value": 300 }, - { "id": "custom.align", "value": "left" }, - { "id": "links", "value": [{ "title": "Manage Backups", "url": "${__value.text}/administrator/index.php?option=com_akeebabackup&view=Manage", "targetBlank": true }] } - ] - }, - { - "matcher": { "id": "byName", "options": "Status" }, - "properties": [ - { "id": "mappings", "value": [{ "options": { "0": { "color": "red", "text": "FAILED" }, "1": { "color": "green", "text": "OK" } }, "type": "value" }] }, - { "id": "thresholds", "value": { "mode": "absolute", "steps": [{ "color": "red", "value": null }, { "color": "green", "value": 1 }] } }, - { "id": "custom.cellOptions", "value": { "type": "color-background", "mode": "basic" } } - ] - }, - { - "matcher": { "id": "byName", "options": "Age" }, - "properties": [ - { "id": "unit", "value": "s" }, - { "id": "thresholds", "value": { "mode": "absolute", "steps": [{ "color": "green", "value": null }, { "color": "yellow", "value": 172800 }, { "color": "red", "value": 604800 }] } }, - { "id": "custom.cellOptions", "value": { "type": "color-text" } }, - { "id": "mappings", "value": [{ "options": { "-1": { "text": "—" } }, "type": "value" }] } - ] - }, - { - "matcher": { "id": "byName", "options": "Records" }, - "properties": [ - { "id": "mappings", "value": [{ "options": { "0": { "text": "—" } }, "type": "value" }] } - ] - } + { "matcher": { "id": "byName", "options": "Site" }, "properties": [{ "id": "custom.width", "value": 300 }, { "id": "custom.align", "value": "left" }, { "id": "links", "value": [{ "title": "Manage Backups", "url": "${__value.text}/administrator/index.php?option=com_akeebabackup&view=Manage", "targetBlank": true }] }] }, + { "matcher": { "id": "byName", "options": "Status" }, "properties": [{ "id": "mappings", "value": [{ "options": { "0": { "color": "red", "text": "FAILED" }, "1": { "color": "green", "text": "OK" } }, "type": "value" }] }, { "id": "thresholds", "value": { "mode": "absolute", "steps": [{ "color": "red", "value": null }, { "color": "green", "value": 1 }] } }, { "id": "custom.cellOptions", "value": { "type": "color-background", "mode": "basic" } }] }, + { "matcher": { "id": "byName", "options": "Age" }, "properties": [{ "id": "unit", "value": "s" }, { "id": "thresholds", "value": { "mode": "absolute", "steps": [{ "color": "green", "value": null }, { "color": "yellow", "value": 172800 }, { "color": "red", "value": 604800 }] } }, { "id": "custom.cellOptions", "value": { "type": "color-text" } }, { "id": "mappings", "value": [{ "options": { "-1": { "text": "—" } }, "type": "value" }] }] }, + { "matcher": { "id": "byName", "options": "Records" }, "properties": [{ "id": "mappings", "value": [{ "options": { "0": { "text": "—" } }, "type": "value" }] }] } ] }, "gridPos": { "x": 0, "y": 56, "w": 24, "h": 8 }, "id": 40, "options": { "showHeader": true, "cellHeight": "sm", "footer": { "show": false } }, "targets": [ - { - "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "expr": "label_replace(max by (site, exported_instance) (joomla_backup_status{site=~\"$site\"}), \"site_url\", \"$1\", \"exported_instance\", \"(.+)\")", - "instant": true, "format": "table", "refId": "STATUS" - }, - { - "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "expr": "joomla_backup_age_seconds{site=~\"$site\"}", - "instant": true, "format": "table", "refId": "AGE" - }, - { - "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "expr": "joomla_backup_records_total{site=~\"$site\"}", - "instant": true, "format": "table", "refId": "RECORDS" - } + { "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, "expr": "label_replace(max by (site, exported_instance) (joomla_backup_status{site=~\"$site\"}), \"site_url\", \"$1\", \"exported_instance\", \"(.+)\")", "instant": true, "format": "table", "refId": "STATUS" }, + { "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, "expr": "joomla_backup_age_seconds{site=~\"$site\"}", "instant": true, "format": "table", "refId": "AGE" }, + { "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, "expr": "joomla_backup_records_total{site=~\"$site\"}", "instant": true, "format": "table", "refId": "RECORDS" } ], "transformations": [ { "id": "joinByField", "options": { "byField": "site", "mode": "outer" } }, { "id": "filterFieldsByName", "options": { "include": { "pattern": "^(site_url|Value #).*" } } }, - { - "id": "organize", - "options": { - "renameByName": { - "site_url": "Site", - "Value #STATUS": "Status", - "Value #AGE": "Age", - "Value #RECORDS": "Records" - } - } - }, + { "id": "organize", "options": { "renameByName": { "site_url": "Site", "Value #STATUS": "Status", "Value #AGE": "Age", "Value #RECORDS": "Records" } } }, { "id": "sortBy", "options": { "sort": [{ "field": "Site", "desc": false }] } } ], "title": "Backup Status", @@ -478,96 +350,31 @@ }, { "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 68 - }, + "gridPos": { "h": 1, "w": 24, "x": 0, "y": 68 }, "id": 103, "title": "Uptime History", "type": "row" }, { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "custom": { - "fillOpacity": 10, - "lineWidth": 2 - }, - "max": 1, - "min": 0, - "thresholds": { - "steps": [ - { - "color": "red", - "value": 0 - }, - { - "color": "yellow", - "value": 0.95 - }, - { - "color": "green", - "value": 0.99 - } - ] - }, - "unit": "percentunit" - } - }, - "gridPos": { - "h": 8, - "w": 24, - "x": 0, - "y": 69 - }, + "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, + "fieldConfig": { "defaults": { "custom": { "fillOpacity": 10, "lineWidth": 2 }, "max": 1, "min": 0, "thresholds": { "steps": [{ "color": "red", "value": 0 }, { "color": "yellow", "value": 0.95 }, { "color": "green", "value": 0.99 }] }, "unit": "percentunit" } }, + "gridPos": { "h": 8, "w": 24, "x": 0, "y": 69 }, "id": 30, - "options": { - "legend": { - "displayMode": "list", - "placement": "bottom" - }, - "tooltip": { - "mode": "single" - } - }, + "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "expr": "avg_over_time(probe_success{site_name=~\"$site\", job=\"blackbox-http\"}[1h])", - "legendFormat": "{{site_name}}" - } + { "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, "expr": "avg_over_time(probe_success{site_name=~\"$site\", job=\"blackbox-http\"}[1h])", "legendFormat": "{{site_name}}" } ], "title": "Availability (30d)", "type": "timeseries" } ], "refresh": "5m", - "tags": [ - "mokowaas", - "joomla", - "endpoints", - "monitoring" - ], + "tags": ["mokowaas", "joomla", "endpoints", "monitoring"], "templating": { "list": [ { - "current": { - "text": "All", - "value": "$__all" - }, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, + "current": { "text": "All", "value": "$__all" }, + "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, "includeAll": true, "label": "Site", "multi": true, @@ -579,10 +386,7 @@ } ] }, - "time": { - "from": "now-24h", - "to": "now" - }, + "time": { "from": "now-24h", "to": "now" }, "timezone": "browser", "title": "MokoWaaS", "uid": "mokowaas",