Interview Prep/Monitoring & Observability/Rapid-Fire PromQL & LogQL

Highest 5-minute request rate in the last 24 hours?

AdvancedProductionRapid-Fire PromQL & LogQL
Answer
max_over_time(sum(rate(http_requests_total{job="checkout"}[5m]))[1d:5m])

A subquery: evaluate the inner expression every 5 minutes over 1 day, then take the max. Expensive, so put the inner expression in a recording rule if it runs on a dashboard.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Rapid-Fire PromQL & LogQL