Skip to main content

Querying for Prometheus and Grafanas

Querying in Prometheus means using PromQL, a functional query language designed for time series. It selects series by label matchers, applies functions such as rate and histogram_quantile, and aggregates with operators like sum by. PromQL powers graphs, alert rules and Grafana panels.

Stage: Prometheus Basics · Part of the Prometheus and Grafana roadmap · Last reviewed 19 November 2026

What to learn in Querying

Querying interview questions

What does rate() do in PromQL?

rate() takes a range vector of a counter and returns the average per-second increase over that window, handling counter resets. For example, rate(http_requests_total[5m]) gives requests per second averaged over five minutes.

Why should you not apply rate() to a gauge?

rate() assumes a counter that increases and adjusts for resets, so on a gauge it gives misleading results. For gauges that move up and down, use delta, deriv or simply the raw value, depending on the question.

Where Querying fits in the Prometheus and Grafana roadmap

Querying belongs to the Prometheus Basics stage (beginner level), which takes about 18 hours. Collect metrics.

Back to the full Prometheus and Grafana roadmap