How to restore Loki

hi everyone just question about restore

i’m using helm in k8s and config settings

loki:

compactor:
working_directory: /home/test/kubernetes/loki/data/
compaction_interval: 10m
retention_enabled: true
retention_delete_delay: 2h
retention_delete_worker_count: 150
delete_request_store: gcs

Chunk and index files are created in that folder (compactor-1245134…r.gz).

Are you restoring with these files?

I can’t find any posts about restoration, what am I doing wrong?

What do you mean by “restoration”?

Thank you for your response. From what I understand, Grafana Loki has a feature (e.g., compactor) that allows the preservation of chunks and indexes. This feature keeps the chunks for a specified amount of time.

What I am looking for is a way to have the chunks deleted after 7 days and to back up the logs for those 7 days separately, so that even after time has passed, the 7-day logs can be re-uploaded and reviewed. Is there a feature that supports this?

Your description is a bit weird. Compactor doesn’t “preserve” chunks and indexes. Chunks and index files are stored in the backend storage indefinitely. Compactor is the component that removes chunks and index files after a configured retention period.

In my opinion if you wish to keep logs up to potentially 14 days it’s simply much easier and cheaper to just keep them for 14 days in storage solution such as S3, rather than having to figure out another storage solution (which is most likely not free), and in the event that you need to restore it you’ll likely spend more engineering hours than what it takes to store 14-day worth of logs.

2 Likes

Even though my explanation was lacking, thank you so much for explaining it so well. Have a great day :slight_smile: