PromQL Query Builder (rate, histogram_quantile, SLO)
Pick a pattern and fill in the metric to get a correct PromQL expression with the usual windows.
Use the tool
Why this tool exists
Patterns include rate of a counter, error ratio (5xx over all requests), a latency percentile from a classic histogram (histogram_quantile over _bucket series with the le label), averages from _sum and _count, increase over a period, top N by a label and an availability SLO. Each result comes with a note about its limits, such as the rate window needing at least four scrapes.
The tool builds expressions from templates and cannot check that your metrics and labels exist; test the result in Prometheus.
No data is sent anywhere: the work happens in your browser, so you can use it offline once the page has loaded.
How to use it
- Choose the pattern.
- Enter the metric, label selector, grouping labels and window.
- Copy the query into Prometheus or Grafana.
- Adjust labels to your metric names.
Frequently asked questions
Why does error ratio need a status label?
It filters the 5xx series; use the label your instrumentation provides.
Rate or increase?
rate gives per-second change; increase gives total change over the window.
Is the percentile exact?
No, it is an estimate based on bucket boundaries.
Is my data sent anywhere?
No. Everything is processed in your browser, and the page makes no network requests with your input.