How do you limit the damage one bad target can do to Prometheus?

AdvancedConceptPrometheus Architecture
Answer

Per-scrape-config limits:

- job_name: apps
  sample_limit: 50000
  label_limit: 30
  label_name_length_limit: 128
  label_value_length_limit: 512
  target_limit: 500
  body_size_limit: 20MB

If a scrape exceeds sample_limit, the whole scrape fails and up becomes 0, which is visible and alertable, instead of silently adding a million series. Watch prometheus_target_scrapes_exceeded_sample_limit_total.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Prometheus Architecture