Update Recording Rules :: Kloudfuse Docs

Update Recording Rules

Periodically, you must update the recording rules for metrics. Follow these steps:

  1. Add the following configuration for recording rules to the Kloudfuse custom_values.yaml file.

  2. 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.
  1. 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]))
  1. Reinstall the Helm release.