groups:
  - name: chain
    rules:
      # Evaluated concurrently, no dependencies
      - record: job:http_requests:rate1m
        expr: sum by (job)(rate(http_requests_total[1m]))
      - record: job:http_requests:rate5m
        expr: sum by (job)(rate(http_requests_total[1m]))

      # Evaluated sequentially, dependents and dependencies
      - record: job1:http_requests:rate1m
        expr: job:http_requests:rate1m{job="job1"}
      - record: job1_cluster1:http_requests:rate1m
        expr: job1:http_requests:rate1m{cluster="cluster1"}

      # Evaluated concurrently, no dependents
      - record: job1_cluster2:http_requests:rate1m
        expr: job1:http_requests:rate1m{cluster="cluster2"}
      - record: job1_cluster1_namespace1:http_requests:rate1m
        expr: job1_cluster1:http_requests:rate1m{namespace="namespace1"}
      - record: job1_cluster1_namespace2:http_requests:rate1m
        expr: job1_cluster1:http_requests:rate1m{namespace="namespace2"}
