fluent-bit
fluent-bit copied to clipboard
rewrite_tag generates one chunk of 500 MB instead of splitting those into the smaller ones (exceeds memory limit 50 times)
Bug Report
Describe the bug We detected problem when using rewrite_tag on a high load:
- rewrite_tag generates one chunk of 500 MB instead of splitting those into the smaller ones (exceeds memory limit 50 times). As a result, the output plugin tries to send request of 500 MB to the vendor. Most of the vendors do not support requests with a payload of more than 2-5 MB.
- rewrite_tag default mem_limit is 10 MB but for some reason, that limit is ignored and exceeded 50 times (the real usage is 500MB)
To Reproduce
[SERVICE]
# Flush
# =====
# Set an interval of seconds before to flush records to a destination
Flush 5 # Storage (buffers)
# ======
# storage.path /mnt/services/buffers
storage.metrics On # Daemon
# ======
# Instruct Fluent Bit to run in foreground or background (Daemon) mode.
Daemon Off
Log_File /mnt/logs/fluent-bit.log # Log_Level
# =========
# Set the verbosity level of the service, values can be:
# [ error | warning | info | debug | trace ]
#
# By default 'info' is set, that means it includes 'error' and 'warning'.
Log_Level info # Parsers_File
# ============
# Specify an optional 'Parsers' configuration file
Parsers_File config/parsers.conf
Parsers_File config/parsers-static.conf # HTTP Server
# ===========
# Enable/Disable the built-in HTTP Server for metrics
HTTP_Server On
HTTP_Listen 0.0.0.0
HTTP_Port 2020
[INPUT]
Name tail
Alias tail_docker
Tag *
Path /mnt/docker/containers/*/*-json.log
Parser docker
DB /etc/fluent-bit/flb.db
Read_from_Head On
Rotate_Wait 30
[FILTER]
Name rewrite_tag
Alias rewrite_tag_docker_attrs
Match mnt.docker.containers.*.*.log
Rule $attrs['tag'] ^(.*)$ $0 false
[OUTPUT]
Name bigquery
Match *
google_service_credentials /secrets/secret.json
project_id project_id_goes_here
dataset_id tables
table_id table_id_goes_here$20210518
Storage Metrics
{
"storage_layer": {
"chunks": {
"total_chunks": 1,
"mem_chunks": 1,
"fs_chunks": 0,
"fs_chunks_up": 0,
"fs_chunks_down": 0
}
},
"input_chunks": {
"tail_docker": {
"status": {
"overlimit": false,
"mem_size": "0b",
"mem_limit": "0b"
},
"chunks": {
"total": 0,
"up": 0,
"down": 0,
"busy": 0,
"busy_size": "0b"
}
},
"emitter_for_rewrite_tag_docker_attrs": {
"status": {
"overlimit": true,
"mem_size": "518.4M",
"mem_limit": "9.5M"
},
"chunks": {
"total": 1,
"up": 1,
"down": 0,
"busy": 1,
"busy_size": "518.4M"
}
}
}
}
Expected behavior
- mem_size < mem_limit
- chunks of 500MB are not set to output plugin
Screenshots
Your Environment
- Version used: 1.7.4
- Configuration:
- Environment name and version (e.g. Kubernetes? What version?): Amazon Linux
- Server type and version:
- Operating System and version:
- Filters and plugins: rewrite_tag
Additional context
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.