# cat /etc/systemd/system/prometheus.service
[Unit]
Description=Prometheus Monitoring
Wants=
network-online.target After=
network-online.target[Service]
WorkingDirectory=/data/prometheus
User=prometheus
Group=prometheus
Type=simple
ExecStart=/usr/local/bin/prometheus \
--config.file /etc/prometheus/prometheus.yml \
--storage.tsdb.path /data/prometheus \
--web.console.templates=/etc/prometheus/consoles \
--web.console.libraries=/etc/prometheus/console_libraries \
--log.level=debug \
--storage.tsdb.retention.time=14d \
--storage.tsdb.wal-compression \
--storage.tsdb.retention.size=45GB \
--storage.tsdb.max-block-duration=30m \
--storage.tsdb.min-block-duration=15m \
--web.enable-lifecycle
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=
multi-user.target