Expand description
§report module
Serve monitord’s own health as an io.systemd.Metrics source so
systemd-report (systemd ≥ 260) includes monitord in its report.
systemd-report calls io.systemd.Metrics.List / Describe on every
socket in /run/systemd/report/. A source’s socket must be named as a
varlink interface name, and every metric it returns must be prefixed with
that name followed by a dot. Metrics without the prefix are dropped as
invalid. So the socket is always REPORT_SOCKET_NAME and every family
in FAMILIES starts with it.
These metrics cover monitord itself: whether its last collection run was clean, how long each collector took, and failure counters. They do not re-export the stats monitord collects, which systemd’s own report sources already publish.
Structs§
- Describe
Reply io.systemd.Metrics.Describereply.- Metric
Reply io.systemd.Metrics.Listreply.- Metric
Value - A metric value: any JSON value,
anyin systemd’s IDL (a systemd extension zlink can describe but not derive forserde_json::Value). - Metrics
Service - The
io.systemd.Metricsservice. - Report
State - Counters kept across collection runs. Not part of
MonitordStatsso the JSON output is unchanged; only the report server reads them.
Enums§
- Metric
Family Type - Metric family type, as in systemd’s
io.systemd.MetricsIDL. - Report
Error - Errors this source sends back, named as systemd names them.
- __
Metrics Service Method Call - __
Metrics Service Reply Error - __
Metrics Service Reply Params - __
Metrics Service Reply Stream Error - __
Metrics Service Reply Stream Params - __
Metrics Service User Methods
Constants§
- FAMILIES
- One metric family: (name suffix after
io.monitord., description, type). - REPORT_
DIR - Directory
systemd-reportscans for system-scope sources. - REPORT_
SOCKET_ NAME - Socket filename, which is also the prefix of every metric name.
Functions§
- build_
metrics - Build every
Listreply from the latest stats and counters. - listener
- Listener for the report server:
activation_fd(fromtake_activation_fd) if systemd passed one, otherwise a socket monitord binds indiritself. - serve
- Serve
io.systemd.Metricsonlisteneruntil an error ends it. - spawn_
server - Run the report server on its own thread with a current-thread runtime.
- take_
activation_ fd - Take the listening socket systemd passed, if it passed one to us.