Want to run Otel collecor agent as Windows services. So downloaded latest windows release package and run the following command to create service and start the service.
sc.exe create otelcol displayname= otelcol start= delayed-auto
binPath=
"C:\Users\admin\otelcol-contrib_0.94.0_windows_386\otelcol-contrib.exe
--config C:\Users\admin\Core-Otel.yaml" sc.exe start otelcol
but the service is not started and resulted with error on event viewer as
The otelcol service terminated with the following error: An exception occurred in the service when handling the control request.
Agent version: 0.94.0 OS: Windows servers
Could any one point the right direction to deploy the Otel agent as windows service ?
Updated command with quotes for folder paths:
sc.exe create otelcol displayname= otelcol start= delayed-auto
binPath=
\""C:\Users\admin\otelcol-contrib_0.94.0_windows_386\otelcol-contrib.exe\"
--config \"C:\Users\admin\Core-Otel.yaml\""
sc.exe description "Otelcol"
sc.exe start otelcol