Skip to main content

CRE-2025-0090

Loki Log Line Exceeds Max Size LimitLow
Impact: 5/10
Mitigation: 5/10

CRE-2025-0090View on GitHub

Description

Alloy detects the Loki is dropping log lines because they exceed the configured maximum line size.

This typically indicates that applications are emitting extremely long log entries, which Loki is configured to reject by default.


Cause

Loki has a `max_line_size` limit (defaulting to 256KB) to prevent excessively large log entries from consuming too many resources.

When a log line from an application exceeds this limit, Loki rejects it, leading to data loss for that specific log entry.


Mitigation

To resolve this issue, you can adjust Loki's runtime configuration to either:


  1. Increase `max_line_size`: Allow Loki to accept larger log lines. Be cautious when increasing this significantly,

as it can impact Loki's performance and memory consumption.

  1. Enable `max_line_size_truncate`: Configure Loki to automatically truncate log lines that exceed the limit

instead of dropping them entirely. This preserves the beginning of the log message.


You can apply these changes via Loki's runtime configuration overrides, typically in a YAML file like this:


---overrides:  limits_config:    max_line_size: 10485760 # Set to 10MB (10 * 1024 * 1024 bytes)    max_line_size_truncate: true

Ensure that your Loki deployment is configured to load this runtime override file.


References