I have loki on my local windows pc i run loki fine and i can store and see logs with grafana, but i am not able to delete logs after a specific amount of time: Is this even a feature of Loki?
For reference this is my config.yaml
I am new with Grafana Loki but maybe I can help. Maybe try looking at this discussion:
I see you have everything as suggested under compactor except “compaction_interval” maybe that will help your issue. As far as I know compactor is the way forward as table manager is obsolete, so you should be on the right track. I have also read that Loki might remove your logs from Grafana view but it might take 24h before the chunks are deleted too, but at the moment I cannot find the link to this information. Perhaps try to see if anything has changed tomorrow?
retention_delete_delay is the amount of time between a chunk is marked for deletion and a chunk is actually deleted. For example, with your configuration, if it were working, would have chunks be deleted 10 minutes after injection.
I am not entirely sure why it’s not working for you, might help if you post your entire loki configuration. Also check for logs from compactor and see if there is anything obvious there.
Clearly you know something more than i do, but i’m really trying to work this out. I appreciate you helping me!
After a while i think i have part of the solution here:
Under compactor section in my YAML i added deletion_mode: filter-and-delete and this is able to delete the logs but only after 2h. By setting: retention_delete_delay: 1m this does not work. I used a timer to check and the logs will be deleted after aproximately 2h. I don’t know what is causing this tho. But now i know that my logs are being deleted after 2h…