feat: Tolerate collector failures (#1769)

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke
2024-11-25 21:27:31 +01:00
committed by GitHub
parent fd76be38e0
commit 1a4c6c5ce7
121 changed files with 1726 additions and 1221 deletions

View File

@@ -16,7 +16,6 @@
package exchange
import (
"errors"
"fmt"
"github.com/prometheus-community/windows_exporter/internal/perfdata"
@@ -97,7 +96,7 @@ func (c *Collector) collectHTTPProxy(ch chan<- prometheus.Metric) error {
}
if len(perfData) == 0 {
return errors.New("perflib query for MSExchange HttpProxy Service returned empty result set")
return fmt.Errorf("failed to collect MSExchange HttpProxy Service metrics: %w", types.ErrNoData)
}
for name, data := range perfData {