Inside a PromQL Query: Understanding the Mechanics
summary
PromQL parses queries into an AST and evaluates by AST walking, not by a planner, so execution follows the written order; range queries ask Prometheus for evenly spaced samples and functions like rate use a sliding-window fetch that streams points into the function rather than loading all history first. Storage uses a postings index of 64-bit series IDs and label maps. About 75 functions exist, ~1/3 work on instant vectors; aggregations now precompute group keys once, while joins/operators remain the most expensive per-point work.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 1:30The Big Picture
- 2:32What is PromQL
- 5:33Series Index
- 6:59Series Label
- 7:52Selectors
- 8:30Query Translation
- 9:11Instant and Range Queries
- 9:49Range Queries
- 12:03Functions
- 14:23Range Vector
- 17:37Summing
- 22:13Join
- 25:20Final Results
related talks
34mBlazin’ Fast PromQL
29mReverse-Engineering PromQL Usage: A Proxy’s Tale
29mEngage Prometheus in Rust Ecosystem
32mPrometheus Intro and Deep Dive
01h 19mIntro + Deep Dive: Prometheus
17mHow Prometheus indexes Data and Why You Should Care
10m⚡ Lightning Talk: Vote on Your Favorite--Standardize This!--10 PromQL Queries That Measure CPU & Memory Usage
33mIntro: Prometheus
