cache: Implement PDH collector (#1662)

This commit is contained in:
Jan-Otto Kröpke
2024-10-03 14:31:44 +02:00
committed by GitHub
parent e6ef2de40c
commit 70156cd106
9 changed files with 410 additions and 54 deletions

View File

@@ -186,16 +186,15 @@ func (p *Prometheus) execute(name string, c Collector, scrapeCtx *types.ScrapeCo
go func() {
defer func() {
if r := recover(); r != nil {
p.logger.Error("panic in collector "+name,
slog.Any("panic", r),
slog.Any("stack", string(debug.Stack())),
errCh <- fmt.Errorf("panic in collector %s: %v. stack: %s", name, r,
string(debug.Stack()),
)
}
close(bufCh)
}()
errCh <- c.Collect(scrapeCtx, p.logger, bufCh)
close(bufCh)
}()
wg := sync.WaitGroup{}