First test kinda working

This commit is contained in:
Valère Plantevin
2026-05-12 11:21:40 -04:00
parent cac6c9ac02
commit d3f09ee062
36 changed files with 3903 additions and 102 deletions

272
dashboards/sensors.json Normal file
View File

@@ -0,0 +1,272 @@
{
"title": "quic_ecs_dt — sensors",
"uid": "quic-ecs-dt-sensors",
"schemaVersion": 39,
"version": 1,
"timezone": "",
"refresh": "1s",
"time": { "from": "now-5m", "to": "now" },
"tags": ["quic_ecs_dt", "ucami2026", "sensors"],
"templating": {
"list": [
{
"name": "datasource",
"label": "Data source",
"type": "datasource",
"query": "prometheus",
"current": { "selected": false, "text": "Prometheus", "value": "Prometheus" },
"hide": 0
}
]
},
"panels": [
{
"id": 1,
"title": "Temperature — mean (thermometer)",
"type": "gauge",
"gridPos": { "h": 8, "w": 6, "x": 0, "y": 0 },
"datasource": { "type": "prometheus", "uid": "${datasource}" },
"options": {
"showThresholdLabels": false,
"showThresholdMarkers": true,
"orientation": "vertical"
},
"fieldConfig": {
"defaults": {
"unit": "celsius",
"decimals": 1,
"min": -20,
"max": 80,
"thresholds": {
"mode": "absolute",
"steps": [
{ "color": "blue", "value": null },
{ "color": "green", "value": 10 },
{ "color": "yellow", "value": 30 },
{ "color": "orange", "value": 50 },
{ "color": "red", "value": 70 }
]
}
}
},
"targets": [
{
"expr": "sensor_aggregate{type=\"temperature\", stat=\"mean\"}",
"refId": "A",
"legendFormat": "T mean"
}
]
},
{
"id": 2,
"title": "Humidity — mean",
"type": "gauge",
"gridPos": { "h": 8, "w": 6, "x": 6, "y": 0 },
"datasource": { "type": "prometheus", "uid": "${datasource}" },
"options": { "showThresholdMarkers": true, "orientation": "vertical" },
"fieldConfig": {
"defaults": {
"unit": "percent",
"decimals": 1,
"min": 0,
"max": 100,
"thresholds": {
"mode": "absolute",
"steps": [
{ "color": "orange", "value": null },
{ "color": "green", "value": 30 },
{ "color": "blue", "value": 70 }
]
}
}
},
"targets": [
{
"expr": "sensor_aggregate{type=\"humidity\", stat=\"mean\"}",
"refId": "A",
"legendFormat": "RH mean"
}
]
},
{
"id": 3,
"title": "Pressure — mean",
"type": "stat",
"gridPos": { "h": 8, "w": 6, "x": 12, "y": 0 },
"datasource": { "type": "prometheus", "uid": "${datasource}" },
"options": { "graphMode": "area", "colorMode": "value" },
"fieldConfig": {
"defaults": {
"unit": "pressurehpa",
"decimals": 1,
"min": 980,
"max": 1040,
"thresholds": {
"mode": "absolute",
"steps": [
{ "color": "blue", "value": null },
{ "color": "green", "value": 1000 },
{ "color": "yellow", "value": 1025 }
]
}
}
},
"targets": [
{
"expr": "sensor_aggregate{type=\"pressure\", stat=\"mean\"}",
"refId": "A",
"legendFormat": "P mean"
}
]
},
{
"id": 4,
"title": "Voltage — mean",
"type": "stat",
"gridPos": { "h": 8, "w": 6, "x": 18, "y": 0 },
"datasource": { "type": "prometheus", "uid": "${datasource}" },
"options": { "graphMode": "area", "colorMode": "value" },
"fieldConfig": {
"defaults": {
"unit": "volt",
"decimals": 2,
"min": 220,
"max": 240,
"thresholds": {
"mode": "absolute",
"steps": [
{ "color": "yellow", "value": null },
{ "color": "green", "value": 225 },
{ "color": "yellow", "value": 235 }
]
}
}
},
"targets": [
{
"expr": "sensor_aggregate{type=\"voltage\", stat=\"mean\"}",
"refId": "A",
"legendFormat": "V mean"
}
]
},
{
"id": 5,
"title": "Current — mean",
"type": "stat",
"gridPos": { "h": 8, "w": 6, "x": 0, "y": 8 },
"datasource": { "type": "prometheus", "uid": "${datasource}" },
"options": { "graphMode": "area", "colorMode": "value" },
"fieldConfig": {
"defaults": {
"unit": "amp",
"decimals": 2,
"min": 0,
"max": 30,
"thresholds": {
"mode": "absolute",
"steps": [
{ "color": "green", "value": null },
{ "color": "yellow", "value": 20 },
{ "color": "red", "value": 25 }
]
}
}
},
"targets": [
{
"expr": "sensor_aggregate{type=\"current\", stat=\"mean\"}",
"refId": "A",
"legendFormat": "I mean"
}
]
},
{
"id": 6,
"title": "Sensor count by type",
"type": "stat",
"gridPos": { "h": 8, "w": 6, "x": 6, "y": 8 },
"datasource": { "type": "prometheus", "uid": "${datasource}" },
"fieldConfig": { "defaults": { "unit": "short" } },
"options": { "colorMode": "value", "graphMode": "none" },
"targets": [
{
"expr": "sensor_aggregate{stat=\"count\"}",
"refId": "A",
"legendFormat": "{{type}}"
}
]
},
{
"id": 7,
"title": "Temperature — min / mean / max over time",
"type": "timeseries",
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 8 },
"datasource": { "type": "prometheus", "uid": "${datasource}" },
"fieldConfig": { "defaults": { "unit": "celsius", "decimals": 1 } },
"targets": [
{
"expr": "sensor_aggregate{type=\"temperature\", stat=\"min\"}",
"refId": "A",
"legendFormat": "min"
},
{
"expr": "sensor_aggregate{type=\"temperature\", stat=\"mean\"}",
"refId": "B",
"legendFormat": "mean"
},
{
"expr": "sensor_aggregate{type=\"temperature\", stat=\"max\"}",
"refId": "C",
"legendFormat": "max"
}
]
},
{
"id": 8,
"title": "All sensor types — mean over time",
"type": "timeseries",
"gridPos": { "h": 8, "w": 24, "x": 0, "y": 16 },
"datasource": { "type": "prometheus", "uid": "${datasource}" },
"fieldConfig": { "defaults": { "unit": "short", "decimals": 2 } },
"targets": [
{
"expr": "sensor_aggregate{stat=\"mean\"}",
"refId": "A",
"legendFormat": "{{type}}"
}
]
},
{
"id": 9,
"title": "Threshold crossings (cumulative) — per type / direction",
"description": "Each time a sensor's smoothed mean crosses its per-type threshold, simulation_system increments the counter. up = rising through threshold; down = falling through. The counter being non-zero is the load-bearing evidence that the ECS runs the digital-twin transform — not just write-through ingest.",
"type": "timeseries",
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 24 },
"datasource": { "type": "prometheus", "uid": "${datasource}" },
"fieldConfig": { "defaults": { "unit": "short" } },
"targets": [
{
"expr": "substrate_threshold_crossings_total",
"refId": "A",
"legendFormat": "{{type}} {{direction}}"
}
]
},
{
"id": 10,
"title": "Threshold crossings — rate (events/min)",
"type": "timeseries",
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 24 },
"datasource": { "type": "prometheus", "uid": "${datasource}" },
"fieldConfig": { "defaults": { "unit": "cpm" } },
"targets": [
{
"expr": "60 * rate(substrate_threshold_crossings_total[1m])",
"refId": "A",
"legendFormat": "{{type}} {{direction}}"
}
]
}
]
}