Interview Prep/Monitoring & Observability/Prometheus scraping and targets

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.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Prometheus scraping and targets