mirror of
https://github.com/prometheus/node_exporter
synced 2024-12-18 04:15:06 +00:00
warn if isolcpus cannot be read and default to an empty slice
Signed-off-by: david <davidventura27@gmail.com>
This commit is contained in:
parent
9ea9a5f029
commit
c05af934af
@ -79,7 +79,8 @@ func NewCPUCollector(logger log.Logger) (Collector, error) {
|
||||
|
||||
isolcpus, err := sysfs.IsolatedCPUs()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to read isolcpus from sysfs: %w", err)
|
||||
level.Warn(logger).Log("msg", "Unable to get isolated cpus, defaulting to []")
|
||||
isolcpus = []uint16{}
|
||||
}
|
||||
|
||||
c := &cpuCollector{
|
||||
|
Loading…
Reference in New Issue
Block a user