Prometheus: Copy-Paste PromQL Queries for Kubernetes
January 25, 2026•Salih Kayiplar
prometheus
monitoring
kubernetes
promql
Pods restarting or not running
rate(kube_pod_container_status_restarts_total[5m]) > 0
or
kube_pod_status_phase{phase!="Running", phase!="Succeeded"}
ArgoCD unhealthy apps
argocd_app_info{health_status!="Healthy"} > 0
ArgoCD out-of-sync apps
argocd_app_info{sync_status="OutOfSync"} > 0
Node CPU load (15m avg, normalized)
avg(node_load15) / count(node_cpu_seconds_total{mode="idle"}) > 0.8
Node memory > 85%
avg(
(node_memory_MemTotal_bytes - node_memory_MemFree_bytes
- node_memory_Buffers_bytes - node_memory_Cached_bytes)
/ node_memory_MemTotal_bytes
) > 0.85
Grafana alert rule (Terraform)
pods_crashing = {
name = "Pod Restarting Alert"
no_data_state = "OK"
condition = "rate(kube_pod_container_status_restarts_total[5m]) > 0"
triggered_after = "5m"
annotations = {
severity = "critical"
summary = "Pod keeps restarting for 5+ minutes"
todo = "kubectl logs <pod> -n <ns> --previous"
}
labels = {
team = "devops"
send_to = "teams_channel_devops"
}
}
Gotcha
- Always use a
forduration (e.g.5m) in alert rules — otherwise rolling deployments trigger false alerts node_load15 > 1is meaningless on multi-core nodes — normalize by CPU count- The ArgoCD queries require the ArgoCD metrics exporter to be enabled (
server.metrics.enabled: true)
Ready to scale your cloud infrastructure?
Let's discuss how CloudCops can help you build secure, scalable, and modern DevOps workflows. Schedule a free discovery call today.
Related Snippets
Kubernetes Useful Commands Cheat Sheet
Battle-tested kubectl commands for daily cluster operations — pod cleanup, version checks, network debugging, bulk patching, and more.
Feb 15, 2026
kubernetes
kubectl
bash
Zalando Postgres Operator: Backup & Restore on Azure
Complete guide to setting up WAL-G backups with Azure Blob Storage for the Zalando Postgres Operator, including restore procedures and troubleshooting.
Feb 10, 2026
kubernetes
postgresql
azure
Access Kubernetes Nodes Without SSH
Get a root shell on K8s nodes when SSH is blocked — kubectl debug, nsenter, and systemctl access.
Feb 5, 2026
kubernetes
debugging
security