feat: probe mesh mode + Grafana dashboard (T5-S6/S7) — completes T5

WZP-P2-T5-S6: Probe mesh mode
- ProbeMesh coordinator: wraps multiple ProbeRunners, spawns all concurrently
- mesh_summary(): scans registry, formats human-readable health table
- /mesh HTTP endpoint on metrics port alongside /metrics
- --probe-mesh flag, --mesh-status for CLI diagnostics
- Replaces individual probe spawn loop with ProbeMesh::run_all()
- 4 tests: mesh creation, empty/populated summary, zero targets

WZP-P2-T5-S7: Grafana dashboard
- docs/grafana-dashboard.json — importable directly into Grafana
- Row 1: Relay Health (sessions, rooms, packets/s, bytes/s, auth, handshake)
- Row 2: Call Quality (buffer depth, loss%, RTT, underruns per session)
- Row 3: Inter-Relay Mesh (RTT heatmap, loss, jitter, probe up/down)
- Row 4: Web Bridge (connections, frames bridged, auth failures, latency)
- Datasource variable ${DS_PROMETHEUS}, auto-refresh 10s
- Color thresholds: loss 2%/5%, RTT 100ms/300ms, probe up=green/down=red

T5 Telemetry & Observability is now COMPLETE (all 7 subtasks).
235 tests passing across all crates.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Siavash Sameni
2026-03-28 13:18:50 +04:00
parent 216ebf4a25
commit a64b79d953
5 changed files with 1105 additions and 15 deletions

View File

@@ -201,17 +201,26 @@ impl RelayMetrics {
}
}
/// Start an HTTP server serving GET /metrics on the given port.
/// Start an HTTP server serving GET /metrics and GET /mesh on the given port.
pub async fn serve_metrics(port: u16, metrics: Arc<RelayMetrics>) {
use axum::{routing::get, Router};
let app = Router::new().route(
"/metrics",
get(move || {
let m = metrics.clone();
async move { m.metrics_handler() }
}),
);
let metrics_clone = metrics.clone();
let app = Router::new()
.route(
"/metrics",
get(move || {
let m = metrics.clone();
async move { m.metrics_handler() }
}),
)
.route(
"/mesh",
get(move || {
let m = metrics_clone.clone();
async move { crate::probe::mesh_summary(m.registry()) }
}),
);
let addr = std::net::SocketAddr::from(([0, 0, 0, 0], port));
let listener = tokio::net::TcpListener::bind(addr)