mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-28 07:36:37 +00:00
fix: added count checks (#2083)
This commit is contained in:
@@ -305,7 +305,9 @@ func (c *Collector) collectClockSource(ch chan<- prometheus.Metric) error {
|
||||
func (c *Collector) collectNTP(ch chan<- prometheus.Metric) error {
|
||||
err := c.perfDataCollector.Collect(&c.perfDataObject)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to collect time metrics: %w", err)
|
||||
return fmt.Errorf("failed to collect Windows Time Service metrics: %w", err)
|
||||
} else if len(c.perfDataObject) == 0 {
|
||||
return fmt.Errorf("failed to collect Windows Time Service metrics: %w", types.ErrNoDataUnexpected)
|
||||
}
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
|
||||
Reference in New Issue
Block a user