mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-11-09 23:24:09 -08: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 a new issue