Files
gitlab-mirror/roles/prometheus/templates/prometheus.service.j2
Alexander Gorelyshev 62f52010c9 Minor edits
2025-12-28 16:24:42 +04:00

29 lines
646 B
Django/Jinja

[Unit]
Description=Prometheus
Wants=network-online.target
After=network-online.target
Documentation="https://prometheus.io/"
[Service]
User=prometheus
Group=prometheus
Type=simple
ExecStart=/usr/bin/prometheus \
--config.file {{ prometheus_config_dir }}/prometheus.yml \
--storage.tsdb.path {{ prometheus_db_dir }} \
--storage.tsdb.retention.time=30d
# Security hardening
ReadWritePaths={{ prometheus_db_dir }}
ProtectSystem=strict
NoNewPrivileges=true
PrivateTmp=true
ProtectKernelModules=true
ProtectControlGroups=true
ProtectKernelTunables=true
ProtectClock=yes
RestrictSUIDSGID=true
[Install]
WantedBy=multi-user.target