Add loopback health and Prometheus metrics endpoint
All checks were successful
CI / check (push) Successful in 4m22s

This commit is contained in:
Jean Chevronnet 2026-07-19 04:13:18 +00:00
parent 381f706634
commit ad8a3fe065
No known key found for this signature in database
6 changed files with 180 additions and 0 deletions

View file

@ -20,6 +20,10 @@ pub struct Config {
// Absent = it does not start. Bind to localhost; a token is required.
#[serde(default)]
pub jsonrpc: Option<JsonRpc>,
// Liveness + Prometheus metrics endpoint (plain HTTP). Absent = it does not
// start. Bind to localhost; unauthenticated by design (read-only gauges).
#[serde(default)]
pub health: Option<Health>,
// Which service modules to start. Absent = the full standard suite (all the
// pseudo-clients); listing it trims that set. Every service is first-class.
#[serde(default)]
@ -277,6 +281,14 @@ pub struct JsonRpc {
pub tls: Option<ServerTls>,
}
#[derive(Debug, Deserialize, Clone)]
pub struct Health {
// Address to accept HTTP on, e.g. "127.0.0.1:9099". Keep it on localhost:
// the endpoint is unauthenticated and serves read-only gauges for a monitor
// (Prometheus scrape of /metrics, or /health for a liveness probe).
pub bind: String,
}
#[derive(Debug, Deserialize, Clone)]
pub struct Email {
// Sender address stamped on outgoing mail.