mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-03-01 16:16:35 +00:00
feat: Tolerate collector failures (#1769)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
@@ -35,6 +35,7 @@ const Name = "memory"
|
||||
|
||||
type Config struct{}
|
||||
|
||||
//nolint:gochecknoglobals
|
||||
var ConfigDefaults = Config{}
|
||||
|
||||
// A Collector is a Prometheus Collector for perflib Memory metrics.
|
||||
@@ -430,7 +431,7 @@ func (c *Collector) collectPDH(ch chan<- prometheus.Metric) error {
|
||||
data, ok := perfData[perfdata.InstanceEmpty]
|
||||
|
||||
if !ok {
|
||||
return errors.New("perflib query for Memory returned empty result set")
|
||||
return fmt.Errorf("failed to collect Memory metrics: %w", types.ErrNoData)
|
||||
}
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
|
||||
Reference in New Issue
Block a user