Interview Prep/Monitoring & Observability/Kubernetes monitoring and the Prometheus Operator

PrometheusRule created but rules don't show in Prometheus

IntermediateTroubleshootingKubernetes monitoring and the Prometheus Operator
Answer

Likely causes → ruleSelector/ruleNamespaceSelector mismatch, or the admission webhook rejected invalid PromQL.

Diagnose →

kubectl get prometheusrule -A --show-labels | grep myrules
kubectl get cm -n monitoring | grep rulefiles
kubectl logs -n monitoring deploy/prometheus-operator | grep -i rule

Fix → Add the selector label, fix the expression (promtool check rules on the extracted spec).

Prevent → Keep the Operator's admission webhook enabled so bad rules fail at kubectl apply.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Kubernetes monitoring and the Prometheus Operator