Repository navigation
QuestionBackground The Kubernetes cluster uses Docker with the json-file log driver. Docker log rotation: max files: 8 Real Docker log files are stored under: /data1/docker/containers/<container_id>/ Kubernetes pod log paths are symlinks: /var/log/pods///0.log Issue 1: Some Vector pods keep around 2K seconds source lag Metric: vector_source_lag_time_seconds_bucket We tried increasing Vector CPU limit to 6 cores and increasing max_read_bytes to 4MB, but it did not help much.
The source read throughput still stays around ~ 12MB/s
After increasing CPU and max_read_bytes, the read throughput did not improve significantly, and the source lag still stayed around 2K seconds. On the sink side, we checked: vector_kafka_queue_messages_bytes It stays very stable around ~ 500KB
So this does not look like Kafka sink backpressure or producer queue accumulation. Another important observation: during business low-traffic hours, the lag can fully recover back to 0. This suggests that Vector's current consumption capacity is not enough during peak traffic, but we are not sure where the bottleneck is. Issue 2: Incorrect log interleaving when multiple watchers exist for the same container For example, Vector may hold multiple file descriptors for the same container: <container_id>-json.log When this happens, we sometimes see log interleaving/corruption. A large application log line is split by Docker into multiple 16KB JSON log records. Vector is expected to merge only fragments from the same original log line. However, in the actual query result, fragments from different logs can be merged together. Sometimes a fragment from another log appears in the middle of the merged log. This problem happens frequently during peak traffic, but rarely happens during business low-traffic hours. Our current suspicion is: high source lag Please help confirm whether this is an expected limitation, a configuration issue, or a correctness bug in Vector ConfigapiVersion: v1 Vector LogsNo response |
Replies: 1 comment
|
With Docker json-file log driver and 8 files at 100MB each, that's up to 800MB per container. If Vector is scanning all of these, the source lag makes sense — it's probably falling behind trying to read through rotated files. A few things I'd check: make sure For the Docker log merging issue, the json-file driver splits long log lines across multiple JSON entries, and Vector should be merging them back. If you're seeing incorrect merges, it might be a timing issue where logs from different containers in the same pod are getting interleaved. Check if |



With Docker json-file log driver and 8 files at 100MB each, that's up to 800MB per container. If Vector is scanning all of these, the source lag makes sense — it's probably falling behind trying to read through rotated files.
A few things I'd check: make sure
ignore_older_secsis set on thekubernetes_logssource so Vector doesn't try to read all 8 rotated files on startup. Something likeignore_older_secs: 600would skip files that haven't been modified in 10 minutes.For the Docker log merging issue, the json-file driver splits long log lines across multiple JSON entries, and Vector should be merging them back. If you're seeing incorrect merges, it might be a timing issue where logs fro…