Update Recording Rules :: Kloudfuse Docs
Update Recording Rules
Periodically, you must update the recording rules for metrics. Follow these steps:
Add the following configuration for recording rules to the Kloudfuse
custom_values.yamlfile.Change the rule name and expression as necessary.
rulemanager:
rules:
groups:
- name: recording_rules
rules:
- record: application_availability_slo (1)
expr: sum by (kube_cluster_name, kube_service) (increase(promhttp_metric_handler_requests_total{code=~"2.*"}[28d])) / sum by (kube_cluster_name, kube_service) (increase(promhttp_metric_handler_requests_total{code=~"2.*|5.*"}[28d]))
| 1 | Defines a new metric application_availability_slo using the rule specified in the expr field. |
- If adding multiple rules, then add them to a group of its own,
MyGroup:
rulemanager:
rules:
...
MyGroup:
- name: my_group_rules
rules:
- record: rule_name_1
expr: sum by (kube_cluster_name, kube_service) (increase(promhttp_metric_handler_requests_total{code=~"2.*"}[28d])) / sum by (kube_cluster_name, kube_service) (increase(promhttp_metric_handler_requests_total{code=~"2.*|5.*"}[28d]))
- Reinstall the Helm release.