{
  "description": "ServiceLevelObjective is the Schema for the ServiceLevelObjectives API.",
  "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"
    },
    "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"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "description": "ServiceLevelObjectiveSpec defines the desired state of ServiceLevelObjective.",
      "properties": {
        "alerting": {
          "description": "Alerting customizes the alerting rules generated by Pyrra.",
          "properties": {
            "absent": {
              "default": true,
              "type": "boolean"
            },
            "burnrates": {
              "default": true,
              "type": "boolean"
            },
            "disabled": {
              "description": "Disabled is used to disable the generation of alerts. Recording rules are still generated.",
              "type": "boolean"
            },
            "name": {
              "description": "Name is used as the name of the alert generated by Pyrra. Defaults to \"ErrorBudgetBurn\".",
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "description": {
          "description": "Description describes the ServiceLevelObjective in more detail and gives extra context for engineers that might not directly work on the service.",
          "type": "string"
        },
        "indicator": {
          "description": "ServiceLevelIndicator is the underlying data source that indicates how the service is doing. This will be a Prometheus metric with specific selectors for your service.",
          "properties": {
            "bool_gauge": {
              "description": "BoolGauge is the indicator that measures whether a boolean gauge is successful.",
              "properties": {
                "grouping": {
                  "description": "Total is the metric that returns how many requests there are in total.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "metric": {
                  "type": "string"
                }
              },
              "required": [
                "metric"
              ],
              "type": "object",
              "additionalProperties": false
            },
            "latency": {
              "description": "Latency is the indicator that measures a certain percentage to be faster than the expected latency.",
              "properties": {
                "grouping": {
                  "description": "Grouping allows an SLO to be defined for many SLI at once, like HTTP handlers for example.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "success": {
                  "description": "Success is the metric that returns how many errors there are.",
                  "properties": {
                    "metric": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "metric"
                  ],
                  "type": "object",
                  "additionalProperties": false
                },
                "total": {
                  "description": "Total is the metric that returns how many requests there are in total.",
                  "properties": {
                    "metric": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "metric"
                  ],
                  "type": "object",
                  "additionalProperties": false
                }
              },
              "required": [
                "success",
                "total"
              ],
              "type": "object",
              "additionalProperties": false
            },
            "latencyNative": {
              "description": "LatencyNative is the indicator that measures a certain percentage to be faster than the expected latency. This uses the new native histograms in Prometheus.",
              "properties": {
                "grouping": {
                  "description": "Grouping allows an SLO to be defined for many SLI at once, like HTTP handlers for example.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "latency": {
                  "description": "Latency the requests should be faster than.",
                  "type": "string"
                },
                "total": {
                  "description": "Total is the metric that returns how many requests there are in total.",
                  "properties": {
                    "metric": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "metric"
                  ],
                  "type": "object",
                  "additionalProperties": false
                }
              },
              "required": [
                "latency",
                "total"
              ],
              "type": "object",
              "additionalProperties": false
            },
            "ratio": {
              "description": "Ratio is the indicator that measures against errors / total events.",
              "properties": {
                "errors": {
                  "description": "Errors is the metric that returns how many errors there are.",
                  "properties": {
                    "metric": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "metric"
                  ],
                  "type": "object",
                  "additionalProperties": false
                },
                "grouping": {
                  "description": "Grouping allows an SLO to be defined for many SLI at once, like HTTP handlers for example.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "total": {
                  "description": "Total is the metric that returns how many requests there are in total.",
                  "properties": {
                    "metric": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "metric"
                  ],
                  "type": "object",
                  "additionalProperties": false
                }
              },
              "required": [
                "errors",
                "total"
              ],
              "type": "object",
              "additionalProperties": false
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "target": {
          "description": "Target is a string that's casted to a float64 between 0 - 100. It represents the desired availability of the service in the given window. float64 are not supported: https://github.com/kubernetes-sigs/controller-tools/issues/245",
          "type": "string"
        },
        "window": {
          "description": "Window within which the Target is supposed to be kept. Usually something like 1d, 7d or 28d.",
          "type": "string"
        }
      },
      "required": [
        "indicator",
        "target",
        "window"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "status": {
      "description": "ServiceLevelObjectiveStatus defines the observed state of ServiceLevelObjective.",
      "properties": {
        "type": {
          "description": "Type is the generated resource type, like PrometheusRule or ConfigMap",
          "type": "string"
        }
      },
      "type": "object",
      "additionalProperties": false
    }
  },
  "type": "object"
}
