Interview Prep/Monitoring & Observability/Logging: ELK/EFK, Loki & Log Shippers

How do Loki retention and deletion work?

AdvancedConceptLogging: ELK/EFK, Loki & Log Shippers
Answer

Retention is enforced by the compactor:

compactor:
  retention_enabled: true
  delete_request_store: s3
limits_config:
  retention_period: 744h
  retention_stream:
    - selector: '{namespace="dev"}'
      priority: 1
      period: 72h

Per-tenant and per-stream retention is supported. Log-line deletion (for GDPR) uses delete requests via the API, processed by the compactor. Object storage lifecycle rules alone are unsafe because they delete chunks the index still references.

All Monitoring & Observability questions Roadmap: Logging & tracing

More on Logging: ELK/EFK, Loki & Log Shippers