Expand description
The ops port of every role (see archive/PROJECT.md, Observability): plain HTTP on [ops] bind :
port with only /healthz, /readyz and /metrics, never data or actions, so probes and
Prometheus need no certificate or credentials. It is started first, so /readyz answers
while a role starts.
/healthz(liveness): 503 once a loop the role watches (the master’s scheduling loop, the worker agent’s event loop) hasn’t turned forloop_stall_timeout; it never asks another component (a database or master outage mustn’t restart the role)./readyz: 503 until every part of the role has started./metrics: the role’s metrics (schedr_…), its process’s (process_…, from/proc/self) andschedr_build_info, in theOpenMetricstext format. A scrape reads them only: nothing touches the database.
Structs§
- Health
- What the health endpoints check (cheap to clone; clones share it).
- Ops
- What the ops endpoints serve.
- Process
Metrics - The process’s own metrics, read from
/proc/selfat each scrape (absent without/proc). - Process
Stats - What
/proc/selfsays about this process. - Starting
- A part of a role that is starting; ready once told (and not ready again when told, as a master that isn’t leading, B165).
Constants§
- METRICS_
CONTENT_ TYPE - The content type of
/metrics. - PROCESS_
METRICS - The metrics every role serves besides its own, as registered (without a prefix): the process’s and the build’s.
Functions§
- ops_
line - The ops address’s line for a role’s log.
- parse_
stats - The stats in
/proc/self/stat,/proc/self/statmand/proc/stat(for the boot time). - process_
stats - Reads this process’s stats from
/proc;Nonewhere there is no/proc. - router
- The ops routes.
- serve_
ops - Serves the ops endpoints on
listeneruntilstop.