Skip to main content

Module metrics

Module metrics 

Source
Expand description

Prometheus /metrics — operational gauges for scraping (Arm 8 observability). Token-gated via the Actor guard, so it is not public; Prometheus scrapes it with ?token=<token> (the guard also accepts the X-Cortex-Token header). Deliberately limited to current-state gauges read on each scrape — connection-pool saturation, background-job backlog, active admin sessions, registered corpora/services, the dispatcher worker fleet’s size + in-flight backlog, and the pending-conversion backlog (cortex_tasks_todo, the one full-table count — bounded ~tens-to-hundreds of ms even at arXiv scale).

It does not instrument the hot paths (no dispatcher changes) and does not run the /healthz ZMQ/filesystem probes (those are slow and that endpoint’s job). Real-time counters (request rates, per-event tallies via the metrics crate) need hot-path instrumentation and are a follow-on — this gives the operationally-critical saturation/backlog signals today, cheaply.

Functions§

metrics
GET /metrics — Prometheus exposition of current-state gauges. Token-gated (the Actor guard; scrape with ?token=). Pool gauges are always emitted (in-memory); DB-derived gauges are best-effort — on a pool/db hiccup they are omitted (and cortex_db_reachable is 0) rather than reporting a wrong value.
routes
The /metrics route.