Expand description
Session-level system-performance sampler (SRD-118).
Enabled per session with sysmon=<categories>: sysmon=all,
sysmon=any, or a comma list of category names. all and any
differ in exactly one way: all ABORTS when a subsystem is
unavailable, any enables what the host supports and NAMES what it
skipped. Reads /proc (and statvfs) on a fixed interval (default
5 s, sysmon_interval=<seconds>) and publishes host-side measures
as session-scoped gauges plus a live observer callback for display
surfaces: measurement of the machine under the workload, not of the
workload.
The host is read through nmbrs-host (SRD-118 §9), which holds
each category’s counters, parser and arithmetic. This module holds
what makes those readings a session’s sampler: the sysmon=
setting, what it requires of the session, the sample a window
yields, the gauges and the task.
Counters are cumulative, so every rate here is a pairwise delta over the sample window; the published gauge is the latest window’s value and any windowing beyond that belongs to MetricsQL at query time.
Modules§
- gauges
- The sampler’s gauges (SRD-118 §4): which families each category publishes, and writing a sample to them.
Structs§
- Sysmon
Config - Sampler configuration, resolved by the runner from session params.
- Sysmon
Sample - One completed sample window. A field is
Some, or a list is filled, exactly when its category was enabled and had a reading — a disabled category is absent, not zero.
Enums§
- Selection
- What a
sysmon=value asked for: a fixed category set, or “whatever this host supports”.
Constants§
- UNSUPPORTED_
PLATFORM - What the platform check says when it fails.
Functions§
- check_
rambw_ requirements - The rambw prerequisites, checked BEFORE the session starts so an unsupported host aborts with instructions instead of silently monitoring less than was asked for.
- check_
requirements - Everything a named category needs of this host, checked before the
session starts.
sysmon_procs=without theproccategory, andsysmon_cgroups=withoutcgroup, are refused here too: each would otherwise name something nothing watches. - parse_
categories - Parse a fixed category list (
allor comma names). Seeparse_selectionfor theanyform. - parse_
selection - Parse a
sysmon=value:all,any, or a comma list of category names. Unknown names are errors that NAME the valid set — a typo silently monitoring nothing would be the failure mode this surface exists to avoid. - resolve_
any - Resolve
sysmon=anyagainst THIS host: every category the host supports, plus one human-readable line per category that had to be skipped and why. The /proc-backed categories are always available on Linux; rambw, pressure and cgroup carry real prerequisites. - spawn
- Spawn the sampler.
check_requirementsmust have passed first — the runner aborts the session on its Err rather than calling this. Runs until session shutdown; publishes each window to the session gauges and toobserver.sysmon_update.