newrelic / nri-winservices

Windows services Integration for New Relic Infrastructure
Apache License 2.0
8 stars 8 forks source link

disable the cs collector to get the hostname without using WMI #64

Closed davidbrota closed 3 years ago

davidbrota commented 3 years ago

Description

As the exporter runs locally along with the integration, we don't need to fetch the hostname from the exporter. Therefore, we can disable the cs collector, thus avoiding one call to WMI.

I've also removed one of the wait calls, because it was already done in the exporter's run gorutine.

Checklist:

davidbrota commented 3 years ago

LGTM. Only thing that comes to my mind is possible breakage on upgrade. Do we have any reason to think if os.Hostname() may return a different value than the exporter?

@roobre It should return the same hostname as the exporter. As we are still in beta, we are fine with introducing breaking changes. Another option would be to introduce a setting to keeps backwards compatibility.