aboutsummaryrefslogtreecommitdiff
path: root/collector/infiniband_linux.go
diff options
context:
space:
mode:
Diffstat (limited to 'collector/infiniband_linux.go')
-rw-r--r--collector/infiniband_linux.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/collector/infiniband_linux.go b/collector/infiniband_linux.go
index 1f453b8..d938210 100644
--- a/collector/infiniband_linux.go
+++ b/collector/infiniband_linux.go
@@ -17,6 +17,7 @@
17package collector 17package collector
18 18
19import ( 19import (
20 "errors"
20 "fmt" 21 "fmt"
21 "os" 22 "os"
22 "strconv" 23 "strconv"
@@ -108,11 +109,11 @@ func (c *infinibandCollector) pushCounter(ch chan<- prometheus.Metric, name stri
108func (c *infinibandCollector) Update(ch chan<- prometheus.Metric) error { 109func (c *infinibandCollector) Update(ch chan<- prometheus.Metric) error {
109 devices, err := c.fs.InfiniBandClass() 110 devices, err := c.fs.InfiniBandClass()
110 if err != nil { 111 if err != nil {
111 if os.IsNotExist(err) { 112 if errors.Is(err, os.ErrNotExist) {
112 level.Debug(c.logger).Log("msg", "infiniband statistics not found, skipping") 113 level.Debug(c.logger).Log("msg", "infiniband statistics not found, skipping")
113 return ErrNoData 114 return ErrNoData
114 } 115 }
115 return fmt.Errorf("error obtaining InfiniBand class info: %s", err) 116 return fmt.Errorf("error obtaining InfiniBand class info: %w", err)
116 } 117 }
117 118
118 for _, device := range devices { 119 for _, device := range devices {