Hi, I am have deployed grafana alloy on centos 7 and under /etc/alloy/config.alloy i have set the requested parameters to read the application logs, end points of loki.
But during restart, i see alloy service is active for less than a second and moves into failed state.
While i tried to validate config parameter using below command,
/usr/bin/alloy run --storage.path=/var/lib/alloy/data /etc/alloy/config.alloy
i see error as
ts=2025-05-15T09:53:22.663965983Z level=error msg=“final error sending batch” component_path=/remotecfg/self_monitoring_logs_linux.default component_id=loki.write.grafana_cloud_loki component=client host=logs-prod-YYY.grafana.net status=401 tenant=“” error=“server returned HTTP status 401 Unauthorized (401): {"status":"error","error":"authentication error: invalid token"}”
sudo systemctl status alloy
● alloy.service - Vendor-agnostic OpenTelemetry Collector distribution with programmable pipelines
Loaded: loaded (/usr/lib/systemd/system/alloy.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/alloy.service.d
└─env.conf
Active: failed (Result: start-limit) since Thu 2025-05-15 09:53:22 UTC; 3min 24s ago
Docs: https://grafana.com/docs/alloy
Process: 2958 ExecStart=/usr/bin/alloy run $CUSTOM_ARGS --storage.path=/var/lib/alloy/data $CONFIG_FILE (code=exited, status=1/FAILURE)
Main PID: 2958 (code=exited, status=1/FAILURE)
May 15 09:53:22 systemd[1]: alloy.service: main process exited, code=exited, status=1/FAILURE
May 15 09:53:22 systemd[1]: Unit alloy.service entered failed state.
May 15 09:53:22 systemd[1]: alloy.service failed.
May 15 09:53:22 systemd[1]: alloy.service holdoff time over, scheduling restart.
May 15 09:53:22 systemd[1]: Stopped Vendor-agnostic OpenTelemetry Collector distribution with programmable pipelines.
May 15 09:53:22 systemd[1]: start request repeated too quickly for alloy.service
May 15 09:53:22 systemd[1]: Failed to start Vendor-agnostic OpenTelemetry Collector distribution with programmable pipelines.
May 15 09:53:22 systemd[1]: Unit alloy.service entered failed state.
May 15 09:53:22 systemd[1]: alloy.service failed.
[root@ centos]# /usr/bin/alloy run --storage.path=/var/lib/alloy/data /etc/alloy/config.alloy/usr/bin/alloy run --storage.path=/var/lib/alloy/data /etc/alloy/config.alloy
Also, if token has some issue, it should not send any logs to grafana, but i see couple of application logs has pushed out during restart of alloy service. Can someone suggest whats wrong here ?