The issue is with the size of the blocks being created and how the block size calculation appears to behave differently for time based vs size based retention settings. Just before we hit our retention limit (2.5T) we can query ~30 days of metrics, when we hit the limit the oldest block is removed and the size of that block often uncomfortably large. The example block I gave in my first email is 1.1T which represents about 14 days of data, so when that block is the oldest and we hit our size based retention limit 14 days of data will disappear at once, because Prometheus removes whole blocks at a time.
The thing that is odd is that I expect the behaviour around retention limits to be the same regardless of whether you are using just time based retention, just size based retention, or a combination of both. If I had used a time based retention of 30 days (currently roughly equivalent to my size limit of 2.5T) then instead of losing 14 days worth of data when we hit the limit we would lose 3 days of data or ~ 10%.
We don't wish to use time based retention at the moment because the amount of samples we ingest daily is in flux. So how can I ensure we get reasonably sized blocks (blocks <= 10% of storage.tsdb.retention.size)?
This e-mail together with any attachments (the "Message") is confidential and may contain privileged information. If you are not the intended recipient or if you have received this e-mail in error, please notify the sender immediately and permanently delete this Message from your system. Do not copy, disclose or distribute the information contained in this Message.
Maven Investment Partners Ltd (No. 07511928), Maven Investment Partners US Ltd (No. 11494299), Maven Europe Ltd (No. 08966), Maven Derivatives Asia Limited (No.10361312) & Maven Securities Holding Ltd (No. 07505438) are registered as companies in England and Wales and their registered address is Level 3, 6 Bevis Marks, London EC3A 7BA, United Kingdom. The companies’ VAT No. is 135539016. Maven Asia (Hong Kong) Ltd (No. 2444041) is registered in Hong Kong and its registered address is 20/F, Tai Tung Building, 8 Fleming Road, Wan Chai, Hong Kong. Maven Europe Ltd is authorised and regulated by the Financial Conduct Authority (FRN:770542). Maven Asia (Hong Kong) Ltd is registered and regulated by the Securities and Futures Commission (CE No: BJF060).