Troubleshoot a Missing Scrape Target
A 4-step recipe with Prometheus. We can help you get access.
Recipe · 4 steps
Troubleshoot a Missing Scrape Target
with Prometheus
Diagnose why a scrape target is not producing metrics.
- Read the full target discovery state, including targets dropped by relabelling. The health and lastError fields on an active target say whether the last scrape succeeded and why it did not.
- Ask what metadata the matched targets are contributing for the expected metric. An empty result means the target is being scraped but is not exposing this metric at all.
- Evaluate the up metric for this target. A sample value of 1 means the last scrape succeeded, 0 means Prometheus reached the scrape cycle and failed, and no sample at all means the target is not being scraped.
- Read the loaded configuration as YAML. Reached when service discovery produced no active targets at all, which usually means the scrape job is missing from the configuration or its discovery block matches nothing.
What you'll need to have ready
- targetMatcher: Label selector matching the target's labels (e.g. {job="api"}).
- metricName: A metric the target is expected to expose (e.g. http_requests_total).
- upQuery: PromQL expression selecting the up metric for this target (e.g. up{job="api"}). A value of 0 means the scrape is failing.
For your developer
Arazzo workflow prometheus:troubleshoot-scrape-target, 4 operations: getTargets → getTargetMetadata → queryInstant → getConfig. Specs on APIs.io.