Loki ingestion is failing with `stream limit exceeded` and the ingester memory is exploding. What happened?
IntermediateScenarioLogging Pipelines
Answer
Situation read → A high-cardinality label was added to log streams. Every unique label set is a new stream, so Loki is creating millions of tiny streams.
What I'd do →
- Find the offending label:
logcli series '{}' --analyze-labelsor checkloki_ingester_memory_streamsper tenant. - Remove labels like
request_id,user_id,pod_ip,status_codefrom the shipper config; keep them in the log line. - Query them at read time with
| json | user_id="42"or structured metadata (Loki 3.x). - Keep
max_global_streams_per_useras a guardrail rather than raising it blindly.
Why → Loki indexes labels only. Few labels with high volume per stream is the design point.
Interview tip → Rule of thumb: labels describe where a log came from, not what it says.
More on Logging Pipelines
Developers SSH into servers and `grep` log files to debug. You are asked to centralise logging. Where do you start?BeginnerYour app writes free-text logs like `User 42 paid 19.99 in 340ms`. Why push for structured logging, and how?BeginnerFluent Bit pods on busy nodes are dropping logs during traffic spikes. How do you make the pipeline lossless?IntermediateThe Elasticsearch cluster for logs goes red every Monday after the weekend batch jobs. How do you stabilise it?AdvancedFinance says the log bill doubled in a quarter. How do you cut it without losing debugging ability?IntermediateA Java stack trace shows up in Kibana as 40 separate log events. How do you fix it?Beginner