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

A Grafana dashboard with a 30-day range takes 40 seconds to load. How do you speed it up?

IntermediateScenarioPrometheus and PromQL at Scale
Answer

Situation read → Long ranges over raw high-cardinality series force Prometheus to read huge numbers of samples.

What I'd do →

  1. Replace heavy panel queries with recording rules that pre-aggregate (job:http_requests:rate5m).
  2. Use $__rate_interval and let Grafana set a sensible step, or set Min step to 5m for long ranges.
  3. Reduce the series each panel returns with sum by and topk.
  4. For long retention, use downsampled data (Thanos Compactor 5m/1h resolutions, Mimir with recording rules).
  5. Enable query-frontend caching and splitting by interval (Thanos Query Frontend, Mimir).

Why → Query cost scales with series x samples x range. Reduce each.

Interview tip → Mention the Query Inspector in Grafana to see the real query time and number of series.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Prometheus and PromQL at Scale