feat: windows_exporter uses own event log source to correctly format messages. (#1873)

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
Signed-off-by: Jan-Otto Kröpke <github@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke
2025-02-10 18:57:31 +01:00
committed by GitHub
parent f07aceb0dd
commit 285c4cc5ea
5 changed files with 40 additions and 40 deletions

View File

@@ -172,6 +172,12 @@ func NewCollectorWithReflection(resultType CounterType, object string, instances
continue
}
if bufLen == 0 {
errs = append(errs, errors.New("GetCounterInfo: buffer length is zero"))
continue
}
buf := make([]byte, bufLen)
if ret := GetCounterInfo(counterHandle, 0, &bufLen, &buf[0]); ret != ErrorSuccess {
errs = append(errs, fmt.Errorf("GetCounterInfo: %w", NewPdhError(ret)))