Adjust retention time

Hey guys.

When I changed the “–storage.tsdb.retention.time” parameter to 180d, I noticed that my history was lost, so I went back to default to view my data history again.
We have Prometheus in a docker container and these parameters are configured in the Dockerfile. The flag was changed, but I didn’t want my data history to be lost.
Do we have a solution for this?

Thanks in advance.

Where are you storing the data? In a volume/bound directory? Or just inside the Docker image?

Hi, Stuart.
I am storing my data in an EFS (AWS Elastic File System), exactly to save this data in an external area.

Kind regards.

I would mention that EFS (as a network file system) is not supported by Prometheus. I don’t know if its use could be related to your data loss.

I’m using the prometheus volume location pattern in my staging environment (/var/lib/docker/volumes/prometheus/_data) and this issue also occurs there.
This action of changing this flag created a second directory of data under the default directory, and when I reverted to the default settings this data was back stored in the default location again.

Hi Stuart.
Did you make any test to analyse my request.
I tried much ways to around this problem, but have no success.

Thanks in advance.