Prometheus Targets All Down and No Data — A Troubleshooting Decision Tree
I have hit this more than once: I finish a Prometheus deployment, open Grafana, and the whole dashboard is a blank grey rectangle. I go to /targets and half the rows are red. The state is called "installed but no data", and it is the most time-wasting kind of failure because the possible causes are scattered across network, config, relabel, and the service layer. After the first few of these, I built a small decision tree for myself that separates the failure into segments and then executes the matching fix. Usually I can pin the root cause in under an hour.
Step 1: Decide whether the fault is in the scrape segment or the query segment
Open the Prometheus Web UI under Status and go to Targets. The single most useful thing to read is the state column.
| State | Meaning | Where to go next |
|---|---|---|
| down | Nothing was scraped | Scrape segment: network / port / auth / exporter |
| up but the query returns empty | Scraped something, not the metric you want | Query segment: metric name / relabel / PromQL |
| up and the metric has values | Everything is fine | You queried the wrong panel; check the dashboard |
This one split shortens every later step.
Step 2: If the target is down, branch on the error message
Open a down target and read the Last Scrape message. Three buckets cover almost everything I have seen.
2.1 connection refused or i/o timeout
This is the network layer. Walk the path from the Prometheus host to the target exporter in order:
# from the machine that runs Prometheus, test the target port directly
curl -v http://<target-host>:<port>/metrics
# if that is closed, check three things
ps -ef | grep -E "node_exporter|cadvisor" # is the exporter actually up?
sudo iptables -L -n | grep <port> # is the firewall blocking it?
kubectl get svc -n monitoring # K8s: is the service still published?
I once had a target on 10.0.1.15 with Prometheus on a different node, and the firewall was blocking the whole 9100-9105 range. Opening that range brought the target back to up within ten minutes.
2.2 401 / 403
This is the auth layer. The scrape_configs job has basic_auth or a bearer token that does not match what the target actually expects, or the target started requiring auth and the config was never updated.
curl -s http://localhost:9090/api/v1/targets | jq '.data.activeTargets[] | select(.scrapeUrl|contains("9100"))'
Align the username, password, and tls_config three-piece set with what the target is really configured for.
2.3 TLS handshake failed
The target is HTTPS but the scrape config has no tls_config, or the CA is missing.
scrape_configs:
- job_name: node-exporter-tls
tls_config:
ca_file: /etc/prometheus/ca.crt
insecure_skip_verify: false
basic_auth:
username: prom
password_file: /etc/prometheus/prom-pass
Step 3: If the target is up but the query is empty
A target showing up still leaves three ways to end up with a blank dashboard.
3.1 The metric name does not exist
curl -s http://localhost:9090/api/v1/label/__name__/values | jq -r '.data[]' | head -100
curl -s "http://localhost:9090/api/v1/query" --data-urlencode 'query=up{instance="10.0.1.15:9100"}'
If the metric you are querying is missing from that list, the exporter is not exposing it. Hit the exporter directly and read what it actually publishes:
3.2 A relabel rule renamed or dropped the label
This is the one that bit me hardest. I added a metric_relabel rule to filter some metrics and wrote the regex wrong, so it dropped every node metric. The target stayed up but the query returned nothing.
curl -s "http://localhost:9090/api/v1/query?query=up" | jq '.data.result'
curl -s "http://localhost:9090/api/v1/series?match[]=up" | jq '.data[0].metric'
When you add metric_relabel, always pair it with an allow-list regex such as ^(node_.*|up|process_.*|prometheus_.*).*$ so you do not wipe out the metrics you actually want.
3.3 Kubernetes: the ServiceMonitor was deleted or its labelSelector drifted
When every target in a cluster goes down, the first three checks I run are:
kubectl -n monitoring get pod -l app.kubernetes.io/name=prometheus
kubectl -n monitoring get servicemonitor -o wide
kubectl -n monitoring get servicemonitor <name> -o yaml | grep -A5 selector
kubectl -n monitoring logs deploy/prometheus-server --tail=200 | grep -E "error|scrape"
Once I found a teammate who had edited the ServiceMonitor namespace by hand, so the selector no longer matched any pods and Prometheus stopped scraping entirely. Every target turned down with "no targets" in Last Scrape. Reverting the selector brought it back to life in thirty seconds.
Step 4: Do not just stare at the targets — scrape interval and retention make data "invisible"
Everything above assumes the data is genuinely missing. There is a common false alarm where the data is being written the whole time, you just do not see it when you look. Three parameters cause this.
First, the scrape interval is too long. If scrape_interval is set to 60 seconds and you zoom the Grafana time range out to a year, the points are a minute apart and the small window looks empty. Confirm the real interval from the status flags:
Second, retention is too short and the old data was pruned. I saw a node whose retention was misconfigured to 2 hours; the team thought monitoring was dead when in fact the three-day-old curves had been cleaned out. Read the active retention window:
curl -s http://localhost:9090/api/v1/status/runtimeinfo | jq '{tsdb_retention: .data.tsdb.retention.time, tsdb_max: .data.tsdb.versions}'
Third, a recording rule did not run or was written wrong. Many teams speed things up by precomputing frequently used queries as recording rules, and if that rule has a bad regex or was never activated, the metric the dashboard references is empty while the raw metric is still there.
curl -s "http://localhost:9090/api/v1/query" --data-urlencode 'query=job:http_request_total'
curl -s http://localhost:9090/api/v1/status/rules | jq '.data.groups[] | {name, rules: .rules[] | {name, state, health}}'
I once had an ops teammate set a recording rule interval to 15 seconds but the group evaluation_interval to five minutes, so the precomputed metric only refreshed every five minutes and the dashboard looked like it had gaps when it just had a slow refresh cadence.
Step 5: Use promtool to pin down the config-layer error
Everything above is the runtime view. Close the loop with an offline check of the config itself:
promtool check config /etc/prometheus/prometheus.yml
promtool check rules /etc/prometheus/rules/*.yml
kubectl -n monitoring get cm prometheus-configuration -o yaml | sed -n '/data:/,$p' | tail -n +2 | base64 -d > /tmp/prom.yml
promtool check config /tmp/prom.yml
If promtool passes, the config layer is clean and the fault is in one of the runtime segments from the earlier steps.
Step 6: Prove the data is really back
Do not stop at the target flipping to up. Confirm the downstream query returns a value:
curl -s http://localhost:9090/api/v1/targets | jq '.data.activeTargets[] | select(.health=="up") | .scrapeUrl'
curl -s "http://localhost:9090/api/v1/query" --data-urlencode 'query=sum(rate(node_cpu_seconds_total[5m])) by (instance)'
Then open the Grafana dashboard, set the time range to the last fifteen minutes, and make sure the line is not still empty.
A single card you can tape above the terminal
| Symptom | Segment | One command to verify |
|---|---|---|
| target down | network | curl -v http:// |
| target down | auth | read the 401/403 in Last Scrape |
| target down | TLS | read the TLS handshake error |
| target up but empty | metric name | /api/v1/label/name/values |
| target up but empty | relabel | /api/v1/series?match[]=up |
| K8s targets all down | ServiceMonitor | kubectl get svcmon -o wide plus selector |
| config error | file | promtool check config |
Turn this troubleshooting run into alerts: stop discovering "no data" by hand
The six steps above are "how to diagnose it once it happens". But if every time a dashboard goes blank I only find out by walking into /targets, then the monitoring system itself is not being monitored. I wire the signals below into alerts so that "no data" shouts itself out instead of waiting for a human to notice an empty panel:
# 1) target down (cannot scrape = a monitoring blind spot, highest priority)
groups:
- name: scrape-health
rules:
- alert: TargetDown
expr: up == 0
for: 5m # require 5 minutes to avoid a blip during a target restart
labels:
severity: critical
annotations:
summary: "scrape interrupted for target {{ $labels.instance }}"
description: "{{ $labels.job }} is at {{ $value }}; see Last Scrape on Prometheus /targets"
# 2) an entire job has no usable target (worse than one host; usually a config or network break)
- alert: JobDown
expr: sum by (job) (up) == 0
for: 10m
labels:
severity: critical
annotations:
summary: "job {{ $labels.job }} has no usable target"
# 3) a recording rule is failing (precomputed metrics go silently stale)
- alert: RuleEvaluationFailing
expr: prometheus_rule_evaluation_failures_total > 0
for: 5m
labels:
severity: warning
annotations:
summary: "rule group {{ $labels.rule_group }} evaluation failing"
# 4) scrape is slow / timing out (not down yet, but already degrading)
- alert: ScrapeSlow
expr:
histogram_quantile(0.99, sum(rate(prometheus_scrape_duration_seconds_bucket[5m])) by (le, job)) > 10
for: 15m
labels:
severity: warning
annotations:
summary: "job {{ $labels.job }} P99 scrape duration above 10s"
Three things I always get right: pair up == 0 with for: 5m, otherwise the dozen or so seconds a target spends restarting floods you with false alerts; use sum by (job) (up) == 0 for JobDown rather than count, because up is already 0/1, so a zero sum is the signal that the job has lost every target; and RuleEvaluationFailing is the one most people forget, which lets a recording rule fail silently so the dashboard keeps showing a stale value or a blank line long after it broke. With these four wired up, "installed but no data" stops being a find-it-yourself problem.
After you add the rules, do not restart Prometheus to load them — that drops the in-memory state of active alerts. Hot-reload instead: run promtool check rules rules.yml first, then send SIGHUP to the process or call /api/v1/reload, and confirm on /api/v1/status/rules that health is ok and lastError is empty. On Kubernetes with the operator, you change the ruleFiles on the Prometheus/ThanosRuler object or an AlertmanagerConfig, and the operator reloads for you; you just watch the pod log for the line confirming the rules loaded cleanly.
Related
- Prometheus deployment — get scrape_configs right at deploy time and this whole class of failure disappears
- node-exporter troubleshooting — when the target is specifically a node-exporter
- Prometheus query cheat sheet — writing PromQL without the usual traps
- Deploying Prometheus with Helm — the full ServiceMonitor workflow for Kubernetes