Graphite: How to modify the default retention?


To modify the default retention for all metrics modify storage-schemas.conf file.
So for example if you have Graphite installed at /opt/graphite then do the following:

vi /opt/graphite/conf/storage-schemas.conf

In version 0.9.10 there should be an entry for [default_1min_for_1day] which holds the .* pattern. You can obviously change the name but in order to apply the schema to all metrics you need to keep the metrics as this. You can also start defining different schemas for different metrics. In this case we’re going to change the retention for all metrics. Here’s the original retention in storage-schemas.conf.example:

[default_1min_for_1day]
pattern = .*
retentions = 60s:1d

The following changes the retention policy for all metrics to keep every 1 min for 365 days and afterwards one datapoint every 5 mins for 3 years.

[default_1min_for_1day]
pattern = .*
retentions = 60s:365d,300s:1095d

  • Its important to note that the higher retention policy the bigger disk space needed to store the data.

  • Graphite looks at the schemas and matches them to a pattern. So as it is reading the file it will apply the schema as it matches it in the file. So as I understand it the order of schemas will matter.

  • Any existing metrics created will not automatically adopt the new schema. You must use whisper-resize.py to modify the metrics to the new schema. The other option is to delete existing whisper files (/opt/graphite/storage/whisper) and restart carbon-cache.py for the files to get recreated again.

  • Restart of carbon-cache.py is required after making the change.

  1. No comments yet.
(will not be published)
*