I am storing 500 MB of logs (at once and a few MB of logs add up daily) in Loki using Promtail.
I need to gather logs annually to do a report but when querying Loki with LogCLI (I use Minio to store the logs with Loki) there are a lot of missing logs, I get around 5MB of logs when it should be around 500MB.
I have a few questions: Is it a good practice to store logs like that using Loki to do reporting? Loki works well for logs monitoring in live but am I not using it correctly/not for the right purpose when it comes to storing logs on long periods to do annual reports? maybe I should use another system to store the logs for reporting? How do most users do reports from their logs?
Anyways, I set the retention period to a year and indeed when querying I have logs that are old (11 months) but there are still missing ones that should be present in that year.
Thank you for your help, I feel like there is something I don’t understand about Loki when it comes to logs and reporting/logs analytics (not log monitoring).
I don’t think there is any problem with storing logs for long period of time. I am sure there are people storing logs for just as long, if no longer, than you do, with a lot more volume.
What is your storage usage on Minio? Do you see the expected amount of storage used? Also print out the current configuration with the /config API endpoint, and review all limits configuration (such as max_query_length).
Are you sure your logs are actually stored in minio? Since you are setting maximum chunk age to 7 days, try querying for anything past 7 days and see if there is any result.
I suspect your storage configuration may be incorrect. If you expected 500MB of total logs then your minion storage should definitely have more than 1.5MB in there. Check and see what’s actually on your minion storage as well.