From 5b0fb01c42c2410a0d5d9b3c41c274584d552d8e Mon Sep 17 00:00:00 2001 From: shalper2 Date: Mon, 23 Sep 2024 09:53:07 -0500 Subject: [PATCH] populate service struct --- receiver/windowsservicereceiver/windowsservice.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/receiver/windowsservicereceiver/windowsservice.go b/receiver/windowsservicereceiver/windowsservice.go index c854b0983b71..a81a4e0b0068 100644 --- a/receiver/windowsservicereceiver/windowsservice.go +++ b/receiver/windowsservicereceiver/windowsservice.go @@ -36,6 +36,15 @@ func GetService(sname string) (*Service, error) { service: service, } + // populate metric fields + if err = s.getStatus(); err != nil { + return nil, err + } + + if err = s.getConfig(); err != nil { + return nil, err + } + return &s, nil }