Skip to content

Prometheus Target Down — Scrape Failure Fix

DodaTech Updated 2026-06-24 2 min read

In this tutorial, you'll learn about Prometheus Target Down. We cover key concepts, practical examples, and best practices.

Your Prometheus dashboard shows Target Down in red — the exporter or application endpoint isn't reachable. Prometheus couldn't scrape metrics from the configured target.

The Problem

# WRONG — target specified with wrong port or path
scrape_configs:
  - job_name: 'node'
    static_configs:
      - targets: ['localhost:9101']

Prometheus UI shows http://localhost:9101/metrics — DOWN. Port 9101 is wrong — the node exporter runs on port 9100 by default. The target endpoint returns connection refused.

Step-by-Step Fix

1. Verify the target endpoint is accessible

# From the Prometheus server
curl -v http://target-host:9100/metrics

# Check if the port is open
nc -zv target-host 9100

2. Fix the scrape configuration

scrape_configs:
  - job_name: 'node'
    scrape_interval: 15s
    scrape_timeout: 10s
    static_configs:
      - targets:
          - 'localhost:9100'
          - 'worker-1:9100'
          - 'worker-2:9100'
    relabel_configs:
      - source_labels: [__address__]
        target_label: instance

3. Check firewall and network rules

# Allow Prometheus to reach the target
sudo ufw allow from prometheus-server to any port 9100

4. Check if the exporter is running

# On the target machine
systemctl status node_exporter
journalctl -u node_exporter -n 20

5. Use service discovery (Consul, Kubernetes, EC2)

scrape_configs:
  - job_name: 'kubernetes-pods'
    kubernetes_sd_configs:
      - role: pod
    relabel_configs:
      - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
        action: keep
        regex: true

Expected output in Prometheus UI:

Target: http://localhost:9100/metrics
State: UP
Last Scrape: 2s ago
Scrape Duration: 0.012s
Error: (none)

Prevention Tips

  • Verify exporter ports with curl http://host:port/metrics before adding to config
  • Use service discovery (Kubernetes, Consul) instead of static targets
  • Add scrape_timeout lower than scrape_interval
  • Set up Prometheus Alertmanager rules for target down
  • Use blackbox exporter for endpoint health monitoring

Common Mistakes with target down

  1. Forgetting deriving (Show, Eq) on custom data types needed for debugging
  2. Placing the wildcard pattern first in case expressions, making all subsequent patterns unreachable
  3. Using head and tail instead of pattern matching, causing runtime errors on empty lists

These mistakes appear frequently in real-world PROMETHEUS code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.

Practice Exercise

Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.

This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.

FAQ

### What does "Target Down" mean in Prometheus?

Prometheus could not connect to the target's /metrics endpoint. Possible causes: the exporter isn't running, the port is wrong, a firewall blocks the connection, the target host is down, or the scrape timeout is too short. Check the "Error" field in the target status for details.

How do I debug a target that's UP but returns no data?

A target might be UP but expose no metrics. Check the raw response: curl http://target:9100/metrics. Verify the metrics have the correct format (HELP, TYPE, METRIC lines). Check that the job label matches what you expect in queries.

What's the difference between static_configs and service discovery?

static_configs lists targets explicitly in the config file. Service discovery (Kubernetes, Consul, EC2, DNS) automatically finds targets based on labels or tags. Use static for small setups, service discovery for dynamic environments.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro