wifi-densepose/docs
ruv 74eb09f604 feat(adr-110): Prometheus exposition endpoint /api/v1/mesh/metrics
Iter 36 — Grafana / Home Assistant Prometheus integration / Cognitum
Seed observability stack can now scrape mesh state directly with no
JSON-to-metric translation layer.

Endpoint: GET /api/v1/mesh/metrics → text/plain (Prometheus exposition
format v0.0.4). Eight gauges, one per NodeSyncSnapshot field, labeled
by node:

  wifi_densepose_mesh_offset_us{node="N"}        <signed-int>
  wifi_densepose_mesh_is_leader{node="N"}        0|1
  wifi_densepose_mesh_is_valid{node="N"}         0|1
  wifi_densepose_mesh_smoothed{node="N"}         0|1
  wifi_densepose_mesh_sequence{node="N"}         <u32>
  wifi_densepose_mesh_csi_fps{node="N"}          <float>
  wifi_densepose_mesh_csi_fps_samples{node="N"}  <u32>
  wifi_densepose_mesh_staleness_ms{node="N"}     <u64>

Each metric carries the standard `# HELP` + `# TYPE` headers before
its series block, exactly the format Prometheus + most scrape-format
implementations expect.

Implementation reuses iter-30's `NodeState::sync_snapshot()` as the
single source of truth — same data the JSON endpoints emit, just
text-formatted with `{node=...}` labels. Nodes without a fresh sync
are absent (Prometheus handles missing series natively).

Test added (8/8 sync_snapshot_helper_tests now green):
  bool_metric_returns_zero_or_one_as_text
    Pins the Prometheus convention that boolean gauges emit "0" or "1"
    literally, never "false"/"true" — if anyone refactors the helper
    to format!("{b}"), Prometheus would 400-reject the scrape; this
    test catches that drift before production.

User-guide REST table updated with the new endpoint.

Grafana / HA scrape config:
  - job_name: wifi-densepose-mesh
    scrape_interval: 5s
    metrics_path: /api/v1/mesh/metrics
    static_configs:
      - targets: ['localhost:3000']

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-05-23 15:03:51 -04:00
..
adr docs(adr-index): surface ADR-110 review/witness/branch-state docs 2026-05-23 14:24:29 -04:00
archtocode-visual-overview docs: add visual architecture overview images (#208) 2026-05-17 18:18:07 -04:00
benchmarks docs(bench): append v0.0.2 section to person-count benchmark log 2026-05-21 19:47:55 -04:00
ddd docs: rvCSI edge RF sensing platform — PRD, ADR-095, DDD domain model 2026-05-12 23:15:10 +00:00
edge-modules chore(repo): rename rust-port/wifi-densepose-rs → v2/ (flatten to one level) (#427) 2026-04-25 21:28:13 -04:00
huggingface fix(train): wire wifi-densepose-signal into the pipeline; correct MODEL_CARD env-sensor claim (#536) 2026-05-11 23:40:55 -04:00
prd docs: rvCSI edge RF sensing platform — PRD, ADR-095, DDD domain model 2026-05-12 23:15:10 +00:00
qe-reports chore(repo): move v1/ → archive/v1/ + add archive/README.md (#430) 2026-04-25 23:07:52 -04:00
research research(sota-loop): final 00-summary.md — loop closes at 12:00 UTC stop (#747) 2026-05-22 08:07:08 -04:00
tutorials docs(tutorials): Pi 5 + Hailo cluster rvcsi tutorial (#546) 2026-05-17 17:41:39 -04:00
ADR-110-BRANCH-STATE.md docs(adr-110): branch-state map for ADR-110 ↔ ADR-115 coordination 2026-05-23 13:58:08 -04:00
ADR-110-REVIEW-GUIDE.md docs(adr-110): add reviewer one-page guide 2026-05-22 23:53:22 -04:00
TROUBLESHOOTING.md fix(docker): UDP relay for multi-source ESP32 on Docker Desktop Windows (#502) 2026-05-17 18:01:44 -04:00
WITNESS-LOG-028.md chore(repo): move v1/ → archive/v1/ + add archive/README.md (#430) 2026-04-25 23:07:52 -04:00
WITNESS-LOG-110.md release(firmware): v0.7.0-esp32 major — ADR-110 firmware-side substrate closed 2026-05-23 12:56:58 -04:00
build-guide.md chore(repo): move v1/ → archive/v1/ + add archive/README.md (#430) 2026-04-25 23:07:52 -04:00
readme-details.md docs(readme): split details to docs/readme-details.md and reorganize 2026-04-29 19:34:24 -04:00
security-audit-wasm-edge-vendor.md chore(repo): rename rust-port/wifi-densepose-rs → v2/ (flatten to one level) (#427) 2026-04-25 21:28:13 -04:00
user-guide.md feat(adr-110): Prometheus exposition endpoint /api/v1/mesh/metrics 2026-05-23 15:03:51 -04:00
wifi-mat-user-guide.md chore(repo): rename rust-port/wifi-densepose-rs → v2/ (flatten to one level) (#427) 2026-04-25 21:28:13 -04:00