purgeretentiongrafana-loki

table manager does not purge chunk in loki 2.4


I wanted to have a deletion of chunk data older than 31 days so I made such config

schema_config:
  configs:
    - from: 2020-10-24
      store: boltdb-shipper
      object_store: filesystem
      schema: v11
      index:
        prefix: index_
        period: 24h

storage_config:
  boltdb_shipper:
    active_index_directory: "/var/lib/loki/boltdb-shipper-active"
    cache_location: "/var/lib/loki/boltdb-shipper-cache"
    cache_ttl: 24h 
    shared_store: filesystem
  filesystem:
    directory: /var/lib/loki/chunks

chunk_store_config:
  max_look_back_period: 0s

table_manager:
  retention_deletes_enabled: true
  retention_period: 31d

but actually the deletion never happen.

did I forget something in the configuration ?

loki version: 2.4.1


Solution

  • I'm not sure it's your case, but starting on the Loki 2.4.0, the single binary no longer runs a table-manager, this impacts anyone in the following scenarios:

    1. Running a single binary Loki with any index type other than boltdb-shipper or boltdb
    2. Relying on retention with the configs retention_deletes_enabled and retention_period

    See more info and how to resolve this issue, in the Loki Upgrade Guide, here.