fix(dashboardAPI): show string fields in stat panels (reduceOptions.fields)
Grafana Stat/Gauge panels default the Fields option to "Numeric Fields"
(reduceOptions.fields == ""), so string-valued fields (mode, state,
movementState, direction, flowSource, predictionQuality, running) are excluded
and the panel renders "No data" even though the Flux query (last()) returns the
string correctly.
Set reduceOptions.fields = "/.*/" ("All fields") on every stat panel bound to a
string field across machine, machineGroup, pumpingStation, valve,
valveGroupControl, and monster templates. lastNotNull calc was already correct.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -88,7 +88,8 @@
|
|||||||
"reduceOptions": {
|
"reduceOptions": {
|
||||||
"calcs": [
|
"calcs": [
|
||||||
"lastNotNull"
|
"lastNotNull"
|
||||||
]
|
],
|
||||||
|
"fields": "/.*/"
|
||||||
},
|
},
|
||||||
"colorMode": "value",
|
"colorMode": "value",
|
||||||
"graphMode": "none"
|
"graphMode": "none"
|
||||||
@@ -137,7 +138,8 @@
|
|||||||
"reduceOptions": {
|
"reduceOptions": {
|
||||||
"calcs": [
|
"calcs": [
|
||||||
"lastNotNull"
|
"lastNotNull"
|
||||||
]
|
],
|
||||||
|
"fields": "/.*/"
|
||||||
},
|
},
|
||||||
"colorMode": "value",
|
"colorMode": "value",
|
||||||
"graphMode": "none"
|
"graphMode": "none"
|
||||||
@@ -793,7 +795,8 @@
|
|||||||
"reduceOptions": {
|
"reduceOptions": {
|
||||||
"calcs": [
|
"calcs": [
|
||||||
"lastNotNull"
|
"lastNotNull"
|
||||||
]
|
],
|
||||||
|
"fields": "/.*/"
|
||||||
},
|
},
|
||||||
"colorMode": "value",
|
"colorMode": "value",
|
||||||
"graphMode": "area"
|
"graphMode": "area"
|
||||||
@@ -1055,4 +1058,4 @@
|
|||||||
"title": "template",
|
"title": "template",
|
||||||
"uid": null,
|
"uid": null,
|
||||||
"version": 1
|
"version": 1
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,8 @@
|
|||||||
"reduceOptions": {
|
"reduceOptions": {
|
||||||
"calcs": [
|
"calcs": [
|
||||||
"lastNotNull"
|
"lastNotNull"
|
||||||
]
|
],
|
||||||
|
"fields": "/.*/"
|
||||||
},
|
},
|
||||||
"colorMode": "value",
|
"colorMode": "value",
|
||||||
"graphMode": "none"
|
"graphMode": "none"
|
||||||
@@ -521,4 +522,4 @@
|
|||||||
"title": "template",
|
"title": "template",
|
||||||
"uid": null,
|
"uid": null,
|
||||||
"version": 1
|
"version": 1
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
"datasource": { "type": "influxdb", "uid": "cdzg44tv250jkd" },
|
"datasource": { "type": "influxdb", "uid": "cdzg44tv250jkd" },
|
||||||
"gridPos": { "h": 5, "w": 8, "x": 0, "y": 1 },
|
"gridPos": { "h": 5, "w": 8, "x": 0, "y": 1 },
|
||||||
"id": 2,
|
"id": 2,
|
||||||
|
"options": { "reduceOptions": { "calcs": ["lastNotNull"], "fields": "/.*/" }, "colorMode": "value", "graphMode": "none" },
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"query": "from(bucket: \"${bucket}\")\n |> range(start: -30d)\n |> filter(fn:(r) => r._measurement==\"${measurement}\" and (r._field==\"running\" or r._field==\"pulse\"))\n |> last()",
|
"query": "from(bucket: \"${bucket}\")\n |> range(start: -30d)\n |> filter(fn:(r) => r._measurement==\"${measurement}\" and (r._field==\"running\" or r._field==\"pulse\"))\n |> last()",
|
||||||
|
|||||||
@@ -61,7 +61,8 @@
|
|||||||
"reduceOptions": {
|
"reduceOptions": {
|
||||||
"calcs": [
|
"calcs": [
|
||||||
"lastNotNull"
|
"lastNotNull"
|
||||||
]
|
],
|
||||||
|
"fields": "/.*/"
|
||||||
},
|
},
|
||||||
"colorMode": "value",
|
"colorMode": "value",
|
||||||
"graphMode": "none"
|
"graphMode": "none"
|
||||||
@@ -168,7 +169,8 @@
|
|||||||
"reduceOptions": {
|
"reduceOptions": {
|
||||||
"calcs": [
|
"calcs": [
|
||||||
"lastNotNull"
|
"lastNotNull"
|
||||||
]
|
],
|
||||||
|
"fields": "/.*/"
|
||||||
},
|
},
|
||||||
"colorMode": "value",
|
"colorMode": "value",
|
||||||
"graphMode": "none"
|
"graphMode": "none"
|
||||||
@@ -698,4 +700,4 @@
|
|||||||
"title": "template",
|
"title": "template",
|
||||||
"uid": null,
|
"uid": null,
|
||||||
"version": 1
|
"version": 1
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
"datasource": { "type": "influxdb", "uid": "cdzg44tv250jkd" },
|
"datasource": { "type": "influxdb", "uid": "cdzg44tv250jkd" },
|
||||||
"gridPos": { "h": 5, "w": 8, "x": 0, "y": 1 },
|
"gridPos": { "h": 5, "w": 8, "x": 0, "y": 1 },
|
||||||
"id": 2,
|
"id": 2,
|
||||||
|
"options": { "reduceOptions": { "calcs": ["lastNotNull"], "fields": "/.*/" }, "colorMode": "value", "graphMode": "none" },
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"query": "from(bucket: \"${bucket}\")\n |> range(start: -30d)\n |> filter(fn:(r) => r._measurement==\"${measurement}\" and (r._field==\"state\" or r._field==\"mode\" or r._field==\"percentageOpen\"))\n |> last()",
|
"query": "from(bucket: \"${bucket}\")\n |> range(start: -30d)\n |> filter(fn:(r) => r._measurement==\"${measurement}\" and (r._field==\"state\" or r._field==\"mode\" or r._field==\"percentageOpen\"))\n |> last()",
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
"datasource": { "type": "influxdb", "uid": "cdzg44tv250jkd" },
|
"datasource": { "type": "influxdb", "uid": "cdzg44tv250jkd" },
|
||||||
"gridPos": { "h": 5, "w": 8, "x": 0, "y": 1 },
|
"gridPos": { "h": 5, "w": 8, "x": 0, "y": 1 },
|
||||||
"id": 2,
|
"id": 2,
|
||||||
|
"options": { "reduceOptions": { "calcs": ["lastNotNull"], "fields": "/.*/" }, "colorMode": "value", "graphMode": "none" },
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"query": "from(bucket: \"${bucket}\")\n |> range(start: -30d)\n |> filter(fn:(r) => r._measurement==\"${measurement}\" and (r._field==\"mode\" or r._field==\"maxDeltaP\"))\n |> last()",
|
"query": "from(bucket: \"${bucket}\")\n |> range(start: -30d)\n |> filter(fn:(r) => r._measurement==\"${measurement}\" and (r._field==\"mode\" or r._field==\"maxDeltaP\"))\n |> last()",
|
||||||
|
|||||||
Reference in New Issue
Block a user