Project

General

Profile

action #94492

Updated by ilausuch almost 3 years ago

## Motivation 

 Currently the default retention period is in-place: 

 ``` 
 > use telegraf 
 Using database telegraf 
 > show retention policies 
 name      duration shardGroupDuration replicaN default 
 ----      -------- ------------------ -------- ------- 
 autogen 0s         168h0m0s             1          true 
 ``` 

 According to the documentation that means we store the data infinitely¹. 

 It would be possible to configure a time-based retention policy per database (we store all our monitoring data in one database called `telegraf`): https://docs.influxdata.com/influxdb/v1.8/query_language/manage-database/#create-retention-policies-with-create-retention-policy 
 This raises the question which durations we'd like to configure. It would also make sense to "[downsample and retain data](https://docs.influxdata.com/influxdb/v1.8/guides/downsample_and_retain/)" to store data with less granularity over time. 

 I haven't found anything about disk-space-based retention policies within the documentation of InfluxDB so I **assume** this is not an option. 

 --- 

 ¹ 
 > When you create a database, InfluxDB creates a retention policy called autogen with an infinite duration… 

 ## Acceptance Criteria 

 * **AC 1**: The directory /var/lib/influxdb has significanlly less than 120GB.  

 ## Suggestions 

 * Ensure we have a backup before the process remove data 
 * Check what the current InfluxDB provides 
 * We want at least 6 months of data to rollback checks. But can be downsampling. 
 * If we have downsampling, at least 1 month of full data

Back