Prometheus: List Targets
prometheus_list_targetsLists Prometheus scrape targets, defaulting to unhealthy ones with their last errors, so you can identify which metrics collection is failing and why.
Instructions
Scrape health: what Prometheus is failing to collect, and why. Always returns totals and every scrape pool with an unhealthy target; then lists targets, by default only the unhealthy ones with their lastError (a 404 is usually a wrong metrics path or port, a timeout a slow exporter, connection refused a pod not listening). A target that is down means its metrics stop — queries over it go quiet rather than erroring. Only active targets: the dropped ones (filtered out by relabeling) run to megabytes and are never fetched.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum targets to list (1-1000). Defaults to 50. | |
| health | No | Which targets to list. unhealthy (the default) = down or unknown; the totals always count all of them. | unhealthy |
| search | No | Case-insensitive substring matched against pool, instance, job and label values, e.g. a namespace. | |
| scrape_pool | No | Only this scrape pool, by exact name, e.g. `serviceMonitor/monitoring/node-exporter/0`. Filtered by Prometheus, so it is also the cheap way to inspect one big pool. |