Unable to run prometheus agent as a window service

22 views
Skip to first unread message

shashi tiwary

unread,
Jun 24, 2025, 11:19:25 AMJun 24
to Prometheus Users
I am using below command to create a service on windows server 2019 . Service is being created but after start unable to run the service.

sc.exe create Prometheus binPath= "`"C:\Prometheus\prometheus-3.4.0.windows-amd64\prometheus.exe`" --config.file=C:\Prometheus\prometheus-3.4.0.windows-amd64\prometheus.yml --log.level=debug --enable-feature=agent" start= auto

Start-Service -Name Prometheus

In the event log i am getting below error.

TimeGenerated           EntryType Message
-------------           --------- -------
6/18/2025 4:21:15 AM        Error The Prometheus service failed to start due to the following error: ...
6/18/2025 4:21:15 AM        Error A timeout was reached (30000 milliseconds) while waiting for the Prometheus service to connect.

Also i am not getting any log in the prometheus query log.

When i am running the same executable as a stand alone process or windows wrapper(as a service) i am able run that.

Any idea what could be the issue here.

Brian Candler

unread,
Jun 26, 2025, 3:05:03 AMJun 26
to Prometheus Users
You're not the only one:

The suggestion there is to use NSSM.

Reply all
Reply to author
Forward
0 new messages