Skip to main content

Module ops

Module ops 

Source
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 for loop_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) and schedr_build_info, in the OpenMetrics text 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.
ProcessMetrics
The process’s own metrics, read from /proc/self at each scrape (absent without /proc).
ProcessStats
What /proc/self says 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/statm and /proc/stat (for the boot time).
process_stats
Reads this process’s stats from /proc; None where there is no /proc.
router
The ops routes.
serve_ops
Serves the ops endpoints on listener until stop.