Don't count empty collection as success (#1613)
Many collectors depend on underlying features to be enabled. This causes confusion about what "success" means. This changes the behavior of the `node_scrape_collector_success` metric. * When a collector is unable to find data don't return success. * Catch the no data error and send to Debug log level to avoid log spam. * Update collectors to support this new functionality. * Fix copy-pasta mistake in infiband debug message. Closes: https://github.com/prometheus/node_exporter/issues/1323 Signed-off-by: Ben Kochie <superq@gmail.com>
This commit is contained in:
parent
1a75bc7b50
commit
3e1b0f1bee
11 changed files with 26 additions and 12 deletions
|
|
@ -63,7 +63,7 @@ func (c *nfsdCollector) Update(ch chan<- prometheus.Metric) error {
|
|||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
level.Debug(c.logger).Log("msg", "Not collecting NFSd metrics", "err", err)
|
||||
return nil
|
||||
return ErrNoData
|
||||
}
|
||||
return fmt.Errorf("failed to retrieve nfsd stats: %w", err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue