-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Bug Report
Describe the bug
Fluent Bit memory increases linearly and unbounded when the following conditions occur together:
- The input uses storage.type=filesystem
- A rewrite_tag filter uses that same field (e.g., $type)
- The rewrite_tag rule has keep=false
If any one of these conditions is removed, memory stabilizes normally.
The leak reproduces with both real logs (OpenTelemetry) and dummy input.
This issue is present in at least:
Fluent Bit 4.0.10 and 4.2.0 (Docker official images).
To Reproduce
Minimal Log Example:
{"event":"payment","amount":19.99,"currency":"EUR","meta":{"method":"card","country":"DE"}}
Minimal Reproducer (this configuration leaks memory):
service:
storage.path: /fluent-bit/storage
pipeline:
inputs:
- name: dummy
tag: v1_logs
dummy: '{"event":"payment","amount":19.99,"currency":"EUR","meta":{"method":"card","country":"DE"}}'
rate: 55000
storage.type: filesystem
filters:
- name: rewrite_tag
match: 'v1_logs'
rule: $event ^(.+)$ $1 false
outputs:
- name: stdout
match: "*"
Steps to reproduce the problem
- Save the config above as config.yaml
- Run Fluent Bit via Docker:
mkdir -p fb-storage
docker run --rm -it \
-v $(pwd)/config.yaml:/fluent-bit/etc/config.yaml \
-v $(pwd)/fb-storage:/fluent-bit/storage \
fluent/fluent-bit:4.2.0 \
-c /fluent-bit/etc/config.yaml
- Monitor memory (e.g., docker stats or Kubernetes metrics)
- Memory increases continuously without plateau
Expected behavior
- Fluent Bit memory usage should stabilize after initial warm-up.
- No long-term linear RSS growth under a steady input rate.
- rewrite_tag + filesystem storage should not retain unbounded memory.
My Environment
Version used: 4.0.10, 4.2.0
Configuration: minimal reproducer included above
Environment: Docker + Kubernetes
Input type: dummy or OpenTelemetry (reproduces on both)
Server OS: Linux
Filters involved:
rewrite_tag (with keep=false)
filesystem storage on input
Additional context
- The leak only happens in this strict combination:
filesystem input
→ rewrite_tag uses existing field with keep=false
→ RSS memory grows without bound
- This affects production workloads: after several hours/days Fluent Bit pods exceed memory limits and get OOMKilled.
- This memory leak occurs only when Fluent Bit runs on containerd 1.7.27 and does not occur on containerd 2.0.0