How do you design log retention tiers?
IntermediateProductionLog Pipelines
Answer
| Tier | Data | Retention | Store |
|---|---|---|---|
| Hot | All app logs, searchable fast | 7–14 days | Loki/Elasticsearch/vendor |
| Warm | Important logs (errors, audit) | 30–90 days | Loki on object storage / ES warm nodes |
| Cold/Archive | Everything compressed | 1–7 years (compliance) | S3 with Glacier lifecycle |
Rehydrate from archive only when needed (Datadog rehydration, Athena over S3, Loki querying old chunks). Retention per stream in Loki is set with retention_stream overrides.
More on Log Pipelines
What does a production log pipeline look like end to end?BeginnerWhy structured (JSON) logging, and what fields should every log line have?BeginnerFluent Bit, Vector, Grafana Alloy or the OpenTelemetry Collector: how do you choose a log agent?IntermediateWhy add an aggregation tier instead of sending directly from agents to the backend?IntermediateHow do you scrub PII from logs in the pipeline?IntermediateHow and when do you sample logs?Intermediate