Interview Prep/Monitoring & Observability/Prometheus and PromQL at Scale

What scrape interval would you choose, and how does it affect `rate()` windows?

BeginnerScenarioPrometheus and PromQL at Scale
Answer

Situation read → Shorter intervals give finer resolution but cost more series samples, CPU and storage.

What I'd do →

  1. Default to 15s for application and infrastructure metrics, and 30–60s for low-value exporters (cloud APIs, slow databases).
  2. The rate() range must contain at least two samples. As a rule use 4x the scrape interval: 15s scrape means [1m] minimum, [5m] for alerts.
  3. Keep one global scrape_interval and override per job only with a reason.
  4. Match Grafana's $__rate_interval variable, which accounts for the interval.

Why → If the window contains fewer than two samples, rate() returns nothing and graphs show gaps.

Interview tip → Mention that storage cost scales linearly with scrape frequency.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Prometheus and PromQL at Scale