Skip to content

Commit

Permalink
Allow custom slurm paths via --config.paths (#31)
Browse files Browse the repository at this point in the history
Fixes #30
  • Loading branch information
treydock authored May 17, 2024
1 parent 8a7e660 commit 0545d5c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ This exporter by default listens on port `9306` and all metrics are exposed via

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`.

The path `/slurm` will work for both cgroupv1 and cgroupv2. For cgroupv2 the `/slurm` path is turned into `/system.slice/slurmstepd.scope`.

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.

## Docker

Example of running the Docker container
Expand Down
3 changes: 2 additions & 1 deletion collector/cgroupv2.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ func (e *Exporter) collectv2() ([]CgroupMetric, error) {
var metrics []CgroupMetric
for _, path := range e.paths {
var group string
if strings.Contains(path, "slurm") {
// Allows previous cgroupv1 path to work as default for cgroupv2 path
if path == "/slurm" {
group = "/system.slice/slurmstepd.scope"
} else {
group = path
Expand Down

0 comments on commit 0545d5c

Please sign in to comment.