Skip to content
Snippets Groups Projects
Verified Commit 0107a7c2 authored by Yorick Peterse's avatar Yorick Peterse
Browse files

Fixed creating retention policies

parent 5b9fcebb
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -15,8 +15,17 @@ QUERIES = File.expand_path('../queries', __FILE__)
 
desc 'Sets up the retention policies'
task :policies do
CLIENT.query('CREATE RETENTION POLICY "default" ON gitlab DURATION 1h REPLICATION 1 DEFAULT')
CLIENT.query('CREATE RETENTION POLICY downsampled ON gitlab DURATION 7d REPLICATION 1')
db = ENV.fetch('INFLUX_DATABASE')
existing = CLIENT.list_retention_policies(db).map { |h| h['name'] }
unless existing.include?('default')
CLIENT.create_retention_policy('default', db, '1h', 1, true)
end
unless existing.include?('downsampled')
CLIENT.create_retention_policy('downsampled', db, '7d', 1)
end
end
 
desc 'Updates the continuous queries in the database'
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment