diff --git a/pkg/collector/prometheus.go b/pkg/collector/prometheus.go index 9c6ef06e9..29696e971 100644 --- a/pkg/collector/prometheus.go +++ b/pkg/collector/prometheus.go @@ -228,14 +228,14 @@ func (p *Prometheus) execute(name string, c Collector, ctx *types.ScrapeContext, } if err != nil { - p.logger.Error(fmt.Sprintf("collector %s failed after %s", name, p.maxScrapeDuration), + p.logger.Error(fmt.Sprintf("collector %s failed after %s", name, duration), slog.Any("err", err), ) return failed } - p.logger.Error(fmt.Sprintf("collector %s succeeded after %s", name, p.maxScrapeDuration)) + p.logger.Info(fmt.Sprintf("collector %s succeeded after %s", name, duration)) return success } diff --git a/pkg/perfdata/collector.go b/pkg/perfdata/collector.go index acd602646..644cbd0f9 100644 --- a/pkg/perfdata/collector.go +++ b/pkg/perfdata/collector.go @@ -186,6 +186,7 @@ func (c *Collector) Collect() (map[string]map[string]CounterValues, error) { // This is a workaround for the issue with the elapsed time counter type. // Source: https://github.com/prometheus-community/windows_exporter/pull/335/files#diff-d5d2528f559ba2648c2866aec34b1eaa5c094dedb52bd0ff22aa5eb83226bd8dR76-R83 + // Ref: https://learn.microsoft.com/en-us/windows/win32/perfctrs/calculating-counter-values switch counter.Type { case PERF_ELAPSED_TIME: