mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-08 05:56:37 +00:00
perfdata: fix incorrect collector log lines (#1626)
This commit is contained in:
@@ -228,14 +228,14 @@ func (p *Prometheus) execute(name string, c Collector, ctx *types.ScrapeContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
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),
|
slog.Any("err", err),
|
||||||
)
|
)
|
||||||
|
|
||||||
return failed
|
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
|
return success
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.
|
// 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
|
// 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 {
|
switch counter.Type {
|
||||||
case PERF_ELAPSED_TIME:
|
case PERF_ELAPSED_TIME:
|
||||||
|
|||||||
Reference in New Issue
Block a user