Early init of procfs (#1315)
Minor change to match naming convention in other collectors. Initialize the proc or sys FS instance once while initializing each collector instead of re-creating for each metric update. Signed-off-by: Paul Gier <pgier@redhat.com>
This commit is contained in:
parent
fbe390709f
commit
b1298677aa
8 changed files with 63 additions and 47 deletions
|
|
@ -58,7 +58,7 @@ func newIPVSCollector() (*ipvsCollector, error) {
|
|||
|
||||
c.fs, err = procfs.NewFS(*procPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, fmt.Errorf("failed to open procfs: %v", err)
|
||||
}
|
||||
|
||||
c.connections = typedDesc{prometheus.NewDesc(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue