perfdata: fix incorrect collector log lines (#1626)

This commit is contained in:
Jan-Otto Kröpke
2024-09-13 22:12:10 +02:00
committed by GitHub
parent fb275a06fe
commit 2e4ba9984d
2 changed files with 3 additions and 2 deletions

View File

@@ -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
}