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.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on PromQL & Recording Rules