I’m using Loki and storing the compressed log data locally to the filesystem. I know it’s possible to change the log retention time. But is it possible to start deleting the oldest compressed logs once the file size reaches a certain point. For example 10GB?
I don’t believe retention by size is possible currently. What you can do, however, is that you can still manually delete the chunks if you want (with a script), by sorting all chunks from a filesystem standpoint and remove the oldest ones first.
The caveat is obviously you won’t be able to query the logs anymore even though the index is still there, which may be confusing for end users. And the index should be cleared out by compactor when the actual retention is up, but you’ll see some errors such as chunks not found.