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 }