DELAPARRA
Index
Color
NL
Category: Observability

PromQL

Explained by Updated

What is PromQL?

PromQL: Prometheus Query Language — selects and aggregates time series for dashboards and alerts. PromQL is the query language of Prometheus. It selects time series by name and labels, and combines them with functions and operators to answer questions like "what share of requests failed in the last five minutes?" sum(rate(http_requests_total{status=~"5.."}[5m])) by (route) gives the rate of server errors per route. rate() turns ever-growing counters into per-second values, and sum by adds them up per label.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about PromQL

What should you keep in mind with PromQL?

A few functions cover most needs: rate for counters, histogram_quantile for percentiles, and sum, avg and max with by for grouping. Write alert rules as ratios, such as errors divided by requests, so they work at any traffic level. Grafana's query editor helps you explore available metrics and labels while you learn.

What does an example of PromQL look like?

sum(rate(http_requests_total{status=~"5.."}[5m])) by (route)

At a glance

CategoryObservability
Explained by
Updated

More Observability terms

All terms starting with P

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.