Remove all hardcoded references to `/proc`. For all collectors that do not use `github.com/prometheus/procfs` yet, provide a wrapper to generate the full paths. Reformulate help strings, errors and comments to remove absolute references to `/proc`. This is a breaking change: the `-collector.ipvs.procfs` flag is removed in favor of the general flag. Since it only affected that collector it was only useful for development, so this should not cause many issues.pull/121/head
parent
cf3aa37f1a
commit
20b551ab2b
@ -0,0 +1,17 @@ |
||||
package collector |
||||
|
||||
import ( |
||||
"flag" |
||||
"path" |
||||
|
||||
"github.com/prometheus/procfs" |
||||
) |
||||
|
||||
var ( |
||||
// The path of the proc filesystem.
|
||||
procPath = flag.String("collector.procfs", procfs.DefaultMountPoint, "procfs mountpoint.") |
||||
) |
||||
|
||||
func procFilePath(name string) string { |
||||
return path.Join(*procPath, name) |
||||
} |
||||
Loading…
Reference in new issue