Data retention, archive some metrics like rrdtool with 1d resolution


is there a possibility to archive/store (prevent from retention) some metrics, or store them as RRDTools does? with 1 day (or even 1 week) resolution
How can I (for example) have metrics 8 months old for (for example) CPU usage while other metrics get deleted by normal retention?
I need have for example:
load, ram usage, disk space usage, network throughput stats (with but no others
stored/availbale for 12 months with 1 day resolution. Is it posiible? how?

Thank you.

Hi Witold,

Now it’s not possible to filter retention metrics.
But as workaround you may increase the general retention period to 8 month and periodically delete unnecessary metrics by an api request to time series database.


Sorry, I’m not familiar with rrdtool but I think I get what you’re looking for and we can kind of do it.

I think about a year ago VictoriaMetrics enterprise released a feature called downsampling which, thanks to our partnership with that team we get the benefit of it in PMM.

In a nutshell, by passing a configuration param to victoriametrics on start you can have high resolution metrics in the near term and then summarize metrics over time with a lower resolution…but I think this is all or none, can’t selectively downsample as far as I know.

take the following example:
What that says is:

  • do nothing to the data between 0 and <30 days
  • from 30 days old data to <180 days old, downsample the data to 5 minute resolution
  • greater than or equal to 180 days old, downsample to 1 hour resolution

In order for this to work you also need to adjust the default PMM retention period (30 days by default).

To enable you’ll need to recreate your docker container passing in the environment variable -e VM_downsampling_period= as part of the docker run command.
and then adjust the overall retention period (as an admin in PMM, click the gear icon → settings → Advanced Settings → Increase ‘Data Retention’ to whatever your max retention will be (say 365 days) and click Apply)

I do really thank you very much… I’ll try and let you (and others) know.

Best Regards,

I’m afraid it’s not working for me…
I’ve got:

grep VM_ docker-compose.yml

  - VM_downsampling_period=30d:1h,90d:1d

even if I change in container:
5522 ? Sl 7:57 /usr/sbin/victoriametrics --promscrape.config=/etc/victoriametrics-promscrape.yml --retentionPeriod=365d --storageDataPath=/srv/victoriametrics/data --httpListenAddr= --downsampling.period=30d:1h,90d:12h --search.disableCache=true --search.maxQueryLen=1MB --search.latencyOffset=5s --search.maxUniqueTimeseries=100000000 --search.maxSamplesPerQuery=1500000000 --search.maxQueueDuration=30s --search.logSlowQueryDuration=30s --search.maxQueryDuration=90s --promscrape.streamParse=true --prometheusDataPath=/srv/prometheus/data --http.pathPrefix=/prometheus --envflag.enable --envflag.prefix=VM_

nothing happens…

ok, it seems envflag.prefix=VM_ doesn’t work… command line opts seems to work (after a couple of hours, disk space was reclaimed)