Skip to content

Commit 0545d5c

Browse files
authored
Allow custom slurm paths via --config.paths (#31)
Fixes #30
1 parent 8a7e660 commit 0545d5c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ This exporter by default listens on port `9306` and all metrics are exposed via
1515

1616
The `--config.paths` flag is required and must point to paths of cgroups to monitor. If there is `/sys/fs/cgroup/cpuacct/user.slice` then the value for `--config.paths` would be `/user.slice`.
1717

18+
The path `/slurm` will work for both cgroupv1 and cgroupv2. For cgroupv2 the `/slurm` path is turned into `/system.slice/slurmstepd.scope`.
19+
20+
If Slurm is compiled ot support multiple slurmd instances and you have paths that are `/sys/fs/cgroup/system.slice/<nodename>_slurmstepd.scope` then you must pass `--config.paths=/system.slice/<nodename>_slurmstepd.scope` and replace `<nodename>` with the host's slurmd NodeName.
21+
1822
## Docker
1923

2024
Example of running the Docker container

collector/cgroupv2.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@ func (e *Exporter) collectv2() ([]CgroupMetric, error) {
200200
var metrics []CgroupMetric
201201
for _, path := range e.paths {
202202
var group string
203-
if strings.Contains(path, "slurm") {
203+
// Allows previous cgroupv1 path to work as default for cgroupv2 path
204+
if path == "/slurm" {
204205
group = "/system.slice/slurmstepd.scope"
205206
} else {
206207
group = path

0 commit comments

Comments
 (0)