Skip to main content

Module report_collector

Module report_collector 

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

ReportSource
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 with up: false and 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-flat leaves of value stored at key: objects descend into key.<member>, arrays into key.<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_name is in blocklist, 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_name from source: an interface name, a dot, then a field name, with the source as a true prefix.
normalize_metrics
Turn one source’s List replies into a ReportSource, dropping what systemd-report would drop and skipping what metric_blocklist names.
should_collect_source
Whether a socket name in the report directory should be collected.
update_report_stats
Collector entry point: replace MonitordStats::report with this run’s sources.

Type Aliases§

ReportStats
Report sources keyed by socket name (e.g. io.systemd.Basic)