fix: log instance name in skip warnings (#10995)
This commit is contained in:
parent
54c75bd6ae
commit
1b10e15424
|
|
@ -351,7 +351,7 @@ func (m *Win_PerfCounters) Gather(acc telegraf.Accumulator) error {
|
||||||
if !isKnownCounterDataError(err) {
|
if !isKnownCounterDataError(err) {
|
||||||
return fmt.Errorf("error while getting value for counter %s: %v", metric.counterPath, 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
|
continue
|
||||||
}
|
}
|
||||||
addCounterMeasurement(metric, metric.instance, value, collectFields)
|
addCounterMeasurement(metric, metric.instance, value, collectFields)
|
||||||
|
|
@ -367,7 +367,7 @@ func (m *Win_PerfCounters) Gather(acc telegraf.Accumulator) error {
|
||||||
if !isKnownCounterDataError(err) {
|
if !isKnownCounterDataError(err) {
|
||||||
return fmt.Errorf("error while getting value for counter %s: %v", metric.counterPath, 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
|
continue
|
||||||
}
|
}
|
||||||
for _, cValue := range counterValues {
|
for _, cValue := range counterValues {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue