Recording rules
A simple way to improve the performance of your Prometheus queries is through the use of recording rules.
When performing complex queries over long time ranges, your query execution times can get quite long. If you’re putting these queries in dashboards in Grafana – or otherwise frequently using them – it can negatively impact user experience. Fortunately, Prometheus enables the pre-computation of these expensive queries via recording rules.
Recording rules differ from alerting rules because they produce new time series based on the results of the PromQL expression they evaluate. They can be defined alongside alerting rules, including within the same rule groups.
Recording rule conventions
Since recording rules produce new time series, they need to have unique names. Additionally, it should be made clear that a metric is created by a recording rule. Prometheus does not enforce naming restrictions for recording rules differently than...