apiVersion: v1
kind: ConfigMap
metadata:
  namespace: gemcloud-logging-system
  labels:
    app.kubernetes.io/name: loki
  name: loki-recording-rules
data:
  recording.rules: |-
    groups:
    - name: kubegems-observability-logging
      interval: 1m
      rules:
      - record: logging_level_error
        expr: sum by (namespace) (count_over_time({stream=~"stdout|stderr"} |~ `error` [1m]))
      - record: eventer
        expr: sum by (involvedObject_kind,source_component,type,metadata_namespace) (count_over_time({container="gems-eventer"} | json | __error__="" [1m]))
