Merge pull request #67 from tcivie/dashboard-update

dashboard-update
This commit is contained in:
Gleb Tcivie 2024-10-22 21:38:04 +03:00 committed by GitHub
commit e73837ac6b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 878 additions and 348 deletions

View file

@ -305,7 +305,7 @@
}
]
},
"pluginVersion": "11.1.0",
"pluginVersion": "11.2.2+security-01",
"targets": [
{
"datasource": {
@ -348,8 +348,8 @@
"uid": "P1809F7CD0C75ACF3"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "sum by(portnum, source_id) (mesh_packet_destination_types_total)",
"editorMode": "code",
"expr": "sum by(source_id, portnum) (\n mesh_packet_source_types_total\nand\n(mesh_packet_source_types_total - mesh_packet_source_types_total offset $__range) != 0\n)",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": false,
@ -357,6 +357,35 @@
"range": true,
"refId": "Packet Types",
"useBackend": false
},
{
"datasource": {
"type": "grafana-postgresql-datasource",
"uid": "PA942B37CCFAF5A81"
},
"editorMode": "code",
"format": "table",
"hide": false,
"rawQuery": true,
"rawSql": "SELECT\n node_id,\n CASE\n WHEN EXTRACT(EPOCH FROM environment_update_interval) > 1\n THEN to_char(environment_update_interval, 'HH24:MI:SS')\n ELSE NULL\n END AS environment_update_interval,\n CASE\n WHEN EXTRACT(EPOCH FROM device_update_interval) > 1\n THEN to_char(device_update_interval, 'HH24:MI:SS')\n ELSE NULL\n END AS device_update_interval,\n CASE\n WHEN EXTRACT(EPOCH FROM air_quality_update_interval) > 1\n THEN to_char(air_quality_update_interval, 'HH24:MI:SS')\n ELSE NULL\n END AS air_quality_update_interval,\n CASE\n WHEN EXTRACT(EPOCH FROM power_update_interval) > 1\n THEN to_char(power_update_interval, 'HH24:MI:SS')\n ELSE NULL\n END AS power_update_interval,\n CASE\n WHEN EXTRACT(EPOCH FROM range_test_interval) > 1\n THEN to_char(range_test_interval, 'HH24:MI:SS')\n ELSE NULL\n END AS range_test_interval,\n CASE\n WHEN EXTRACT(EPOCH FROM pax_counter_interval) > 1\n THEN to_char(pax_counter_interval, 'HH24:MI:SS')\n ELSE NULL\n END AS pax_counter_interval,\n CASE\n WHEN EXTRACT(EPOCH FROM neighbor_info_interval) > 1\n THEN to_char(neighbor_info_interval, 'HH24:MI:SS')\n ELSE NULL\n END AS neighbor_info_interval,\n CASE\n WHEN EXTRACT(EPOCH FROM map_broadcast_interval) > 1\n THEN to_char(map_broadcast_interval, 'HH24:MI:SS')\n ELSE NULL\n END AS map_broadcast_interval,\n mqtt_encryption_enabled,\n mqtt_json_enabled,\n mqtt_configured_root_topic,\n last_updated\nFROM node_configurations\nWHERE\n EXTRACT(EPOCH FROM environment_update_interval) > 1 OR\n EXTRACT(EPOCH FROM device_update_interval) > 1 OR\n EXTRACT(EPOCH FROM air_quality_update_interval) > 1 OR\n EXTRACT(EPOCH FROM power_update_interval) > 1 OR\n EXTRACT(EPOCH FROM range_test_interval) > 1 OR\n EXTRACT(EPOCH FROM pax_counter_interval) > 1 OR\n EXTRACT(EPOCH FROM neighbor_info_interval) > 1 OR\n EXTRACT(EPOCH FROM map_broadcast_interval) > 1",
"refId": "A",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
}
],
"title": "General Information",
@ -419,6 +448,6 @@
"timezone": "browser",
"title": "Investigation Board",
"uid": "adrqynul4j3eoa",
"version": 17,
"version": 29,
"weekStart": ""
}

View file

@ -96,7 +96,7 @@
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "11.1.0",
"pluginVersion": "11.2.2+security-01",
"targets": [
{
"datasource": {
@ -159,8 +159,8 @@
},
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
"type": "grafana-postgresql-datasource",
"uid": "PA942B37CCFAF5A81"
},
"description": "Nodes that sent any packet in the last 30 minutes",
"fieldConfig": {
@ -177,7 +177,8 @@
"value": null
}
]
}
},
"unit": "nodes"
},
"overrides": []
},
@ -201,27 +202,73 @@
"fields": "",
"values": false
},
"showPercentChange": true,
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "11.1.0",
"pluginVersion": "11.2.2+security-01",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
"type": "grafana-postgresql-datasource",
"uid": "PA942B37CCFAF5A81"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "sum(count by(source_id) (count by(source_id) (delta(mesh_packet_ids_created{source_id=~\"$Nodes\"}[30m]))))",
"fullMetaSearch": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "{{source_long_name}}",
"range": true,
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT COUNT(*) \nFROM node_details \nWHERE updated_at >= NOW() - INTERVAL '30 minutes';",
"refId": "A",
"useBackend": false
"sql": {
"columns": [
{
"parameters": [
{
"name": "*",
"type": "functionParameter"
}
],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50,
"whereJsonTree": {
"children1": [
{
"id": "ab889ba9-4567-489a-bcde-f192911a31e3",
"properties": {
"field": "updated_at",
"fieldSrc": "field",
"operator": "greater",
"value": [
"Invalid date"
],
"valueError": [
null
],
"valueSrc": [
"value"
],
"valueType": [
"datetime"
]
},
"type": "rule"
}
],
"id": "a8b9a88a-0123-4456-b89a-b19291157437",
"type": "group"
},
"whereString": "updated_at > NULL"
},
"table": "node_details"
}
],
"title": "Active nodes in the last 30 minutes",
@ -293,7 +340,7 @@
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "11.1.0",
"pluginVersion": "11.2.2+security-01",
"targets": [
{
"datasource": {
@ -337,7 +384,7 @@
},
{
"datasource": {
"type": "postgres",
"type": "grafana-postgresql-datasource",
"uid": "PA942B37CCFAF5A81"
},
"description": "Status of nodes in the MQTT server",
@ -405,7 +452,7 @@
"textMode": "value_and_name",
"wideLayout": true
},
"pluginVersion": "11.1.0",
"pluginVersion": "11.2.2+security-01",
"targets": [
{
"datasource": {
@ -414,7 +461,7 @@
},
"editorMode": "builder",
"format": "table",
"rawSql": "SELECT COUNT(mqtt_status), mqtt_status FROM node_details WHERE (COALESCE(mqtt_status, '') <> '' AND mqtt_status NOT LIKE '%none%') GROUP BY mqtt_status LIMIT 50 ",
"rawSql": "SELECT COUNT(mqtt_status), mqtt_status FROM node_details WHERE (COALESCE(mqtt_status, '') <> '' AND mqtt_status NOT LIKE '%none%' AND mqtt_status NOT LIKE '%Unknown%') GROUP BY mqtt_status LIMIT 50 ",
"refId": "A",
"sql": {
"columns": [
@ -482,6 +529,27 @@
]
},
"type": "rule"
},
{
"id": "ab89aa99-0123-4456-b89a-b191382ca762",
"properties": {
"field": "mqtt_status",
"fieldSrc": "field",
"operator": "not_like",
"value": [
"Unknown"
],
"valueError": [
null
],
"valueSrc": [
"value"
],
"valueType": [
"text"
]
},
"type": "rule"
}
],
"id": "babb9899-0123-4456-b89a-b19079f5bfed",
@ -490,7 +558,7 @@
},
"type": "group"
},
"whereString": "(COALESCE(mqtt_status, '') <> '' AND mqtt_status NOT LIKE '%none%')"
"whereString": "(COALESCE(mqtt_status, '') <> '' AND mqtt_status NOT LIKE '%none%' AND mqtt_status NOT LIKE '%Unknown%')"
},
"table": "node_details"
}
@ -552,7 +620,7 @@
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "11.1.0",
"pluginVersion": "11.2.2+security-01",
"targets": [
{
"datasource": {
@ -622,7 +690,7 @@
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "11.1.0",
"pluginVersion": "11.2.2+security-01",
"targets": [
{
"datasource": {
@ -645,124 +713,13 @@
"title": "Data sent on mesh in last hour",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
},
"description": "Displays the nodes that utilize most of the channel (On average with at least 1 update every hour)",
"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": "dashed+area"
}
},
"mappings": [],
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "yellow",
"value": 8.5
},
{
"color": "red",
"value": 10
}
]
},
"unit": "percent"
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 11,
"x": 0,
"y": 4
},
"id": 26,
"options": {
"legend": {
"calcs": [
"lastNotNull"
],
"displayMode": "table",
"placement": "right",
"showLegend": true,
"sortBy": "Last *",
"sortDesc": true
},
"tooltip": {
"mode": "multi",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
},
"disableTextWrap": false,
"editorMode": "code",
"exemplar": false,
"expr": "topk(3,\n avg by (node_id, short_name, long_name) (\n avg_over_time(telemetry_app_channel_utilization{node_id=~\"$Nodes\"}[$__range]) > 0\n and\n timestamp(telemetry_app_channel_utilization{node_id=~\"$Nodes\"}) > time() - 3600\n )\n)",
"fullMetaSearch": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "{{short_name}}:{{long_name}}",
"range": true,
"refId": "A",
"useBackend": false
}
],
"title": "Top channel utilizers",
"type": "timeseries"
},
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 13
"y": 4
},
"id": 25,
"panels": [],
@ -775,7 +732,7 @@
"h": 1,
"w": 24,
"x": 0,
"y": 14
"y": 5
},
"id": 16,
"panels": [],
@ -801,8 +758,9 @@
"axisLabel": "",
"axisPlacement": "auto",
"axisSoftMax": 11,
"axisSoftMin": 7,
"axisSoftMin": 3,
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
@ -859,7 +817,7 @@
"h": 9,
"w": 11,
"x": 0,
"y": 15
"y": 6
},
"id": 23,
"options": {
@ -919,6 +877,7 @@
"axisPlacement": "auto",
"axisSoftMax": 10,
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "points",
"fillOpacity": 0,
"gradientMode": "none",
@ -971,7 +930,7 @@
"h": 9,
"w": 13,
"x": 11,
"y": 15
"y": 6
},
"id": 3,
"options": {
@ -1014,6 +973,282 @@
"title": "Duty Cycle (AirUtilTX)",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
},
"description": "Displays the nodes that utilize most of the channel (On average with at least 1 update every hour)",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"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": "dashed+area"
}
},
"mappings": [],
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "yellow",
"value": 8.5
},
{
"color": "red",
"value": 10
}
]
},
"unit": "percent"
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 11,
"x": 0,
"y": 15
},
"id": 26,
"options": {
"legend": {
"calcs": [
"lastNotNull"
],
"displayMode": "table",
"placement": "right",
"showLegend": true,
"sortBy": "Last *",
"sortDesc": true
},
"tooltip": {
"mode": "multi",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
},
"disableTextWrap": false,
"editorMode": "code",
"exemplar": false,
"expr": "topk(3,\n avg by (node_id, short_name, long_name) (\n avg_over_time(telemetry_app_channel_utilization{node_id=~\"$Nodes\"}[$__range]) > 0\n and\n timestamp(telemetry_app_channel_utilization{node_id=~\"$Nodes\"}) > time() - 3600\n and\n changes(telemetry_app_channel_utilization{node_id=~\"$Nodes\"}[3h]) > 0\n )\n)",
"fullMetaSearch": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "{{short_name}}:{{long_name}}",
"range": true,
"refId": "A",
"useBackend": false
}
],
"title": "Top channel utilizers",
"type": "timeseries"
},
{
"datasource": {
"type": "datasource",
"uid": "-- Mixed --"
},
"description": "Displays types of packets in the selected time range.\n\nFor more details see:\nhttps://buf.build/meshtastic/protobufs/docs/main:meshtastic#meshtastic.PortNum",
"fieldConfig": {
"defaults": {
"color": {
"fixedColor": "green",
"mode": "palette-classic"
},
"custom": {
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
}
},
"fieldMinMax": false,
"mappings": [],
"unit": "Packets"
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 4,
"x": 11,
"y": 15
},
"id": 5,
"options": {
"displayLabels": [
"name",
"percent"
],
"legend": {
"displayMode": "list",
"placement": "right",
"showLegend": false
},
"pieType": "donut",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "11.1.0",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "sum by(portnum) (mesh_packet_source_types_total{source_id=~\"$Nodes\"})",
"fullMetaSearch": false,
"includeNullMetadata": true,
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false
}
],
"title": "Packet types for selected time",
"type": "piechart"
},
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
},
"description": "How many hops are configured for each client",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"fieldMinMax": false,
"mappings": [],
"max": 7,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "#EAB839",
"value": 4
},
{
"color": "semi-dark-orange",
"value": 5
},
{
"color": "red",
"value": 6
},
{
"color": "dark-red",
"value": 7
}
]
},
"unit": "hops"
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 9,
"x": 15,
"y": 15
},
"id": 9,
"options": {
"minVizHeight": 75,
"minVizWidth": 75,
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showThresholdLabels": false,
"showThresholdMarkers": true,
"sizing": "auto"
},
"pluginVersion": "11.2.2+security-01",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
},
"disableTextWrap": false,
"editorMode": "code",
"expr": "max(\n mesh_packet_hop_start{source_id=~\"$Nodes\"}\n and\n (delta(mesh_packet_hop_start{source_id=~\"$Nodes\"}[1m]) != 0)\n) by (source_id, source_long_name)",
"fullMetaSearch": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "{{source_long_name}}",
"range": true,
"refId": "A",
"useBackend": false
}
],
"title": "The configured max hops for each client",
"type": "gauge"
},
{
"datasource": {
"type": "grafana-postgresql-datasource",
@ -1021,7 +1256,7 @@
},
"description": "Graph that is built from Neighbor Info reports and shows the signal strenth for each line",
"gridPos": {
"h": 32,
"h": 22,
"w": 11,
"x": 0,
"y": 24
@ -1191,169 +1426,6 @@
"title": "Node Graph",
"type": "nodeGraph"
},
{
"datasource": {
"type": "datasource",
"uid": "-- Mixed --"
},
"description": "Displays types of packets in the selected time range.\n\nFor more details see:\nhttps://buf.build/meshtastic/protobufs/docs/main:meshtastic#meshtastic.PortNum",
"fieldConfig": {
"defaults": {
"color": {
"fixedColor": "green",
"mode": "palette-classic"
},
"custom": {
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
}
},
"fieldMinMax": false,
"mappings": [],
"unit": "Packets"
},
"overrides": []
},
"gridPos": {
"h": 10,
"w": 5,
"x": 11,
"y": 24
},
"id": 5,
"options": {
"displayLabels": [
"name",
"percent"
],
"legend": {
"displayMode": "list",
"placement": "right",
"showLegend": false
},
"pieType": "donut",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "11.1.0",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "sum by(portnum) (mesh_packet_source_types_total{source_id=~\"$Nodes\"})",
"fullMetaSearch": false,
"includeNullMetadata": true,
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false
}
],
"title": "Packet types for selected time",
"type": "piechart"
},
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
},
"description": "How many hops are configured for each client",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"fieldMinMax": false,
"mappings": [],
"max": 7,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "#EAB839",
"value": 4
},
{
"color": "semi-dark-orange",
"value": 5
},
{
"color": "red",
"value": 6
},
{
"color": "dark-red",
"value": 7
}
]
},
"unit": "hops"
},
"overrides": []
},
"gridPos": {
"h": 10,
"w": 8,
"x": 16,
"y": 24
},
"id": 9,
"options": {
"minVizHeight": 75,
"minVizWidth": 75,
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showThresholdLabels": false,
"showThresholdMarkers": true,
"sizing": "auto"
},
"pluginVersion": "11.1.0",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
},
"disableTextWrap": false,
"editorMode": "code",
"expr": "max(\n mesh_packet_hop_start{source_id=~\"$Nodes\"}\n and\n (delta(mesh_packet_hop_start{source_id=~\"$Nodes\"}[1m]) != 0)\n) by (source_id, source_long_name)",
"fullMetaSearch": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "{{source_long_name}}",
"range": true,
"refId": "A",
"useBackend": false
}
],
"title": "The configured max hops for each client",
"type": "gauge"
},
{
"datasource": {
"type": "grafana-postgresql-datasource",
@ -1411,7 +1483,8 @@
"mode": "absolute",
"steps": [
{
"color": "text"
"color": "text",
"value": null
}
]
}
@ -1429,7 +1502,7 @@
{
"targetBlank": true,
"title": "Go to node dashboard",
"url": "http://grafana.mesh-il.com:3000/d/edqo1uh0eglq8g/node-dashboard?orgId=1&var-nodeID=${__data.fields[0]}"
"url": "http://localhost:3000/d/edqo1uh0eglq8g/node-dashboard?orgId=1&var-nodeID=${__data.fields[0]}"
}
]
},
@ -1496,7 +1569,7 @@
"h": 22,
"w": 13,
"x": 11,
"y": 34
"y": 24
},
"id": 14,
"options": {
@ -1514,12 +1587,12 @@
"showHeader": true,
"sortBy": [
{
"desc": false,
"displayName": "Long name"
"desc": true,
"displayName": "Last Updated At"
}
]
},
"pluginVersion": "11.1.0",
"pluginVersion": "11.2.2+security-01",
"targets": [
{
"datasource": {
@ -1726,7 +1799,7 @@
"h": 25,
"w": 24,
"x": 0,
"y": 56
"y": 46
},
"id": 8,
"options": {
@ -1984,6 +2057,6 @@
"timezone": "browser",
"title": "Main Dashboard",
"uid": "edqkge9mf7v28g",
"version": 66,
"version": 78,
"weekStart": "sunday"
}

View file

@ -75,7 +75,7 @@
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "11.1.0",
"pluginVersion": "11.2.2+security-01",
"targets": [
{
"datasource": {
@ -124,7 +124,7 @@
},
"gridPos": {
"h": 4,
"w": 13,
"w": 14,
"x": 5,
"y": 0
},
@ -146,7 +146,7 @@
"textMode": "value_and_name",
"wideLayout": true
},
"pluginVersion": "11.1.0",
"pluginVersion": "11.2.2+security-01",
"targets": [
{
"datasource": {
@ -195,8 +195,8 @@
},
"gridPos": {
"h": 4,
"w": 6,
"x": 18,
"w": 5,
"x": 19,
"y": 0
},
"id": 12,
@ -217,7 +217,7 @@
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "11.1.0",
"pluginVersion": "11.2.2+security-01",
"targets": [
{
"datasource": {
@ -289,7 +289,7 @@
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "11.1.0",
"pluginVersion": "11.2.2+security-01",
"targets": [
{
"datasource": {
@ -338,7 +338,7 @@
},
"gridPos": {
"h": 4,
"w": 13,
"w": 14,
"x": 5,
"y": 4
},
@ -360,7 +360,7 @@
"textMode": "value_and_name",
"wideLayout": true
},
"pluginVersion": "11.1.0",
"pluginVersion": "11.2.2+security-01",
"targets": [
{
"datasource": {
@ -409,8 +409,8 @@
},
"gridPos": {
"h": 4,
"w": 6,
"x": 18,
"w": 5,
"x": 19,
"y": 4
},
"id": 16,
@ -431,7 +431,7 @@
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "11.1.0",
"pluginVersion": "11.2.2+security-01",
"targets": [
{
"datasource": {
@ -462,7 +462,8 @@
"custom": {
"align": "center",
"cellOptions": {
"type": "auto"
"type": "auto",
"wrapText": false
},
"inspect": true
},
@ -556,7 +557,7 @@
},
"showHeader": true
},
"pluginVersion": "11.1.0",
"pluginVersion": "11.2.2+security-01",
"targets": [
{
"datasource": {
@ -861,7 +862,7 @@
},
"gridPos": {
"h": 5,
"w": 16,
"w": 9,
"x": 8,
"y": 12
},
@ -920,6 +921,169 @@
],
"type": "state-timeline"
},
{
"datasource": {
"type": "grafana-postgresql-datasource",
"uid": "PA942B37CCFAF5A81"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "left",
"cellOptions": {
"type": "auto",
"wrapText": false
},
"filterable": true,
"inspect": false
},
"fieldMinMax": false,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 15,
"w": 7,
"x": 17,
"y": 12
},
"id": 17,
"options": {
"cellHeight": "sm",
"footer": {
"countRows": false,
"fields": "",
"reducer": [
"sum"
],
"show": false
},
"showHeader": true
},
"pluginVersion": "11.2.2+security-01",
"targets": [
{
"datasource": {
"type": "grafana-postgresql-datasource",
"uid": "PA942B37CCFAF5A81"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT\n node_id,\n CASE\n WHEN EXTRACT(EPOCH FROM environment_update_interval) > 1\n THEN to_char(environment_update_interval, 'HH24:MI:SS')\n ELSE NULL\n END AS environment_update_interval,\n to_char(environment_update_last_timestamp, 'YYYY-MM-DD HH24:MI:SS') AS environment_update_last_timestamp,\n \n CASE\n WHEN EXTRACT(EPOCH FROM device_update_interval) > 1\n THEN to_char(device_update_interval, 'HH24:MI:SS')\n ELSE NULL\n END AS device_update_interval,\n to_char(device_update_last_timestamp, 'YYYY-MM-DD HH24:MI:SS') AS device_update_last_timestamp,\n \n CASE\n WHEN EXTRACT(EPOCH FROM air_quality_update_interval) > 1\n THEN to_char(air_quality_update_interval, 'HH24:MI:SS')\n ELSE NULL\n END AS air_quality_update_interval,\n to_char(air_quality_update_last_timestamp, 'YYYY-MM-DD HH24:MI:SS') AS air_quality_update_last_timestamp,\n \n CASE\n WHEN EXTRACT(EPOCH FROM power_update_interval) > 1\n THEN to_char(power_update_interval, 'HH24:MI:SS')\n ELSE NULL\n END AS power_update_interval,\n to_char(power_update_last_timestamp, 'YYYY-MM-DD HH24:MI:SS') AS power_update_last_timestamp,\n \n CASE\n WHEN EXTRACT(EPOCH FROM range_test_interval) > 1\n THEN to_char(range_test_interval, 'HH24:MI:SS')\n ELSE NULL\n END AS range_test_interval,\n to_char(range_test_last_packet_timestamp, 'YYYY-MM-DD HH24:MI:SS') AS range_test_last_packet_timestamp,\n \n CASE\n WHEN EXTRACT(EPOCH FROM pax_counter_interval) > 1\n THEN to_char(pax_counter_interval, 'HH24:MI:SS')\n ELSE NULL\n END AS pax_counter_interval,\n to_char(pax_counter_last_timestamp, 'YYYY-MM-DD HH24:MI:SS') AS pax_counter_last_timestamp,\n \n CASE\n WHEN EXTRACT(EPOCH FROM neighbor_info_interval) > 1\n THEN to_char(neighbor_info_interval, 'HH24:MI:SS')\n ELSE NULL\n END AS neighbor_info_interval,\n to_char(neighbor_info_last_timestamp, 'YYYY-MM-DD HH24:MI:SS') AS neighbor_info_last_timestamp,\n \n CASE\n WHEN EXTRACT(EPOCH FROM map_broadcast_interval) > 1\n THEN to_char(map_broadcast_interval, 'HH24:MI:SS')\n ELSE NULL\n END AS map_broadcast_interval,\n to_char(map_broadcast_last_timestamp, 'YYYY-MM-DD HH24:MI:SS') AS map_broadcast_last_timestamp,\n \n mqtt_encryption_enabled,\n mqtt_json_enabled,\n mqtt_configured_root_topic,\n to_char(mqtt_info_last_timestamp, 'YYYY-MM-DD HH24:MI:SS') AS mqtt_info_last_timestamp,\n \n to_char(last_updated, 'YYYY-MM-DD HH24:MI:SS') AS last_updated\nFROM node_configurations\nWHERE\n (EXTRACT(EPOCH FROM environment_update_interval) > 1 OR\n EXTRACT(EPOCH FROM device_update_interval) > 1 OR\n EXTRACT(EPOCH FROM air_quality_update_interval) > 1 OR\n EXTRACT(EPOCH FROM power_update_interval) > 1 OR\n EXTRACT(EPOCH FROM range_test_interval) > 1 OR\n EXTRACT(EPOCH FROM pax_counter_interval) > 1 OR\n EXTRACT(EPOCH FROM neighbor_info_interval) > 1 OR\n EXTRACT(EPOCH FROM map_broadcast_interval) > 1)\n AND node_id = '${nodeID}'\nLIMIT 50",
"refId": "A",
"sql": {
"columns": [
{
"parameters": [
{
"name": "environment_update_interval",
"type": "functionParameter"
}
],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50,
"whereJsonTree": {
"children1": [
{
"id": "8abaab98-4567-489a-bcde-f19136d5e7d5",
"properties": {
"field": "node_id",
"fieldSrc": "field",
"operator": "equal",
"value": [
"${nodeID}"
],
"valueError": [
null
],
"valueSrc": [
"value"
],
"valueType": [
"text"
]
},
"type": "rule"
}
],
"id": "9b988aa8-0123-4456-b89a-b1913556a003",
"type": "group"
},
"whereString": "node_id = '${nodeID}'"
},
"table": "node_configurations"
}
],
"title": "Node configuration details",
"transformations": [
{
"id": "organize",
"options": {
"excludeByName": {},
"includeByName": {},
"indexByName": {},
"renameByName": {
"air_quality_update_interval": "Air quality update interval",
"air_quality_update_last_timestamp": "Air quality (Timestamp)",
"device_update_interval": "Device information update interval",
"device_update_last_timestamp": "Device information (Timestamp)",
"environment_update_interval": "Environment update interval",
"environment_update_last_timestamp": "Environment (Timestamp)",
"last_updated": "Last updated",
"map_broadcast_interval": "Map Broadcast update interval",
"map_broadcast_last_timestamp": "Map Broadcast (Timestamp)",
"mqtt_configured_root_topic": "Root topic at MQTT",
"mqtt_encryption_enabled": "Is MQTT encryption enabled",
"mqtt_info_last_timestamp": "MQTT Info (Timestamp)",
"mqtt_json_enabled": "Is MQTT JSON toggled on",
"neighbor_info_interval": "Neighbour Info update interval",
"neighbor_info_last_timestamp": "Neighbour Info (Timestamp)",
"node_id": "Node ID",
"pax_counter_interval": "PAX counter update interval",
"pax_counter_last_timestamp": "PAX counter (Timestamp)",
"power_update_interval": "Power update interval",
"power_update_last_timestamp": "Power (Timestamp)",
"range_test_interval": "Range test update interval",
"range_test_last_packet_timestamp": "Range test (Timestamp)"
}
}
},
{
"id": "reduce",
"options": {
"labelsToFields": false,
"reducers": [
"lastNotNull"
]
}
}
],
"type": "table"
},
{
"datasource": {
"type": "prometheus",
@ -946,7 +1110,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
}
]
},
@ -956,7 +1121,7 @@
},
"gridPos": {
"h": 5,
"w": 16,
"w": 9,
"x": 8,
"y": 17
},
@ -1103,14 +1268,8 @@
}
}
},
"filterData": {
"id": "byRefId",
"options": "A"
},
"location": {
"latitude": "latitude_norm",
"longitude": "longitude_norm",
"mode": "coords"
"mode": "auto"
},
"name": "Layer 1",
"tooltip": true,
@ -1122,12 +1281,13 @@
},
"view": {
"allLayers": true,
"id": "fit",
"id": "coords",
"lastOnly": false,
"lat": 0,
"lat": 31.499467,
"layer": "Layer 1",
"lon": 0,
"zoom": 15
"lon": 34.669663,
"padding": 2,
"zoom": 6.53
}
},
"pluginVersion": "11.1.0",
@ -1140,7 +1300,7 @@
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT * ,\nlongitude * 1e-7 as \"longitude_norm\",\nlatitude * 1e-7 as \"latitude_norm\"\nFROM node_details \nWHERE node_id = '${nodeID}' LIMIT 1",
"rawSql": "SELECT node_id, short_name, long_name, hardware_model, role, mqtt_status, \nlongitude * 1e-7 as longitude,\nlatitude * 1e-7 as latitude,\naltitude\nFROM node_details \nWHERE node_id = '${nodeID}' LIMIT 1",
"refId": "A",
"sql": {
"columns": [
@ -1237,7 +1397,7 @@
},
"gridPos": {
"h": 5,
"w": 16,
"w": 9,
"x": 8,
"y": 22
},
@ -1499,6 +1659,274 @@
],
"title": "Device voltage",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
},
"description": "Displays the measured current from the channels (1,2,3)",
"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"
},
{
"color": "red",
"value": 80
}
]
},
"unit": "mamp"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 35
},
"id": 18,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "telemetry_app_ch1_current{node_id=\"$nodeID\"}",
"fullMetaSearch": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "Channel 1",
"range": true,
"refId": "A",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "telemetry_app_ch2_current{node_id=\"$nodeID\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "Channel 2",
"range": true,
"refId": "B",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "telemetry_app_ch3_current{node_id=\"$nodeID\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "Channel 3",
"range": true,
"refId": "C",
"useBackend": false
}
],
"title": "Current measured from node",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
},
"description": "Measures the volage on channels (1,2,3)",
"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"
},
{
"color": "red",
"value": 80
}
]
},
"unit": "volt"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 35
},
"id": 19,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "telemetry_app_ch1_voltage{node_id=\"$nodeID\"}",
"fullMetaSearch": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "Channel 1",
"range": true,
"refId": "A",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "telemetry_app_ch2_voltage{node_id=\"$nodeID\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "Channel 2",
"range": true,
"refId": "B",
"useBackend": false
},
{
"datasource": {
"type": "prometheus",
"uid": "P1809F7CD0C75ACF3"
},
"disableTextWrap": false,
"editorMode": "builder",
"expr": "telemetry_app_ch3_voltage{node_id=\"$nodeID\"}",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"instant": false,
"legendFormat": "Channel 3",
"range": true,
"refId": "C",
"useBackend": false
}
],
"title": "Voltage measured by the node",
"type": "timeseries"
}
],
"refresh": "1m",
@ -1565,6 +1993,6 @@
"timezone": "browser",
"title": "Node Dashboard",
"uid": "edqo1uh0eglq8g",
"version": 30,
"version": 52,
"weekStart": ""
}

View file

@ -104,7 +104,7 @@ if __name__ == "__main__":
# Configure Prometheus exporter
registry = CollectorRegistry()
start_http_server(int(os.getenv('PROMETHEUS_COLLECTOR_PORT', 8000)), registry=registry)
start_http_server(int(os.getenv('PROMETHEUS_COLLECTOR_PORT', 9464)), registry=registry)
# Create an MQTT client
mqtt_protocol = os.getenv('MQTT_PROTOCOL', 'MQTTv5')