grafana / helm-charts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[loki-stack] Log retention does not work

mananpreetsingh opened this issue · comments

I am using https://github.com/grafana/helm-charts/tree/main/charts/loki-stack

Following is the values file

loki:
  enabled: true
  isDefault: false
  persistence:
    enabled: true
    accessModes:
    - ReadWriteOnce
    size: 50Gi
  compactor:
    working_directory: /data/loki/boltdb-shipper-compactor
    shared_store: filesystem
    retention_enabled: true
    retention_delete_delay: 1m
    retention_delete_worker_count: 150
  limits_config:
    retention_period: 48h
  # table_manager:
  #   retention_deletes_enabled: true
  #   retention_period: 24h

Tried both Table_manager and limits_config but nothing seems working. After apply I have restarted the loki pod as well.

Any suggestion here or if anyone tried setting it up?

I was able to figure it out. Anyone who is struggling, following config works with loki-stack chart version 2.10.2. Retention config should be inside loki.config

loki:
  enabled: true
  isDefault: false
  persistence:
    enabled: true
    accessModes:
    - ReadWriteOnce
    size: 50Gi
  config:
    compactor:
      retention_enabled: true
      retention_delete_delay: 1m. # by default is 2h, This is the delay when it starts cleaning up. So I would put it back to default values once disk is cleaned up so it continuously clean the disk.
    table_manager:
      retention_deletes_enabled: true
      retention_period: 60h