Prometheus metrics endpoint for knox nodes #2

Closed
opened 2026-08-29 12:42:01 +00:00 by david · 1 comment
Owner

Expose a Prometheus /metrics endpoint on knox nodes so the swarm can be monitored.

Decisions:

  • Use prometheus/client_golang (official text exposition + Go runtime/process collectors)
  • Serve on a dedicated port via KNOX_METRICS_ADDR (separate from the gossip port)

Metrics:

  • Gauges (scrape-time DB snapshots): observations by source_id, last-24h observations, entries, projects, sessions, pending reflections, threads by status, peers total, knowledge vector (max hcl per node), observations by origin node
  • Counters (in-process): gossip pulls/pushes, observations pulled/pushed, gossip errors
  • knox_node_info{node_id,name} for scrape identification

Everything else (source-of-truth round-trip via reconcile, swarm membership) ships in-and-along the M1-M4 curl.

Expose a Prometheus /metrics endpoint on knox nodes so the swarm can be monitored. Decisions: - Use `prometheus/client_golang` (official text exposition + Go runtime/process collectors) - Serve on a dedicated port via `KNOX_METRICS_ADDR` (separate from the gossip port) Metrics: - Gauges (scrape-time DB snapshots): observations by source_id, last-24h observations, entries, projects, sessions, pending reflections, threads by status, peers total, knowledge vector (max hcl per node), observations by origin node - Counters (in-process): gossip pulls/pushes, observations pulled/pushed, gossip errors - `knox_node_info{node_id,name}` for scrape identification Everything else (source-of-truth round-trip via reconcile, swarm membership) ships in-and-along the M1-M4 curl.
Author
Owner

Done — shipped with the gossip milestones and live on the always-on node.

  • /metrics on a dedicated port (KNOX_METRICS_ADDR, default :8932), separate from gossip
  • prometheus/client_golang with the Go runtime and process collectors
  • DB-derived gauges refreshed per scrape (knox_entries, knox_observations{source_id}, knox_threads{status}, knox_peers, knox_observations_by_node{node_id}, knowledge_max_hcl{node_id}) plus gossip counters (knox_pulls_total, knox_pushes_total, knox_observations_pulled_total, knox_observations_pushed_total, knox_gossip_errors_total)
  • knox_node_info{node_id,name} for scrape identity

Verified on dhg.lol: curl http://172.30.170.155:8932/metrics returns knox_entries, knox_observations, knox_gossip_errors_total.

Note from #5: gauges dropped the _total suffix (reserved for counters) — dashboards were renamed accordingly.

Done — shipped with the gossip milestones and live on the always-on node. - `/metrics` on a dedicated port (`KNOX_METRICS_ADDR`, default `:8932`), separate from gossip - `prometheus/client_golang` with the Go runtime and process collectors - DB-derived gauges refreshed per scrape (`knox_entries`, `knox_observations{source_id}`, `knox_threads{status}`, `knox_peers`, `knox_observations_by_node{node_id}`, `knowledge_max_hcl{node_id}`) plus gossip counters (`knox_pulls_total`, `knox_pushes_total`, `knox_observations_pulled_total`, `knox_observations_pushed_total`, `knox_gossip_errors_total`) - `knox_node_info{node_id,name}` for scrape identity Verified on dhg.lol: `curl http://172.30.170.155:8932/metrics` returns `knox_entries`, `knox_observations`, `knox_gossip_errors_total`. Note from #5: gauges dropped the `_total` suffix (reserved for counters) — dashboards were renamed accordingly.
david closed this issue 2026-11-05 03:45:58 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: david/knox#2