fix(inputs.win_perf_counters): Check errors post-collection for skip (#14526)

This commit is contained in:
Joshua Powers 2024-01-15 04:08:16 -07:00 committed by GitHub
parent f0156d4503
commit 9035355215
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -457,7 +457,7 @@ func (m *WinPerfCounters) Gather(acc telegraf.Accumulator) error {
start := time.Now()
err := m.gatherComputerCounters(hostInfo, acc)
m.Log.Debugf("Gathering from %s finished in %v", hostInfo.computer, time.Since(start))
if err != nil {
if err != nil && m.checkError(err) != nil {
acc.AddError(fmt.Errorf("error during collecting data on host %q: %w", hostInfo.computer, err))
}
wg.Done()