fix: log instance name in skip warnings (#10995)

This commit is contained in:
reimda 2022-05-17 13:42:42 -06:00 committed by GitHub
parent 54c75bd6ae
commit 1b10e15424
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -351,7 +351,7 @@ func (m *Win_PerfCounters) Gather(acc telegraf.Accumulator) error {
if !isKnownCounterDataError(err) {
return fmt.Errorf("error while getting value for counter %s: %v", metric.counterPath, err)
}
m.Log.Warnf("error while getting value for counter %q, will skip metric: %v", metric.counterPath, err)
m.Log.Warnf("error while getting value for counter %q, instance: %s, will skip metric: %v", metric.counterPath, metric.instance, err)
continue
}
addCounterMeasurement(metric, metric.instance, value, collectFields)
@ -367,7 +367,7 @@ func (m *Win_PerfCounters) Gather(acc telegraf.Accumulator) error {
if !isKnownCounterDataError(err) {
return fmt.Errorf("error while getting value for counter %s: %v", metric.counterPath, err)
}
m.Log.Warnf("error while getting value for counter %q, will skip metric: %v", metric.counterPath, err)
m.Log.Warnf("error while getting value for counter %q, instance: %s, will skip metric: %v", metric.counterPath, metric.instance, err)
continue
}
for _, cValue := range counterValues {