Skip to main content

Module report

Module report 

Source
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§

DescribeReply
io.systemd.Metrics.Describe reply.
MetricReply
io.systemd.Metrics.List reply.
MetricValue
A metric value: any JSON value, any in systemd’s IDL (a systemd extension zlink can describe but not derive for serde_json::Value).
MetricsService
The io.systemd.Metrics service.
ReportState
Counters kept across collection runs. Not part of MonitordStats so the JSON output is unchanged; only the report server reads them.

Enums§

MetricFamilyType
Metric family type, as in systemd’s io.systemd.Metrics IDL.
ReportError
Errors this source sends back, named as systemd names them.
__MetricsServiceMethodCall
__MetricsServiceReplyError
__MetricsServiceReplyParams
__MetricsServiceReplyStreamError
__MetricsServiceReplyStreamParams
__MetricsServiceUserMethods

Constants§

FAMILIES
One metric family: (name suffix after io.monitord., description, type).
REPORT_DIR
Directory systemd-report scans for system-scope sources.
REPORT_SOCKET_NAME
Socket filename, which is also the prefix of every metric name.

Functions§

build_metrics
Build every List reply from the latest stats and counters.
listener
Listener for the report server: activation_fd (from take_activation_fd) if systemd passed one, otherwise a socket monitord binds in dir itself.
serve
Serve io.systemd.Metrics on listener until 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.