What is the difference between an instant query and a range query?
BeginnerConceptPromQL & Recording Rules
Answer
- Instant query (
/api/v1/query): evaluates the expression at one timestamp. Used by alert rules, recording rules and Grafana stat panels. - Range query (
/api/v1/query_range): evaluates the same expression at everystepbetweenstartandend. Used by graphs.
Range queries are many instant evaluations, so a dashboard with a 30-day range at a 15s step is expensive. Grafana's $__rate_interval and step settings control this.
More on PromQL & Recording Rules
What are the PromQL data types?BeginnerWhat 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?Intermediate