Skip to content

Commit 40eab58

Browse files
feat(docs): configuration management system
changes: - file: test_e2e.py area: test added: [e2e_enabled, docker_available] modified: [docker_compose] removed: [shutil_which] stats: lines: "+548/-30 (net +518)" files: 5 complexity: "+200% complexity (monitor)"
1 parent 48dee96 commit 40eab58

9 files changed

Lines changed: 572 additions & 33 deletions

File tree

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
## [0.1.32] - 2026-02-24
2+
3+
### Summary
4+
5+
feat(docs): configuration management system
6+
7+
### Docs
8+
9+
- docs: update README
10+
- docs: update STANDARD_DOCUMENTATION.md
11+
12+
### Test
13+
14+
- update tests/test_e2e.py
15+
16+
### Other
17+
18+
- update deploy/grafana/provisioning/dashboards/json/meshpi-overview.json
19+
- update project.functions.toon
20+
21+
122
## [0.1.31] - 2026-02-24
223

324
### Summary

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,39 @@ meshpi diag
215215
```
216216
Collects CPU load, memory, temperature, GPIO states, I2C scan, USB devices, WiFi signal, services, logs, and more.
217217
218+
### 📈 Monitoring & Observability
219+
220+
MeshPi includes built-in monitoring with Prometheus metrics, alerting, and audit logging:
221+
222+
```bash
223+
# View audit log
224+
meshpi audit
225+
226+
# Check alert status
227+
meshpi alerts status
228+
229+
# Push OTA update
230+
meshpi ota push --image ./image.img --devices rpi-001,rpi-002
231+
```
232+
233+
**Features:**
234+
- 🔍 **Audit Logging** - All fleet operations logged to JSONL
235+
- 📊 **Prometheus Metrics** - CPU, memory, temperature, device count
236+
- 🚨 **Alert Engine** - 9 default rules (temperature, memory, offline, etc.)
237+
- 🔄 **OTA Updates** - Staged rollout with A/B partition rollback
238+
- 📉 **Grafana Dashboards** - Pre-built visualization templates
239+
240+
**Docker Monitoring Stack:**
241+
```bash
242+
# Start with Prometheus + Grafana
243+
docker compose --profile monitoring up
244+
245+
# Access endpoints
246+
open http://localhost:7422/metrics # Prometheus metrics
247+
open http://localhost:9090 # Prometheus UI
248+
open http://localhost:3000 # Grafana (admin/meshpi)
249+
```
250+
218251
### 💾 USB Offline Workflow
219252
For air-gapped environments:
220253
```bash

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.31
1+
0.1.32
Lines changed: 298 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,298 @@
1+
{
2+
"annotations": {
3+
"list": []
4+
},
5+
"editable": true,
6+
"fiscalYearStartMonth": 0,
7+
"graphTooltip": 0,
8+
"id": null,
9+
"links": [],
10+
"liveNow": false,
11+
"panels": [
12+
{
13+
"datasource": {
14+
"type": "prometheus",
15+
"uid": "prometheus"
16+
},
17+
"fieldConfig": {
18+
"defaults": {
19+
"color": {
20+
"mode": "thresholds"
21+
},
22+
"mappings": [],
23+
"thresholds": {
24+
"mode": "absolute",
25+
"steps": [
26+
{ "color": "green", "value": null },
27+
{ "color": "yellow", "value": 1 },
28+
{ "color": "red", "value": 5 }
29+
]
30+
},
31+
"unit": "none"
32+
},
33+
"overrides": []
34+
},
35+
"gridPos": { "h": 6, "w": 4, "x": 0, "y": 0 },
36+
"id": 1,
37+
"options": {
38+
"colorMode": "value",
39+
"graphMode": "none",
40+
"justifyMode": "auto",
41+
"orientation": "auto",
42+
"reduceOptions": {
43+
"calcs": ["lastNotNull"],
44+
"fields": "",
45+
"values": false
46+
},
47+
"textMode": "auto"
48+
},
49+
"title": "Total Devices",
50+
"type": "stat"
51+
},
52+
{
53+
"datasource": {
54+
"type": "prometheus",
55+
"uid": "prometheus"
56+
},
57+
"fieldConfig": {
58+
"defaults": {
59+
"color": {
60+
"mode": "thresholds"
61+
},
62+
"mappings": [],
63+
"thresholds": {
64+
"mode": "absolute",
65+
"steps": [
66+
{ "color": "red", "value": null },
67+
{ "color": "yellow", "value": 1 },
68+
{ "color": "green", "value": 3 }
69+
]
70+
},
71+
"unit": "none"
72+
},
73+
"overrides": []
74+
},
75+
"gridPos": { "h": 6, "w": 4, "x": 4, "y": 0 },
76+
"id": 2,
77+
"options": {
78+
"colorMode": "value",
79+
"graphMode": "none",
80+
"justifyMode": "auto",
81+
"orientation": "auto",
82+
"reduceOptions": {
83+
"calcs": ["lastNotNull"],
84+
"fields": "",
85+
"values": false
86+
},
87+
"textMode": "auto"
88+
},
89+
"title": "Online Devices",
90+
"type": "stat"
91+
},
92+
{
93+
"datasource": {
94+
"type": "prometheus",
95+
"uid": "prometheus"
96+
},
97+
"fieldConfig": {
98+
"defaults": {
99+
"color": {
100+
"mode": "thresholds"
101+
},
102+
"mappings": [],
103+
"thresholds": {
104+
"mode": "absolute",
105+
"steps": [
106+
{ "color": "green", "value": null },
107+
{ "color": "yellow", "value": 1 },
108+
{ "color": "red", "value": 5 }
109+
]
110+
},
111+
"unit": "none"
112+
},
113+
"overrides": []
114+
},
115+
"gridPos": { "h": 6, "w": 4, "x": 8, "y": 0 },
116+
"id": 3,
117+
"options": {
118+
"colorMode": "value",
119+
"graphMode": "none",
120+
"justifyMode": "auto",
121+
"orientation": "auto",
122+
"reduceOptions": {
123+
"calcs": ["lastNotNull"],
124+
"fields": "",
125+
"values": false
126+
},
127+
"textMode": "auto"
128+
},
129+
"title": "Alerts Active",
130+
"type": "stat"
131+
},
132+
{
133+
"datasource": {
134+
"type": "prometheus",
135+
"uid": "prometheus"
136+
},
137+
"fieldConfig": {
138+
"defaults": {
139+
"color": {
140+
"mode": "palette-classic"
141+
},
142+
"custom": {
143+
"axisLabel": "",
144+
"axisPlacement": "auto",
145+
"barAlignment": 0,
146+
"drawStyle": "line",
147+
"fillOpacity": 10,
148+
"gradientMode": "none",
149+
"hideFrom": { "legend": false, "tooltip": false, "viz": false },
150+
"lineInterpolation": "linear",
151+
"lineWidth": 1,
152+
"pointSize": 5,
153+
"scaleDistribution": { "type": "linear" },
154+
"showPoints": "never",
155+
"spanNulls": true
156+
},
157+
"mappings": [],
158+
"thresholds": {
159+
"mode": "absolute",
160+
"steps": [{ "color": "green", "value": null }]
161+
},
162+
"unit": "short"
163+
},
164+
"overrides": []
165+
},
166+
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 6 },
167+
"id": 4,
168+
"options": {
169+
"legend": { "calcs": [], "displayMode": "list", "placement": "bottom" },
170+
"tooltip": { "mode": "single" }
171+
},
172+
"targets": [
173+
{
174+
"datasource": { "type": "prometheus", "uid": "prometheus" },
175+
"expr": "meshpi_fleet_online",
176+
"refId": "A",
177+
"legendFormat": "Online Devices"
178+
}
179+
],
180+
"title": "Device Connectivity",
181+
"type": "timeseries"
182+
},
183+
{
184+
"datasource": {
185+
"type": "prometheus",
186+
"uid": "prometheus"
187+
},
188+
"fieldConfig": {
189+
"defaults": {
190+
"color": {
191+
"mode": "palette-classic"
192+
},
193+
"custom": {
194+
"axisLabel": "",
195+
"axisPlacement": "auto",
196+
"barAlignment": 0,
197+
"drawStyle": "line",
198+
"fillOpacity": 10,
199+
"gradientMode": "none",
200+
"hideFrom": { "legend": false, "tooltip": false, "viz": false },
201+
"lineInterpolation": "linear",
202+
"lineWidth": 1,
203+
"pointSize": 5,
204+
"scaleDistribution": { "type": "linear" },
205+
"showPoints": "never",
206+
"spanNulls": true
207+
},
208+
"mappings": [],
209+
"thresholds": {
210+
"mode": "absolute",
211+
"steps": [{ "color": "green", "value": null }]
212+
},
213+
"unit": "short"
214+
},
215+
"overrides": []
216+
},
217+
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 6 },
218+
"id": 5,
219+
"options": {
220+
"legend": { "calcs": [], "displayMode": "list", "placement": "bottom" },
221+
"tooltip": { "mode": "single" }
222+
},
223+
"targets": [
224+
{
225+
"datasource": { "type": "prometheus", "uid": "prometheus" },
226+
"expr": "rate(meshpi_operations_total[5m])",
227+
"refId": "A",
228+
"legendFormat": "{{ operation_type }}"
229+
}
230+
],
231+
"title": "Operations Rate",
232+
"type": "timeseries"
233+
},
234+
{
235+
"datasource": {
236+
"type": "prometheus",
237+
"uid": "prometheus"
238+
},
239+
"fieldConfig": {
240+
"defaults": {
241+
"color": {
242+
"mode": "palette-classic"
243+
},
244+
"custom": {
245+
"axisLabel": "",
246+
"axisPlacement": "auto",
247+
"barAlignment": 0,
248+
"drawStyle": "line",
249+
"fillOpacity": 10,
250+
"gradientMode": "none",
251+
"hideFrom": { "legend": false, "tooltip": false, "viz": false },
252+
"lineInterpolation": "linear",
253+
"lineWidth": 1,
254+
"pointSize": 5,
255+
"scaleDistribution": { "type": "linear" },
256+
"showPoints": "never",
257+
"spanNulls": true
258+
},
259+
"mappings": [],
260+
"thresholds": {
261+
"mode": "absolute",
262+
"steps": [{ "color": "green", "value": null }]
263+
},
264+
"unit": "s"
265+
},
266+
"overrides": []
267+
},
268+
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 14 },
269+
"id": 6,
270+
"options": {
271+
"legend": { "calcs": [], "displayMode": "list", "placement": "bottom" },
272+
"tooltip": { "mode": "single" }
273+
},
274+
"targets": [
275+
{
276+
"datasource": { "type": "prometheus", "uid": "prometheus" },
277+
"expr": "histogram_quantile(0.95, rate(meshpi_operation_duration_seconds_bucket[5m]))",
278+
"refId": "A",
279+
"legendFormat": "p95 duration"
280+
}
281+
],
282+
"title": "Operation Duration (p95)",
283+
"type": "timeseries"
284+
}
285+
],
286+
"refresh": "10s",
287+
"schemaVersion": 38,
288+
"style": "dark",
289+
"tags": ["meshpi", "fleet"],
290+
"templating": { "list": [] },
291+
"time": { "from": "now-1h", "to": "now" },
292+
"timepicker": {},
293+
"timezone": "",
294+
"title": "MeshPi Fleet Overview",
295+
"uid": "meshpi-overview",
296+
"version": 1,
297+
"weekStart": ""
298+
}

docs/STANDARD_DOCUMENTATION.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,27 @@ meshpi group exec weather_stations "meshpi diag"
244244
meshpi group exec weather_stations "meshpi hw list"
245245
```
246246

247+
### 📋 **Krok 6: Skonfiguruj monitoring**
248+
249+
```bash
250+
# Uruchom stack monitoringowy
251+
docker compose --profile monitoring up
252+
253+
# Sprawdź audit log
254+
meshpi audit
255+
256+
# Sprawdź status alertów
257+
meshpi alerts status
258+
259+
# Monitoruj metryki
260+
curl http://localhost:7422/metrics
261+
262+
# Dostęp do dashboardów
263+
open http://localhost:7422/metrics # Prometheus metrics
264+
open http://localhost:9090 # Prometheus UI
265+
open http://localhost:3000 # Grafana (admin/meshpi)
266+
```
267+
247268
---
248269

249270
## 🎯 **Przykłady Konfiguracji**

0 commit comments

Comments
 (0)