When Grafana Loki misbehaves, the cause is usually one of a handful of familiar issues. Here is how to spot and fix them fast.
The usual suspects
- High-cardinality labels (like request_id) destroying performance
- Pushing huge log volumes without retention or limits
- Expecting full-text indexing - Loki filters, it doesn't index content
Commands for diagnosis
LogQL queries for filtering and metrics from logs.
{job="varlogs"} |= "error" | logfmt | status >= 500
# turn logs into a rate metric
sum(rate({app="web"} |= "panic" [5m]))Prevent the repeat
- Keep labels low-cardinality; filter within the stream using LogQL
- Set per-tenant retention and ingestion limits
- Structure logs (logfmt/JSON) so LogQL parsers work well
Want senior help putting Grafana Loki to work - or a team bootcamp on it? CodeWizard runs Israel's largest DevOps community and embeds named senior engineers with a transparent hours log. Book a free consult or explore the Academy.