Skip to main content

Module measure

Module measure 

Source
Expand description

What a service measures, for Prometheus: its requests by route and status and how long they take, what the limits refuse, and its database connections; services add their own (the combat service’s WebSockets, say). Served at /metrics on METRICS_ADDR, an address of its own that the proxy never serves; without it nothing is measured.

Functions§

as_f64
count as a gauge’s value, at most u32::MAX: far beyond any count here.
endpoint
GET /metrics: what was measured, in Prometheus’ text format.
install
Measures service from now on, everything labelled with its name; the handle renders what was measured. Once per process.
refused
Counts a request a limit refused: limit is which.
requests
Counts and times router’s requests, by the route they matched (its template, such as /characters/{id}, not the ids themselves).
watch_pool
Measures pool’s connections whenever the measurements are read. The first pool a service watches is the one measured.