What is PromQL, and what is an instant vector versus a range vector? [Basic]
Answer
PromQL is Prometheus's query language. An instant vector is a set of time series at one evaluation timestamp; a range vector is a set of time series with samples over a time window such as 5 minutes.
Technical explanation
Instant vectors are used for current values, aggregations, and alert expressions at a point in time.
Range vectors are required by functions such as rate(), increase(), avg_over_time(), max_over_time(), and histogram calculations.
Understanding vector types prevents common errors such as applying sum directly to a range vector.
Hands-on example
Examples: http_requests_total is an instant vector. http_requests_total[5m] is a range vector. rate(http_requests_total[5m]) converts the range vector into an instant vector of per-second rates, which can then be aggregated with sum by (service).
Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.
More Observability interview questions
- What is observability, and how is it different from traditional monitoring? [Basic]
- What are the three pillars of observability (metrics, logs, traces)? [Basic]
- What is the difference between monitoring and observability in practice? [Basic]
- What are the four golden signals of monitoring? [Basic]
- What is the difference between the USE method and the RED method? [Basic]
- When would you use the USE method versus the RED method? [Basic]
- What is an SLI, an SLO, and an SLA, and how do they relate? [Basic]
- How do you choose good SLIs for a service? [Basic]