Prometheus was working fine until I added --storage.tsdb.retention.time=1y
. Service file looks like this:
[Unit]
Description=Prometheus
Wants=network-online.target
After=network-online.target
[Service]
User=prometheus
Group=prometheus
Type=simple
ExecStart=/usr/local/bin/prometheus \
--config.file /etc/prometheus/prometheus.yml \
--storage.tsdb.path /var/lib/prometheus/ \
--web.console.templates=/etc/prometheus/consoles \
--web.console.libraries=/etc/prometheus/console_libraries \
--storage.tsdb.retention.time=1y
[Install]
WantedBy=multi-user.target
The following is logged to journactl after restarting the service:
Mar 16 15:33:15 myserver.com systemd[1]: [/etc/systemd/system/prometheus.service:10] Trailing garbage, ignoring.
Mar 16 15:33:15 myserver.com systemd[1]: [/etc/systemd/system/prometheus.service:11] Unknown lvalue '--config.file /etc/prometheus/prometheus.yml --storage.tsdb.path /var/lib/prometheus/ --web.console.templates' in section '
Service'
Mar 16 15:33:15 myserver.com systemd[1]: prometheus.service lacks both ExecStart= and ExecStop= setting. Refusing.
OS version is Centos 7 and Prometheus version is:
prometheus, version 2.33.4 (branch: HEAD, revision: 83032011a5d3e6102624fe58241a374a7201fee8)
build user: root@d13bf69e7be8
build date: 20220222-16:51:28
go version: go1.17.7
platform: linux/amd6
The service actually starts, but the retention time is set to the default 15 days. Any idea on why this is happening?