Fix TrueNAS dashboard queries for native metrics

This commit is contained in:
gbanyan
2026-02-15 11:25:37 +08:00
parent eb114a8ae4
commit 80a236bed5
2 changed files with 54 additions and 49 deletions

View File

@@ -16,7 +16,7 @@
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations \u0026 Alerts",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
@@ -178,7 +178,8 @@
"id": 280,
"panels": [],
"title": "Disk Utilization",
"type": "row"
"type": "row",
"targets": []
},
{
"datasource": {
@@ -243,7 +244,7 @@
"uid": "ff1qkncht70n4c"
},
"editorMode": "code",
"expr": "disk_utilization{instance=~\"$instance\"}",
"expr": "disk_busy{instance=~\"$instance\"}",
"instant": false,
"legendFormat": "{{disk}}",
"range": true,
@@ -345,7 +346,7 @@
"uid": "ff1qkncht70n4c"
},
"editorMode": "code",
"expr": "disk_utilization{instance=~\"$instance\"}",
"expr": "disk_busy{instance=~\"$instance\"}",
"instant": false,
"legendFormat": "{{disk}}",
"range": true,
@@ -366,7 +367,8 @@
"id": 255,
"panels": [],
"title": "Disk I/O",
"type": "row"
"type": "row",
"targets": []
},
{
"datasource": {
@@ -565,7 +567,7 @@
"uid": "ff1qkncht70n4c"
},
"editorMode": "code",
"expr": "abs(disk_iotime{instance=~\"$instance\", disk=~\"$disk\"})",
"expr": "abs(disk_busy{instance=~\"$instance\", disk=~\"$disk\"})",
"instant": false,
"legendFormat": "{{op}}",
"range": true,
@@ -689,7 +691,8 @@
"id": 296,
"panels": [],
"title": "Disk Other",
"type": "row"
"type": "row",
"targets": []
},
{
"datasource": {
@@ -784,7 +787,7 @@
"uid": "ff1qkncht70n4c"
},
"editorMode": "code",
"expr": "abs(disk_await{instance=~\"$instance\", disk=~\"$disk\"})",
"expr": "(1000 * disk_busy{instance=~\"$instance\", disk=~\"$disk\"}) / clamp_min(sum by (disk) (disk_io_ops{instance=~\"$instance\", disk=~\"$disk\"}), 0.001)",
"instant": false,
"legendFormat": "{{op}}",
"range": true,
@@ -887,7 +890,7 @@
"uid": "ff1qkncht70n4c"
},
"editorMode": "code",
"expr": "disk_io_backlog{instance=~\"$instance\", disk=~\"$disk\"}",
"expr": "0 * disk_busy{instance=~\"$instance\", disk=~\"$disk\"}",
"instant": false,
"legendFormat": "backlog",
"range": true,
@@ -1003,7 +1006,7 @@
"uid": "ff1qkncht70n4c"
},
"editorMode": "code",
"expr": "disk_qops{instance=~\"$instance\", disk=~\"$disk\"}",
"expr": "sum by (disk) (disk_io_ops{instance=~\"$instance\", disk=~\"$disk\"})",
"instant": false,
"legendFormat": "value",
"range": true,
@@ -1106,7 +1109,7 @@
"uid": "ff1qkncht70n4c"
},
"editorMode": "code",
"expr": "abs(disk_io_size{instance=~\"$instance\", disk=~\"$disk\"})",
"expr": "(1024 * sum by (disk) (disk_io{instance=~\"$instance\", disk=~\"$disk\"})) / clamp_min(sum by (disk) (disk_io_ops{instance=~\"$instance\", disk=~\"$disk\"}), 0.001)",
"instant": false,
"legendFormat": "{{op}}",
"range": true,
@@ -1206,4 +1209,4 @@
"title": "TrueNAS Scale - Disk Insight",
"weekStart": ""
}
}
}

View File

@@ -16,7 +16,7 @@
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations \u0026 Alerts",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
@@ -181,7 +181,7 @@
}
]
},
"unit": "rotmhz"
"unit": "celsius"
},
"overrides": []
},
@@ -212,14 +212,14 @@
"uid": "ff1qkncht70n4c"
},
"editorMode": "code",
"expr": "cpu_frequency{instance=~\"$instance\", cpu=~\"$cpu\"}",
"expr": "cpu_temperature{instance=~\"$instance\", cpu=~\"$cpu\"}",
"instant": false,
"legendFormat": "{{cpu}}",
"range": true,
"refId": "A"
}
],
"title": "CPU frequency",
"title": "CPU temperature",
"type": "timeseries"
},
{
@@ -338,7 +338,7 @@
}
},
"mappings": [],
"unit": "mbytes"
"unit": "bytes"
},
"overrides": []
},
@@ -381,11 +381,23 @@
"uid": "ff1qkncht70n4c"
},
"editorMode": "code",
"expr": "physical_memory{instance=~\"$instance\"}",
"instant": false,
"legendFormat": "{{kind}}",
"range": true,
"expr": "(truenas_truenas_truenas_meminfo_total_total{instance=~\"$instance\"} - truenas_truenas_truenas_meminfo_available_available{instance=~\"$instance\"})",
"instant": true,
"legendFormat": "used",
"range": false,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "ff1qkncht70n4c"
},
"editorMode": "code",
"expr": "truenas_truenas_truenas_meminfo_available_available{instance=~\"$instance\"}",
"instant": true,
"legendFormat": "available",
"range": false,
"refId": "B"
}
],
"title": "Memory usage",
@@ -613,29 +625,19 @@
"fieldMinMax": false,
"mappings": [
{
"type": "value",
"options": {
"degraded": {
"color": "orange",
"0": {
"text": "down",
"color": "red",
"index": 0
},
"faulted": {
"color": "semi-dark-orange",
"1": {
"text": "up",
"color": "green",
"index": 1
},
"offline": {
"color": "text",
"index": 2
},
"removed": {
"color": "purple",
"index": 3
},
"unavail": {
"color": "red",
"index": 4
}
},
"type": "value"
}
}
],
"thresholds": {
@@ -681,15 +683,15 @@
"uid": "ff1qkncht70n4c"
},
"editorMode": "code",
"expr": "zfs_pool{instance=~\"$instance\"} \u003e 0",
"expr": "up{job=\"TrueNas\",instance=~\"$instance\"}",
"format": "table",
"instant": false,
"legendFormat": "{{pool}}",
"legendFormat": "{{instance}}",
"range": true,
"refId": "A"
}
],
"title": "Pool State",
"title": "TrueNAS Exporter State",
"transformations": [
{
"id": "groupingToMatrix",
@@ -1375,7 +1377,7 @@
"refId": "B"
}
],
"title": "Interrupts \u0026 Context switches",
"title": "Interrupts & Context switches",
"type": "timeseries"
}
],
@@ -2124,7 +2126,7 @@
},
"editorMode": "code",
"exemplar": false,
"expr": "interface_duplex{instance=~\"$instance\", interface=~\"$interface\"} \u003e 0",
"expr": "interface_duplex{instance=~\"$instance\", interface=~\"$interface\"} > 0",
"format": "time_series",
"instant": false,
"legendFormat": "{{interface}} - {{state}}",
@@ -2223,7 +2225,7 @@
},
"editorMode": "code",
"exemplar": false,
"expr": "interface_operationstate{instance=~\"$instance\", interface=~\"$interface\"} \u003e 0",
"expr": "interface_operationstate{instance=~\"$instance\", interface=~\"$interface\"} > 0",
"format": "time_series",
"instant": false,
"legendFormat": "{{interface}} - {{state}}",
@@ -2322,7 +2324,7 @@
},
"editorMode": "code",
"exemplar": false,
"expr": "interface_carrierstate{instance=~\"$instance\", interface=~\"$interface\"} \u003e 0",
"expr": "interface_carrierstate{instance=~\"$instance\", interface=~\"$interface\"} > 0",
"format": "time_series",
"instant": false,
"legendFormat": "{{interface}} - {{state}}",
@@ -2421,7 +2423,7 @@
},
"editorMode": "code",
"exemplar": false,
"expr": "interface_mtu{instance=~\"$instance\", interface=~\"$interface\"} \u003e 0",
"expr": "interface_mtu{instance=~\"$instance\", interface=~\"$interface\"} > 0",
"format": "time_series",
"instant": false,
"legendFormat": "{{interface}}",
@@ -2634,7 +2636,7 @@
"refId": "B"
}
],
"title": "Network errors \u0026 drops",
"title": "Network errors & drops",
"type": "timeseries"
}
],
@@ -6033,4 +6035,4 @@
"title": "TrueNAS Scale / Overview",
"weekStart": ""
}
}
}