Expand description
Telemetry: tracing, OTLP export, and Prometheus exposition.
Every Cognitora binary calls init exactly once at startup and then
registers metrics against registry. The optional admin HTTP server
(returned by admin_router) exposes /metrics, /healthz, and
/readyz for use by the orchestrator and load balancers.
Re-exports§
pub use prometheus;pub use tracing;
Macros§
- counter
- Convenience macro: register a counter on the workspace registry.
- gauge
- Convenience macro: register a gauge on the workspace registry.
- latency_
histogram - Convenience macro: register a histogram on the workspace registry with latency buckets suitable for tail-sensitive RPCs (50µs..2s).
Functions§
- admin_
router - Build an admin axum router with
/metrics,/healthz,/readyz. - encode_
metrics - Encode the registry as Prometheus exposition text.
- init
- Initialise structured tracing. Idempotent; safe to call from tests.
- registry
- Workspace-wide Prometheus registry. All custom metrics register here.