Data is Useless Without Questions
You have Prometheus collecting millions of metrics. Great. But looking at raw numbers like http_requests_total{status="500"} 15432 tells you nothing.
Is that good? Is it bad? Is it increasing fast?
PromQL (Prometheus Query Language) is how you ask these questions. It is a powerful functional language designed specifically for computing with time series data. Unlike SQL, which deals with rows and columns, PromQL deals with two fundamental data types:
- Instant Vector: A snapshot — the current value of a metric (or set of metrics) at a single point in time.
- Range Vector: A window of samples — all the values a metric produced over the last N minutes. This is what you feed into functions like
rate().
Think of it like this: an Instant Vector is a photograph, and a Range Vector is a short video clip. Most interesting PromQL functions need the video clip to detect motion (change over time).
The Visualization Layer
Prometheus ships with a minimal expression browser — useful for debugging a single query, but not for running a production service. For day-to-day operations, teams use Grafana. Grafana connects to Prometheus as a data source, executes your PromQL queries on a schedule, and renders the results as interactive time series graphs, heatmaps, stat panels, and more.
The workflow is: Prometheus collects → PromQL queries → Grafana visualizes. Understanding PromQL is the skill that unlocks everything else in this stack.