Interview Prep/Monitoring & Observability/Scaling Prometheus, Long-Term Storage & HA

How do you protect the metrics backend from expensive queries?

AdvancedProductionScaling Prometheus, Long-Term Storage & HA
Answer
  • Prometheus: --query.timeout, --query.max-samples, --query.max-concurrency.
  • Mimir/Thanos: query-frontend splitting and sharding, max_fetched_series_per_query, max_query_lookback, per-tenant concurrency.
  • Grafana: data source timeout, panel query limits.
  • Separate read paths for dashboards and for rules so a heavy ad-hoc query cannot delay alert evaluation.

Log slow queries (--query.active-query-tracker and Mimir's query stats) and fix the worst offenders with recording rules.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Scaling Prometheus, Long-Term Storage & HA