prometheus-community / postgres_exporter

A PostgreSQL metric exporter for Prometheus
Apache License 2.0
2.78k stars 736 forks source link

unable to run as a Windows service #172

Open hunleyd opened 6 years ago

hunleyd commented 6 years ago

If you add the postgres_exporter.exe as a Windows service, the service manager thinks it failed to start since the process never detaches and backgrounds itself. Service mgr then kills it and reports a failure. Any chance you can rectify? Windows Server 2012 R2 Standard

jayceeb commented 5 years ago

Any update on this? We are hitting this as well

wrouesnel commented 4 years ago

Marking this as help-wanted. I don't run any Windows servers at all, and getting tests into CI is..not trivial.

alekssako commented 4 years ago

You can do the following :

  1. Go to System Environment Variables and add it as an System variable Variable name : DATA_SOURCE_NAME Variable value: postgresql://postgres:password@localhost:5432/postgres?sslmode=disable
  2. Go to Firewall add inbound port 9187
  3. Read this thread to install .exe as a service: https://stackoverflow.com/questions/3582108/create-windows-service-from-executable#answer-15719678

You welcome. ^_^