PodMonitor targets show `DOWN` with `connection refused` on port 8080 while the app listens on 9090
BeginnerTroubleshootingKubernetes monitoring and the Prometheus Operator
Answer
Likely causes → podMetricsEndpoints[].port names a container port that isn't the metrics port, or the container doesn't declare ports at all.
Diagnose → kubectl get pod <pod> -o jsonpath='{.spec.containers[*].ports}'.
Fix → Declare - name: metrics, containerPort: 9090 in the pod spec and use port: metrics.
Prevent → Lint deployments for a named metrics port.
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`IntermediateServiceMonitor target appears but Operator logs `skipping servicemonitor ... failed to get secret`AdvancedPrometheusRule 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