loki retention in k8s

Requirements:

  • running the loki-stack chart, tested with version 2.8.7
  • filesystem persistence enabled (ie not shipping to s3, gcs etc), which is the default in the chart

To enable retention you need to have the following configs:

1
2
3
4
5
6
loki:
  config:
    compactor:
      retention_enabled: true
    limits_config:
      retention_period: 336h