Scrape fails with `sample limit exceeded` and the whole target goes to `up == 0`
IntermediateTroubleshootingPrometheus scraping and targets
Answer
Likely causes → The target exposes more series than sample_limit. When the limit is exceeded, the whole scrape is rejected, not just the excess.
Diagnose →
scrape_samples_scraped{job="app"}
scrape_samples_post_metric_relabeling{job="app"}
Inspect which metric names exploded with the curl | cut | uniq -c trick.
Fix → Drop or aggregate the high-cardinality series with metric_relabel_configs (action: drop or labeldrop), fix instrumentation, then adjust the limit deliberately.
Prevent → Alert when scrape_samples_scraped / <limit> > 0.8.
More on Prometheus scraping and targets
A target shows `DOWN` on `/targets` with `Get "http://10.0.3.14:9100/metrics": context deadline exceeded`BeginnerTarget is `DOWN` with `server returned HTTP status 401 Unauthorized`BeginnerTarget shows `server returned HTTP status 403 Forbidden` when scraping kubelet / cAdvisorIntermediateTarget is `DOWN` with `connect: connection refused`BeginnerTarget shows `x509: certificate signed by unknown authority`IntermediateTarget shows `x509: certificate is valid for app.svc, not 10.0.4.22`Intermediate