{
  "description": "VMRule defines rule records for vmalert application",
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
      "type": "string"
    },
    "kind": {
      "description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": "string"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "description": "VMRuleSpec defines the desired state of VMRule",
      "properties": {
        "groups": {
          "description": "Groups list of group rules",
          "items": {
            "description": "RuleGroup is a list of sequentially evaluated recording and alerting rules.",
            "properties": {
              "concurrency": {
                "description": "Concurrency defines how many rules execute at once.",
                "type": "integer"
              },
              "eval_alignment": {
                "description": "Optional\nThe evaluation timestamp will be aligned with group's interval,\ninstead of using the actual timestamp that evaluation happens at.\nIt is enabled by default to get more predictable results\nand to visually align with graphs plotted via Grafana or vmui.",
                "type": "boolean"
              },
              "eval_delay": {
                "description": "Optional\nAdjust the `time` parameter of group evaluation requests to compensate intentional query delay from the datasource.",
                "type": "string"
              },
              "eval_offset": {
                "description": "Optional\nGroup will be evaluated at the exact offset in the range of [0...interval].",
                "type": "string"
              },
              "extra_filter_labels": {
                "additionalProperties": {
                  "type": "string"
                },
                "description": "ExtraFilterLabels optional list of label filters applied to every rule's\nrequest within a group. Is compatible only with VM datasource.\nSee more details [here](https://docs.victoriametrics.com/victoriametrics/#prometheus-querying-api-enhancements)\nDeprecated: use params instead",
                "type": "object"
              },
              "headers": {
                "description": "Headers contains optional HTTP headers added to each rule request\nMust be in form `header-name: value`\nFor example:\n headers:\n   - \"CustomHeader: foo\"\n   - \"CustomHeader2: bar\"",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "interval": {
                "description": "evaluation interval for group",
                "type": "string"
              },
              "labels": {
                "additionalProperties": {
                  "type": "string"
                },
                "description": "Labels optional list of labels added to every rule within a group.\nIt has priority over the external labels.\nLabels are commonly used for adding environment\nor tenant-specific tag.",
                "type": "object"
              },
              "limit": {
                "description": "Limit the number of alerts an alerting rule and series a recording\nrule can produce",
                "type": "integer"
              },
              "name": {
                "description": "Name of group",
                "type": "string"
              },
              "notifier_headers": {
                "description": "NotifierHeaders contains optional HTTP headers added to each alert request which will send to notifier\nMust be in form `header-name: value`\nFor example:\n headers:\n   - \"CustomHeader: foo\"\n   - \"CustomHeader2: bar\"",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "params": {
                "additionalProperties": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "description": "Params optional HTTP URL parameters added to each rule request",
                "type": "object"
              },
              "rules": {
                "description": "Rules list of alert rules",
                "items": {
                  "description": "Rule describes an alerting or recording rule.",
                  "properties": {
                    "alert": {
                      "description": "Alert is a name for alert",
                      "type": "string"
                    },
                    "annotations": {
                      "additionalProperties": {
                        "type": "string"
                      },
                      "description": "Annotations will be added to rule configuration",
                      "type": "object"
                    },
                    "debug": {
                      "description": "Debug enables logging for rule\nit useful for tracking",
                      "type": "boolean"
                    },
                    "expr": {
                      "description": "Expr is query, that will be evaluated at dataSource",
                      "type": "string"
                    },
                    "for": {
                      "description": "For evaluation interval in time.Duration format\n30s, 1m, 1h  or nanoseconds",
                      "type": "string"
                    },
                    "keep_firing_for": {
                      "description": "KeepFiringFor will make alert continue firing for this long\neven when the alerting expression no longer has results.\nUse time.Duration format, 30s, 1m, 1h  or nanoseconds",
                      "type": "string"
                    },
                    "labels": {
                      "additionalProperties": {
                        "type": "string"
                      },
                      "description": "Labels will be added to rule configuration",
                      "type": "object"
                    },
                    "record": {
                      "description": "Record represents a query, that will be recorded to dataSource",
                      "type": "string"
                    },
                    "update_entries_limit": {
                      "description": "UpdateEntriesLimit defines max number of rule's state updates stored in memory.\nOverrides `-rule.updateEntriesLimit` in vmalert.",
                      "type": "integer"
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                },
                "type": "array"
              },
              "tenant": {
                "description": "Tenant id for group, can be used only with enterprise version of vmalert.\nSee more details [here](https://docs.victoriametrics.com/victoriametrics/vmalert/#multitenancy).",
                "type": "string"
              },
              "type": {
                "description": "Type defines datasource type for enterprise version of vmalert\npossible values - prometheus,graphite,vlogs",
                "type": "string"
              }
            },
            "required": [
              "name",
              "rules"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        }
      },
      "required": [
        "groups"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "status": {
      "description": "VMRuleStatus defines the observed state of VMRule",
      "properties": {
        "conditions": {
          "description": "Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\"",
          "items": {
            "description": "Condition defines status condition of the resource",
            "properties": {
              "lastTransitionTime": {
                "description": "lastTransitionTime is the last time the condition transitioned from one status to another.",
                "format": "date-time",
                "type": "string"
              },
              "lastUpdateTime": {
                "description": "LastUpdateTime is the last time of given type update.\nThis value is used for status TTL update and removal",
                "format": "date-time",
                "type": "string"
              },
              "message": {
                "description": "message is a human readable message indicating details about the transition.\nThis may be an empty string.",
                "maxLength": 32768,
                "type": "string"
              },
              "observedGeneration": {
                "description": "observedGeneration represents the .metadata.generation that the condition was set based upon.\nFor instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date\nwith respect to the current state of the instance.",
                "format": "int64",
                "minimum": 0,
                "type": "integer"
              },
              "reason": {
                "description": "reason contains a programmatic identifier indicating the reason for the condition's last transition.\nProducers of specific condition types may define expected values and meanings for this field,\nand whether the values are considered a guaranteed API.\nThe value should be a CamelCase string.\nThis field may not be empty.",
                "maxLength": 1024,
                "minLength": 1,
                "type": "string"
              },
              "status": {
                "description": "status of the condition, one of True, False, Unknown.",
                "enum": [
                  "True",
                  "False",
                  "Unknown"
                ],
                "type": "string"
              },
              "type": {
                "description": "Type of condition in CamelCase or in name.namespace.resource.victoriametrics.com/CamelCase.",
                "maxLength": 316,
                "type": "string"
              }
            },
            "required": [
              "lastTransitionTime",
              "lastUpdateTime",
              "reason",
              "status",
              "type"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "type": "array",
          "x-kubernetes-list-map-keys": [
            "type"
          ],
          "x-kubernetes-list-type": "map"
        },
        "observedGeneration": {
          "description": "ObservedGeneration defines current generation picked by operator for the\nreconcile",
          "format": "int64",
          "type": "integer"
        },
        "reason": {
          "description": "Reason defines human readable error reason",
          "type": "string"
        },
        "updateStatus": {
          "description": "UpdateStatus defines a status for update rollout",
          "type": "string"
        }
      },
      "type": "object",
      "additionalProperties": false
    }
  },
  "required": [
    "spec"
  ],
  "type": "object"
}
