diff options
Diffstat (limited to 'collector/schedstat_linux.go')
-rw-r--r-- | collector/schedstat_linux.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/collector/schedstat_linux.go b/collector/schedstat_linux.go index 9e5b744..9f29a7e 100644 --- a/collector/schedstat_linux.go +++ b/collector/schedstat_linux.go | |||
@@ -16,6 +16,7 @@ | |||
16 | package collector | 16 | package collector |
17 | 17 | ||
18 | import ( | 18 | import ( |
19 | "errors" | ||
19 | "fmt" | 20 | "fmt" |
20 | "os" | 21 | "os" |
21 | 22 | ||
@@ -72,7 +73,7 @@ func init() { | |||
72 | func (c *schedstatCollector) Update(ch chan<- prometheus.Metric) error { | 73 | func (c *schedstatCollector) Update(ch chan<- prometheus.Metric) error { |
73 | stats, err := c.fs.Schedstat() | 74 | stats, err := c.fs.Schedstat() |
74 | if err != nil { | 75 | if err != nil { |
75 | if os.IsNotExist(err) { | 76 | if errors.Is(err, os.ErrNotExist) { |
76 | level.Debug(c.logger).Log("msg", "schedstat file does not exist") | 77 | level.Debug(c.logger).Log("msg", "schedstat file does not exist") |
77 | return ErrNoData | 78 | return ErrNoData |
78 | } | 79 | } |