Merge pull request #1954 from prometheus/superq/noisy_rapl

Fix rapl collector log noise
This commit is contained in:
Ben Kochie 2021-02-05 21:20:53 +01:00 committed by GitHub
commit 43b91ac846
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -60,6 +60,10 @@ func (c *raplCollector) Update(ch chan<- prometheus.Metric) error {
level.Debug(c.logger).Log("msg", "Platform doesn't have powercap files present", "err", err) level.Debug(c.logger).Log("msg", "Platform doesn't have powercap files present", "err", err)
return ErrNoData return ErrNoData
} }
if errors.Is(err, os.ErrPermission) {
level.Debug(c.logger).Log("msg", "Can't access powercap files", "err", err)
return ErrNoData
}
return fmt.Errorf("failed to retrieve rapl stats: %w", err) return fmt.Errorf("failed to retrieve rapl stats: %w", err)
} }