What are the PromQL data types?
BeginnerConceptPromQL & Recording Rules
Answer
- Instant vector: a set of series, each with one sample at the evaluation time.
http_requests_total - Range vector: a set of series, each with samples over a time range.
http_requests_total[5m] - Scalar: a single number.
time(),scalar(...) - String: rarely used.
Graphs need instant vectors; functions like rate() take a range vector and return an instant vector. "Range vector not allowed" errors mean you tried to graph metric[5m] directly.
More on PromQL & Recording Rules
What label matchers does PromQL support?BeginnerExplain `rate()`.Beginner`rate()` vs `irate()`: what is the difference?IntermediateWhat does `increase()` return and why is it sometimes a non-integer?IntermediateWhy must you `rate()` before `sum()`, never the reverse?IntermediateHow do PromQL aggregation operators and `by`/`without` work?Beginner