/
Increasing Prometheus storage retention
Increasing Prometheus storage retention
The default retention of Prometheus on SwarmTelemetry is 15 days, so data will be removed automatically after 15 days. Below is how to change the data retention of Prometheus.
Edit the prometheus.service file
vi /usr/lib/systemd/system/prometheus.service
Change the value of “
--storage.tsdb.retention.time=15d
" below to "ExecStart=/usr/local/bin/prometheus \
" line.
The config will look like below for 45 days of data retention. (e.g. 1 year:1y
or365d
)# /etc/systemd/system/prometheus.service [Unit] Description=Prometheus Server Documentation=https://prometheus.io/docs/introduction/overview/ After=network-online.target [Service] User=prometheus Restart=on-failure ExecStart=/usr/local/bin/prometheus \ --config.file=/etc/prometheus/prometheus.yml \ --storage.tsdb.path=/var/lib/prometheus/data \ --storage.tsdb.retention.time=45d \ --web.console.templates=/etc/prometheus/consoles \ --web.console.libraries=/etc/prometheus/console_libraries [Install] WantedBy=multi-user.target
NOTE: Ensure that the unit of time is correctly specified. For instance:
- ‘m
' for minutes
- ‘h
’ for hours
- ‘d
' for days
- 'y
’ for years
Reload systemd manager configuration
systemctl daemon-reload
Restart Prometheus service
systemctl restart prometheus
See the Prometheus documentation.
, multiple selections available,
Related content
Gateway Logging
Gateway Logging
Read with this
Import Prometheus metrics from another SwarmTelemetry VM
Import Prometheus metrics from another SwarmTelemetry VM
More like this
Intel Skylake/Cascade Lake CPU Performance Issue
Intel Skylake/Cascade Lake CPU Performance Issue
Read with this
Swarm Storage 15.2 Release
Swarm Storage 15.2 Release
More like this
Returning a Stale Volume to Service
Returning a Stale Volume to Service
More like this
Swarm Storage 15.1 Release
Swarm Storage 15.1 Release
More like this
© DataCore Software Corporation. · https://www.datacore.com · All rights reserved.