What is the naming convention for recording rules?
IntermediateConceptPromQL & Recording Rules
Answer
level:metric:operations:
- level: the labels kept after aggregation (
job,namespace_pod,cluster). - metric: the original metric name, with
_totalstripped when rated. - operations: what was applied, newest first (
rate5m,ratio_rate5m,sum).
Example: namespace:container_cpu_usage_seconds:sum_rate5m. The name tells a reader exactly how the series was built without opening the rule file.
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