From e28c7391abd33351efe05a9552f987b3112f4c97 Mon Sep 17 00:00:00 2001 From: Robert Jacob Date: Sun, 12 Oct 2025 21:17:13 +0200 Subject: [PATCH] Update dashboard with new panels --- CHANGELOG.md | 1 + contrib/grafana-dashboard.json | 276 +++++++++++++++++++++++++++------ 2 files changed, 230 insertions(+), 47 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d50f65..c0762b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Additional labels on `nextcloud_scrape_errors_total` - `unavailable` for HTTP Service Unavailable (503) errors - `maintenance` for maintenance mode +- Panels for scrape errors and version info in Grafana Dashboard ## [0.8.0] - 2024-12-22 diff --git a/contrib/grafana-dashboard.json b/contrib/grafana-dashboard.json index a3dd5cb..9e5912b 100644 --- a/contrib/grafana-dashboard.json +++ b/contrib/grafana-dashboard.json @@ -2,7 +2,7 @@ "__inputs": [ { "name": "DS_LOCAL", - "label": "Prometheus", + "label": "local", "description": "", "type": "datasource", "pluginId": "prometheus", @@ -15,7 +15,7 @@ "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "10.2.3" + "version": "10.4.1" }, { "type": "panel", @@ -35,6 +35,12 @@ "name": "Stat", "version": "" }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + }, { "type": "panel", "id": "timeseries", @@ -129,10 +135,11 @@ "fields": "", "values": false }, + "showPercentChange": false, "textMode": "auto", "wideLayout": true }, - "pluginVersion": "10.2.3", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { @@ -215,7 +222,6 @@ "y": 1 }, "id": 1, - "links": [], "options": { "legend": { "calcs": [], @@ -328,7 +334,6 @@ "y": 1 }, "id": 11, - "links": [], "options": { "legend": { "calcs": [], @@ -439,7 +444,6 @@ "y": 9 }, "id": 2, - "links": [], "options": { "legend": { "calcs": [], @@ -537,7 +541,6 @@ "y": 9 }, "id": 3, - "links": [], "options": { "legend": { "calcs": [], @@ -627,10 +630,11 @@ "fields": "", "values": false }, + "showPercentChange": false, "textMode": "auto", "wideLayout": true }, - "pluginVersion": "10.2.3", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { @@ -696,10 +700,11 @@ "fields": "", "values": false }, + "showPercentChange": false, "textMode": "auto", "wideLayout": true }, - "pluginVersion": "10.2.3", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { @@ -730,6 +735,31 @@ "title": "System Information", "type": "row" }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_LOCAL}" + }, + "gridPos": { + "h": 7, + "w": 4, + "x": 0, + "y": 25 + }, + "id": 19, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Nextcloud Version${_nextcloud_version}
PHP Version${_php_version}
Database${_database}
\n", + "mode": "html" + }, + "pluginVersion": "10.4.1", + "title": "Version Info ($instance)", + "type": "text" + }, { "datasource": { "type": "prometheus", @@ -779,7 +809,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null } ] }, @@ -789,12 +820,11 @@ }, "gridPos": { "h": 7, - "w": 12, - "x": 0, + "w": 10, + "x": 4, "y": 25 }, "id": 4, - "links": [], "options": { "legend": { "calcs": [], @@ -828,6 +858,114 @@ "title": "Disk Space Left", "type": "timeseries" }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_LOCAL}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "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", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 10, + "x": 14, + "y": 25 + }, + "id": 18, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_LOCAL}" + }, + "editorMode": "code", + "expr": "sum by (cause) (rate(nextcloud_scrape_errors_total{instance=\"$instance\"}[5m]))", + "instant": false, + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Exporter Scrape Errors", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 32 + }, + "id": 16, + "panels": [], + "title": "Environment Information", + "type": "row" + }, { "datasource": { "type": "prometheus", @@ -852,10 +990,10 @@ "gridPos": { "h": 7, "w": 4, - "x": 12, - "y": 25 + "x": 0, + "y": 33 }, - "id": 13, + "id": 14, "options": { "legend": { "displayMode": "table", @@ -886,14 +1024,14 @@ }, "editorMode": "code", "exemplar": false, - "expr": "sum by(version) (nextcloud_system_info)", + "expr": "sum by(version) (nextcloud_php_info)", "instant": true, "legendFormat": "__auto", "range": false, "refId": "A" } ], - "title": "Nextcloud Versions (all instances)", + "title": "PHP Versions (all instances)", "type": "piechart" }, { @@ -920,10 +1058,10 @@ "gridPos": { "h": 7, "w": 4, - "x": 16, - "y": 25 + "x": 4, + "y": 33 }, - "id": 17, + "id": 15, "options": { "legend": { "displayMode": "table", @@ -954,29 +1092,16 @@ }, "editorMode": "code", "exemplar": false, - "expr": "sum by(version) (nextcloud_exporter_info)", + "expr": "sum by(type, version) (nextcloud_database_info)", "instant": true, - "legendFormat": "__auto", + "legendFormat": "{{type}} {{version}}", "range": false, "refId": "A" } ], - "title": "Exporter Versions (all instances)", + "title": "Databases (all instances)", "type": "piechart" }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 32 - }, - "id": 16, - "panels": [], - "title": "Environment Information", - "type": "row" - }, { "datasource": { "type": "prometheus", @@ -1001,10 +1126,10 @@ "gridPos": { "h": 7, "w": 4, - "x": 0, + "x": 8, "y": 33 }, - "id": 14, + "id": 13, "options": { "legend": { "displayMode": "table", @@ -1035,14 +1160,14 @@ }, "editorMode": "code", "exemplar": false, - "expr": "sum by(version) (nextcloud_php_info)", + "expr": "sum by(version) (nextcloud_system_info)", "instant": true, "legendFormat": "__auto", "range": false, "refId": "A" } ], - "title": "PHP Versions (all instances)", + "title": "Nextcloud Versions (all instances)", "type": "piechart" }, { @@ -1069,10 +1194,10 @@ "gridPos": { "h": 7, "w": 4, - "x": 4, + "x": 12, "y": 33 }, - "id": 15, + "id": 17, "options": { "legend": { "displayMode": "table", @@ -1103,14 +1228,14 @@ }, "editorMode": "code", "exemplar": false, - "expr": "sum by(type, version) (nextcloud_database_info)", + "expr": "sum by(version) (nextcloud_exporter_info)", "instant": true, - "legendFormat": "{{type}} {{version}}", + "legendFormat": "__auto", "range": false, "refId": "A" } ], - "title": "Databases (all instances)", + "title": "Exporter Versions (all instances)", "type": "piechart" } ], @@ -1144,6 +1269,63 @@ "tagsQuery": "", "type": "query", "useTags": false + }, + { + "current": {}, + "definition": "query_result(group by (version) (nextcloud_system_info{instance=\"$instance\"}))", + "hide": 2, + "includeAll": false, + "multi": false, + "name": "_nextcloud_version", + "options": [], + "query": { + "qryType": 3, + "query": "query_result(group by (version) (nextcloud_system_info{instance=\"$instance\"}))", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 2, + "regex": "/version=\"(.+)\"/", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": {}, + "definition": "query_result(group by (version) (nextcloud_php_info{instance=\"$instance\"}))", + "hide": 2, + "includeAll": false, + "multi": false, + "name": "_php_version", + "options": [], + "query": { + "qryType": 3, + "query": "query_result(group by (version) (nextcloud_php_info{instance=\"$instance\"}))", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 2, + "regex": "/version=\"(.+)\"/", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": {}, + "definition": "query_result(label_join(group by (type, version) (nextcloud_database_info{instance=\"$instance\"}), \"info\", \" \", \"type\", \"version\"))", + "hide": 2, + "includeAll": false, + "multi": false, + "name": "_database", + "options": [], + "query": { + "qryType": 3, + "query": "query_result(label_join(group by (type, version) (nextcloud_database_info{instance=\"$instance\"}), \"info\", \" \", \"type\", \"version\"))", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 2, + "regex": "/info=\"(.+?)\"/", + "skipUrlSync": false, + "sort": 0, + "type": "query" } ] }, @@ -1176,6 +1358,6 @@ "timezone": "browser", "title": "Nextcloud", "uid": "cdae9143-9a17-4d37-87da-d34fb9cfd92f", - "version": 4, + "version": 7, "weekStart": "" }