mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-03-06 18:46:36 +00:00
feat: Tolerate collector failures (#1769)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
@@ -43,6 +43,7 @@ type Config struct {
|
||||
CollectorsEnabled []string `yaml:"collectors_enabled"`
|
||||
}
|
||||
|
||||
//nolint:gochecknoglobals
|
||||
var ConfigDefaults = Config{
|
||||
CollectorsEnabled: []string{
|
||||
collectorSystemTime,
|
||||
@@ -242,7 +243,7 @@ func (c *Collector) collectNTP(ch chan<- prometheus.Metric) error {
|
||||
|
||||
data, ok := perfData[perfdata.InstanceEmpty]
|
||||
if !ok {
|
||||
return errors.New("query for Windows Time Service returned empty result set")
|
||||
return fmt.Errorf("failed to collect VM Memory metrics: %w", err)
|
||||
}
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
|
||||
Reference in New Issue
Block a user