Loki: We need a beginner-friendly example for data retention

Created on 15 Jun 2020  路  5Comments  路  Source: grafana/loki

Is there a beginner-friendly example anywhere on how to configure data retention? I think this is really important for production users.

I just installed Loki using helm with this configuration.

    config:
      table_manager:
        retention_deletes_enabled: true
        retention_period: 120h

And then I got this error retention period should now be a multiple of periodic table duration. What is the periodic table duration? Can we have an example in the documentation, please. Thanks.

All 5 comments

@bzon period config is part of your schema config. You can find period configuration here https://github.com/grafana/loki/tree/master/docs/configuration#period_config

Thanks @adityacs I will test it out

Hi @adityacs if I want to have a 15d data retention, all data deleted, can you help me achieve this? I tried using the period_config and it is not very straightforward. There are two duration there with a default of 168h.

period under index is what you are looking for. chunk is for storing chunks in tables and it is not a good idea to store loki chunks in tables because their size is big compared to cortex chunks.
Set retention to multiple of index.period.

thanks @sandeepsukhani my final working configuration now is:

    config:
      table_manager:
        retention_deletes_enabled: true
        retention_period: 336h # or 14d, because the default index period is 168h
Was this page helpful?
0 / 5 - 0 ratings

Related issues

steven-sheehy picture steven-sheehy  路  4Comments

TakumaNakagame picture TakumaNakagame  路  5Comments

setevoy2 picture setevoy2  路  4Comments

Horkyze picture Horkyze  路  5Comments

suppix picture suppix  路  3Comments