Feature Request
Currently, the schedstat collector only exports system-wide per-CPU metrics from /proc/schedstat.
However, /proc/[pid]/schedstat exposes per-process scheduler statistics:
- Running time in nanoseconds
- Waiting time in nanoseconds
- Number of timeslices
The procfs library already has ProcSchedstat struct that parses this file, so no new parsing code is needed.
Proposal
Add an opt-in per-process schedstat collector (defaultDisabled, similar to the existing processes collector) that exports:
- node_schedstat_process_running_seconds_total{pid, comm}
- node_schedstat_process_waiting_seconds_total{pid, comm}
- node_schedstat_process_timeslices_total{pid, comm}
Implementation
Would follow the same pattern as collector/processes_linux.go — iterate AllProcs(), call pid.Schedstat() per process, export metrics labeled with pid and comm.
Feature Request
Currently, the schedstat collector only exports system-wide per-CPU metrics from /proc/schedstat.
However, /proc/[pid]/schedstat exposes per-process scheduler statistics:
The procfs library already has ProcSchedstat struct that parses this file, so no new parsing code is needed.
Proposal
Add an opt-in per-process schedstat collector (defaultDisabled, similar to the existing processes collector) that exports:
Implementation
Would follow the same pattern as collector/processes_linux.go — iterate AllProcs(), call pid.Schedstat() per process, export metrics labeled with pid and comm.