Loki queriers log `context canceled` and queries over 7 days time out
AdvancedTroubleshootingLogging: Loki, Fluent Bit and Elasticsearch
Answer
Likely causes → Broad stream selectors ({namespace=~".+"}) force reading huge chunk volumes; no query splitting or caching; query_timeout short.
Diagnose → Query stats in Grafana (bytes processed) and querier logs.
Fix → Narrow the selector, put line filters (|= "error") before parsers, enable split_queries_by_interval: 1h, results cache and chunks cache (memcached), raise query_timeout modestly.
Prevent → Teach teams the LogQL order: stream selector → line filter → parser → label filter.
More on Logging: Loki, Fluent Bit and Elasticsearch
Promtail/Alloy logs `server returned HTTP status 400 Bad Request (400): entry with timestamp ... ignored, reason: 'entry out of order' for stream`IntermediateAgents log `server returned HTTP status 429 Too Many Requests (429): Ingestion rate limit exceeded for user fake (limit: 4194304 bytes/sec)`IntermediateLoki rejects pushes with `Per stream rate limit exceeded (limit: 3MB/sec) while attempting to ingest for stream`AdvancedLoki logs `maximum active stream limit exceeded, reduce the number of active streams`AdvancedLogQL query fails with `max entries limit per query exceeded, limit > max_entries_limit (10000 > 5000)`BeginnerLogQL returns `too many outstanding requests` in GrafanaAdvanced