Expand description
Dependency-free metrics registry rendering Prometheus text exposition format. Counters and histograms only (what the SLA criteria need), all lock-free on the hot path (atomics; registration takes a short mutex).
Structs§
- Counter
- A monotonically increasing counter.
- Gauge
- A signed gauge whose value may go up, down, or be
setto an absolute number. Backed byAtomicI64because Prometheus gauges are unrestricted-sign floats; we clamp to i64 here because every data-plane gauge in the workspace (open sessions, queue depth, spool bytes) is a non-negative count that fits comfortably in 63 bits, and the signed representation letssub_saturatingbottom out at 0 rather than wrap. - Histogram
- Fixed-bucket latency histogram (microsecond samples).
- Registry
- A registry mapping metric names (+ optional fixed labels) to metrics.
Constants§
- DEFAULT_
LATENCY_ BOUNDS_ US - Default latency bucket upper bounds in microseconds: 50µs … 10s.
- WIDE_
LATENCY_ BOUNDS_ US - Wide latency bucket upper bounds in microseconds: 1ms … 300s.