topk

PromQL aggregation operators that keep the k series with the largest, or smallest, values.

In more detail

topk(3, x) returns the three highest series of x at each evaluation step, keeping their labels. Combined with by, it picks the largest series within each group, and a graph of it can switch between series over time.

Example

topk(3, rate(http_requests_total[5m]))

Related terms

Taught in

References

Certification courses