You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Prometheus exposition already existed as the `aegisbpf metrics` CLI (35+
low-cardinality families read from the pinned maps). This makes it scrape-able.
- src/metrics_server.{hpp,cpp}: a minimal opt-in HTTP/1.0 server. Off unless
AEGIS_METRICS_ADDR=<host:port>. Routes GET /metrics and GET /healthz; binds
loopback by default (bind :9635 to expose, restrict via firewall/NetworkPolicy).
No BPF/kernel dependency — the body comes from a callback — so it is unit-tested
over a real loopback socket.
- src/commands_metrics.{cpp,hpp}: refactor the builder out of `cmd_metrics` into a
shared `build_metrics_report(BpfState&, bool)` so the CLI, the textfile collector,
and the HTTP endpoint emit identical output. Add an `aegisbpf_deny_ttl_entries`
gauge (control-API denies awaiting TTL expiry).
- src/daemon.cpp: start the endpoint when AEGIS_METRICS_ADDR is set, reusing the
daemon's already-loaded state (no per-scrape reload). Reads touch only pinned
maps + files, so they run concurrently with the poll loop safely; in-process
counters (pin_heal_*) are intentionally deferred until made scrape-safe.
- packaging/systemd/aegisbpf-metrics.{service,timer}: node_exporter textfile
collector — the no-open-port alternative (atomic temp+rename write every 30s).
- tests/test_metrics_server.cpp: bind-addr parsing + loopback round-trip
(/metrics, /healthz, 404, no-callback 503, non-GET 405).
- docs/METRICS.md (+ index link), CHANGELOG.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments