Basic PromQL Querying

All Topics

Key Takeaways

Key Takeaways

Select series with metric names and label matchers. Use =, !=, =~, !~ to filter. Always include job in production queries.

Use rate() for counters, deriv() for gauges. Never graph raw counters. Use rate() for per-second averages, irate() for high-resolution graphs, and deriv() or delta() for gauges.

Aggregate with sum(), avg(), topk(), and others. Control dimensions with by() (keep listed labels) or without() (remove listed labels).

Arithmetic between vectors matches by labels automatically. Use on() / ignoring() when labels don't align, and group_left / group_right for many-to-one matching.

Start simple and build up. Begin with a metric name, add label filters, wrap in rate(), then aggregate. Test each step in the expression browser before combining.

Back 14 / 14 Next