What's Actually Happening
Prometheus targets show as down in the UI. Metrics are not being collected from the target endpoints.
The Error You'll See
In Prometheus UI at /targets:
``
State: DOWN
Error: Get "http://target:9090/metrics": dial tcp: connection refused
Why This Happens
- 1.Target service not running
- 2.Wrong scrape URL
- 3.Network connectivity issues
- 4.Firewall blocking
- 5.Authentication required
Step 1: Check Target Status
curl http://localhost:9090/api/v1/targets
curl http://target-host:9090/metricsStep 2: Check Prometheus Config
scrape_configs:
- job_name: 'my-app'
static_configs:
- targets: ['target-host:9090']Step 3: Check Network
nc -zv target-host 9090
ping target-hostStep 4: Check Target Service
systemctl status myapp
docker ps | grep myappStep 5: Check Logs
journalctl -u prometheus -f
docker logs prometheusStep 6: Verify Endpoint
curl -v http://target-host:9090/metrics
curl http://target-host:9090/-/healthyStep 7: Check Firewall
iptables -L -n | grep 9090
firewall-cmd --list-portsStep 8: Reload Config
curl -X POST http://localhost:9090/-/reload
systemctl reload prometheusStep 9: Check Service Discovery
curl http://localhost:9090/api/v1/targetsStep 10: Monitor Targets
watch -n 5 'curl -s http://localhost:9090/api/v1/targets | jq ".data.activeTargets[] | {job: .labels.job, health: .health}"'Related Issues
- [Fix Prometheus Query Timeout](/articles/fix-prometheus-query-timeout)
- [Fix Grafana Dashboard Not Loading](/articles/fix-grafana-dashboard-not-loading)