QubitProducts / exporter_exporter

A reverse proxy designed for Prometheus exporters
Apache License 2.0
336 stars 55 forks source link

exporter_exporter windows service functionality #20

Closed frunzales closed 4 years ago

frunzales commented 5 years ago

Currently, exporter_exporter does not have means to run as a windows service. Running it as a service on windows without a service wrapper a la nssm/winsw would be ideal.

I also investigated the possibility of building it as an MSI package with INSTALL_OPTIONS a la wmi_exporter.

Is this worth investigating?

tcolgate commented 5 years ago

I don't have access to a Windows system to test on, but if you can get something working I'd definitely consider the patches.

Ideally it would fit with the existing release process.

ldaneliukas commented 5 years ago

I'd be interested in this too. We are currently using an in-house chocolatey package which basically wraps it in nssm to have a service.

frunzales commented 5 years ago

The golang 'svc' package provides means to build Windows services. wmi_exporter and telegraf make use of it.

Examples can be found here: https://github.com/golang/sys/tree/master/windows/svc/example

The bosun project has a very good example on how this works: https://github.com/bosun-monitor/bosun/blob/master/cmd/scollector/service_windows.go

Perhaps we could implement similar functionality and then use smth like

exporter_exporter.exe -winsvc install
tcolgate commented 4 years ago

@frunzales I had a look at the bosun example, it looks reasonable enough. If the flag can be hidden on non-winodws OSes, that would be ideal. I'll happily accept a PR, but I can't work on this myself (just don't have access to something to test on, sorry).