Expand description
§report_collector module
Collects every io.systemd.Metrics source that systemd-report (systemd
v260+) would read from /run/systemd/report/, and passes their metrics
through as generic key/value stats.
Each socket in that directory is named after a varlink interface (e.g.
io.systemd.Basic), and every metric it serves must be named
<socket name>.<field>. Sources monitord already parses into typed stats
(io.systemd.Manager, io.systemd.Network) and monitord’s own source
(io.monitord) are always skipped.
Structs§
- Report
Source - Metrics from one report source.
Constants§
- METRICS_
PER_ SOURCE_ MAX - Same per-source cap as systemd-report (
METRICS_PER_SOURCE_MAX). - REPORT_
DIR - Where systemd-report looks for system metrics sources.
- SKIP_
SOURCES - Sources that are never collected here:
- SKIP_
SOURCE_ PREFIXES - Source name prefixes that are never collected:
io.systemd.Report.*are systemd-report’s own signers (SignPlain,SignTPM2,SignTSM), which only publish their public key, not health. - SOURCES_
MAX - Same source cap as systemd-report (
METRICS_LINKS_MAX).
Functions§
- collect_
report_ stats - Collect every report source in
dir, concurrently. A failing source is reported withup: falseand never fails the collector. - field_
name_ is_ valid - Varlink field name check, as
varlink_idl_field_name_is_valid(): starts with a letter, alphanumerics with single inner underscores. - flat_
leaves - The
json-flatleaves ofvaluestored atkey: objects descend intokey.<member>, arrays intokey.<index>, and nulls produce nothing. - interface_
name_ is_ valid - Varlink interface name check, as
varlink_idl_interface_name_is_valid(): dot-separated segments, at least two, the first starting with a letter, each of alphanumerics with inner (never leading or trailing) dashes. - list_
sources - List the sources to collect, sorted, in
dir. - metric_
is_ blocked - Whether
metric_nameis inblocklist, exactly or below an entry at a dot boundary, so a family entry covers all of its sub-names. - metric_
name_ is_ valid - Whether systemd-report would accept
metric_namefromsource: an interface name, a dot, then a field name, with the source as a true prefix. - normalize_
metrics - Turn one source’s
Listreplies into aReportSource, dropping what systemd-report would drop and skipping whatmetric_blocklistnames. - should_
collect_ source - Whether a socket name in the report directory should be collected.
- update_
report_ stats - Collector entry point: replace
MonitordStats::reportwith this run’s sources.
Type Aliases§
- Report
Stats - Report sources keyed by socket name (e.g.
io.systemd.Basic)