windows_exporter
windows_exporter copied to clipboard
scheduled_task: Move OLE connection to collect function
Based on: https://github.com/influxdata/telegraf/blob/2de80263d5875531b5c39eb63c85b20109a35799/plugins/inputs/win_wmi/query.go#L77
Fixes #1425
@mattdurham does fix the issue on your side?
Connecting to OLE during collect should also increase the support for multiple instances and reduce the locking to an minimum.
On my local system, I do not longer had issues.
I think it should but will verify
@mattdurham did you manage to verify the change?
@breed808 otherwise, if you agree - take a review and merge it.
It was wrong anyways to construct the OLE init on builder func. If the issue is not resolved, feedback can be applied in https://github.com/prometheus-community/windows_exporter/issues/1425