A query fails with `query processing would load too many samples into memory in query execution`
IntermediateTroubleshootingPrometheus storage, memory and cardinality
Answer
Likely causes → The query touches more samples than --query.max-samples (default 50,000,000), usually a long range over a high-cardinality metric with a small step.
Diagnose → Re-run with a shorter range and check count(<selector>) to see the series count.
Fix → Add label filters, aggregate earlier (sum by (job) (rate(...))), use a recording rule, or increase the step. Raise the limit only if memory allows.
Prevent → Back expensive dashboard panels with recording rules.
More on Prometheus storage, memory and cardinality
Prometheus pod restarts with `OOMKilled` every few hoursIntermediateHead series jumped from 2M to 9M after a deployAdvancedPrometheus logs `opening storage failed: ... unexpected EOF` / `corruption in segment` and won't startAdvancedPrometheus is in CrashLoopBackOff with `no space left on device`BeginnerPrometheus takes 15 minutes to become ready after a restartAdvancedPrometheus is killed by the liveness probe during startup in a loopIntermediate