mirror of
https://github.com/prometheus/node_exporter.git
synced 2025-02-02 08:42:31 -08:00
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.
18 lines
295 B
Go
18 lines
295 B
Go
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)
|
|
}
|