{
  "description": "Rules defines Prometheus alerting and recording rules that are scoped to the namespace of the resource. Only metric data from this namespace is processed and all rule results have their project_id, cluster, and namespace label preserved for query processing. If the location label is not preserved by the rule, it defaults to the cluster's location.",
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
      "type": [
        "string",
        "null"
      ]
    },
    "kind": {
      "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": [
        "string",
        "null"
      ]
    },
    "metadata": {
      "type": [
        "object",
        "null"
      ]
    },
    "spec": {
      "additionalProperties": false,
      "description": "Specification of rules to record and alert on.",
      "properties": {
        "groups": {
          "description": "A list of Prometheus rule groups.",
          "items": {
            "additionalProperties": false,
            "description": "RuleGroup declares rules in the Prometheus format: https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/",
            "properties": {
              "interval": {
                "description": "The interval at which to evaluate the rules. Must be a valid Prometheus duration.",
                "type": "string"
              },
              "name": {
                "description": "The name of the rule group.",
                "type": "string"
              },
              "rules": {
                "description": "A list of rules that are executed sequentially as part of this group.",
                "items": {
                  "additionalProperties": false,
                  "description": "Rule is a single rule in the Prometheus format: https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/",
                  "properties": {
                    "alert": {
                      "description": "Name of the alert to evaluate the expression as. Only one of `record` and `alert` must be set.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "annotations": {
                      "additionalProperties": {
                        "type": "string"
                      },
                      "description": "A set of annotations to attach to alerts produced by the query expression. Only valid if `alert` is set.",
                      "type": [
                        "object",
                        "null"
                      ]
                    },
                    "expr": {
                      "description": "The PromQL expression to evaluate.",
                      "type": "string"
                    },
                    "for": {
                      "description": "The duration to wait before a firing alert produced by this rule is sent to Alertmanager. Only valid if `alert` is set.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "labels": {
                      "additionalProperties": {
                        "type": "string"
                      },
                      "description": "A set of labels to attach to the result of the query expression.",
                      "type": [
                        "object",
                        "null"
                      ]
                    },
                    "record": {
                      "description": "Record the result of the expression to this metric name. Only one of `record` and `alert` must be set.",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "expr"
                  ],
                  "type": "object"
                },
                "type": "array"
              }
            },
            "required": [
              "interval",
              "name",
              "rules"
            ],
            "type": "object"
          },
          "type": "array"
        }
      },
      "required": [
        "groups"
      ],
      "type": "object"
    },
    "status": {
      "description": "Most recently observed status of the resource.",
      "type": [
        "object",
        "null"
      ]
    }
  },
  "required": [
    "spec"
  ],
  "type": "object"
}