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

LogQL: p95 request duration per route from log lines?

AdvancedProductionRapid-Fire PromQL & LogQL
Answer
quantile_over_time(0.95,
  {app="checkout"} | json | __error__="" | unwrap duration_ms [5m]) by (route)

unwrap turns an extracted label into the sample value. Useful when the service has no histogram, but it scans every line, so convert it into a Loki recording rule or real metric if it becomes a dashboard staple.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Rapid-Fire PromQL & LogQL