0

So I am running Prometheus on an Ubuntu server and started running it a while ago by just running

sudo ./prometheus

However, I wanted to append

--storage.tsdb.retention.time=1y

to the end of this command. How can I change the storage retention time of a running Prometheus process without stopping Prometheus from collecting metrics. It is very import that I change the retention time WITHOUT losing the metrics that Prometheus has already collected on this server. Please let me know anything that might help. Thank you.

1 Answers1

0

enter image description here if you use the docker container
enter image description here

docker run  -p 9090:9090 -itd --name prometheus  \ 
-v /prometheus/prometheus.yml:/etc/prometheus/prometheus.yml  prom/prometheus \
--storage.tsdb.retention.time=1y --config.file=/etc/prometheus/prometheus.yml

VM environment enter image description here

prometheus  --storage.tsdb.retention.time=2y --config.file=/etc/prometheus/prometheus.yml
Willie Cheng
  • 111
  • 3