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

Operator-generated config fails reload: `relabel configuration for replace action requires 'target_label' value`

AdvancedTroubleshootingKubernetes monitoring and the Prometheus Operator
Answer

Likely causes → A ServiceMonitor relabelings/metricRelabelings entry is missing targetLabel, breaking the whole generated config.

Diagnose →

kubectl logs prometheus-k8s-0 -n monitoring -c config-reloader
kubectl logs prometheus-k8s-0 -n monitoring -c prometheus | grep -i 'error loading config'

Fix → Add targetLabel; find the offending ServiceMonitor from the job name in the error.

Prevent → Keep the admission webhook on; newer Operator versions validate relabelings and reject the resource.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Kubernetes monitoring and the Prometheus Operator