Score:0

Change retention time on prometheus

cn flag

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.

Score:0
jp flag

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
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.