I see the doc’s mention how to manage this if running PMM in Docker, but can’t seem to find out how to change the retention period for QAN and prometheus in the appliance. Any insight would be great. Thanks.
as I know
we can manage the retnetion period for QAN and prometheus like this :
docker run -d
-e METRICS_MEMORY=32212254720 -e METRICS_RETENTION=2160h -e QUERIES_RETENTION=2160h
–note added by Percona Community Manager, going forward using pmm-server:n rather than pmm-server:latest is best practice, our advice changed since the user wrote this post. In this case pmm-server:1 would have been appropriate for these code examples.
I see you running PMM in docker. That’s not my situation.
To be clear, i’m trying to change retention for the PMM Virtual Appliance running in a virtualized environment.
want to know this as well, any info?
First of all - it is not recommended to do any changes directly in configs.
Potentially you can get broken system because PMM has configuration service which also makes changes in configs.
PMM Team is working on adding “Setting page” for all kind of images.
for METRICS_MEMORY it is not needed to change anything, it changes automatically according to your instance size.
if you want to change anyway, fix --storage.local.target-heap-size option inside /usr/lib/systemd/system/prometheus.service
for METRICS_RETENTION change --storage.local.retention value inside /etc/sysconfig/prometheus
for QUERIES_RETENTION change INTERVAL in /etc/cron.daily/purge-qan-data
please remember - after such changes, you can get a broken PMM during some actions like - external exporters adding, etc.
I think that the file to be modified is
… --storage.local.retention=1440h0m0s …
a stop start of the pmm-server is required for changes to be efective.