Pipeline Presets
Fluent Bit to Grafana Loki Batch Compression & Label Hygiene
Prevent Loki high-cardinality OOM crashes by stripping pod UUIDs from stream labels, packing structured metadata, and enabling gzip + 4 workers.
Low Cardinality · Gzip Batch · 4 Workers · Sub-50ms Push
The Cardinality Trap in Loki Pipelines
Mapping dynamic container IDs or user IDs into Loki stream labels spawns millions of tiny index streams that exhaust ingester RAM. Keep labels strictly to bounded cluster/service dimensions and parse fields at query time.
Aligning Loki Rate Limits With Retry_Limit
When Loki returns HTTP 429 during compaction, bounded retries paired with filesystem chunking let Fluent Bit pause gracefully on disk rather than discarding logs or spiking memory.
Measured Parameters & Shipper Configuration Directives
| Loki Parameter | Recommended Setting | Operational Reason |
|---|---|---|
| Stream Labels | env, app, namespace only (max 4 labels) | Never put request_id, IP, or trace_id into Loki stream labels |
| Compression | Compress gzip · Workers 4 | Reduces Loki ingester HTTP payload size by ~75% |
| Line Format | Line_Format json · Drop_Single_Key off | Preserves queryable LogQL JSON fields without label explosion |
| Retry Policy | Retry_Limit 5 + storage.type filesystem | Prevents 429 rate-limit loops from stalling container tailing |