ServiceMonitor target appears but Operator logs `skipping servicemonitor ... failed to get secret`
AdvancedTroubleshootingKubernetes monitoring and the Prometheus Operator
Answer
Likely causes → The ServiceMonitor references a basic auth / bearer / TLS Secret that is in a different namespace or missing; the Operator only reads Secrets in the ServiceMonitor's namespace.
Diagnose →
kubectl logs -n monitoring deploy/prometheus-operator | grep -i 'servicemonitor\|secret'
kubectl get secret -n shop
Fix → Create the Secret in the same namespace as the ServiceMonitor and reference it via basicAuth/authorization.credentials.
Prevent → Keep secrets beside the ServiceMonitor in the app's Helm chart.
More on Kubernetes monitoring and the Prometheus Operator
A new ServiceMonitor is not picked up by the Prometheus OperatorIntermediateServiceMonitor is selected but its targets don't appear on `/targets`IntermediatePodMonitor targets show `DOWN` with `connection refused` on port 8080 while the app listens on 9090BeginnerPrometheusRule created but rules don't show in PrometheusIntermediate`KubeletDown` / `TargetDown` alerts fire for kube-scheduler and kube-controller-manager on EKS/GKEBeginnerOn kubeadm clusters, `kube-controller-manager` and `kube-scheduler` targets are `DOWN` with `connection refused`Intermediate