{
  "description": "ClusterPodMonitoring defines monitoring for a set of pods, scoped to all pods within the cluster.",
  "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 desired Pod selection for target discovery by Prometheus.",
      "properties": {
        "endpoints": {
          "description": "The endpoints to scrape on the selected pods.",
          "items": {
            "additionalProperties": false,
            "description": "ScrapeEndpoint specifies a Prometheus metrics endpoint to scrape.",
            "properties": {
              "interval": {
                "default": "1m",
                "description": "Interval at which to scrape metrics. Must be a valid Prometheus duration.",
                "pattern": "^((([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?|0)$",
                "type": [
                  "string",
                  "null"
                ]
              },
              "metricRelabeling": {
                "description": "Relabeling rules for metrics scraped from this endpoint. Relabeling rules that override protected target labels (project_id, location, cluster, namespace, job, instance, or __address__) are not permitted. The labelmap action is not permitted in general.",
                "items": {
                  "additionalProperties": false,
                  "description": "RelabelingRule defines a single Prometheus relabeling rule.",
                  "properties": {
                    "action": {
                      "description": "Action to perform based on regex matching. Defaults to 'replace'.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "modulus": {
                      "description": "Modulus to take of the hash of the source label values.",
                      "format": "int64",
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "regex": {
                      "description": "Regular expression against which the extracted value is matched. Defaults to '(.*)'.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "replacement": {
                      "description": "Replacement value against which a regex replace is performed if the regular expression matches. Regex capture groups are available. Defaults to '$1'.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "separator": {
                      "description": "Separator placed between concatenated source label values. Defaults to ';'.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "sourceLabels": {
                      "description": "The source labels select values from existing labels. Their content is concatenated using the configured separator and matched against the configured regular expression for the replace, keep, and drop actions.",
                      "items": {
                        "type": "string"
                      },
                      "type": [
                        "array",
                        "null"
                      ]
                    },
                    "targetLabel": {
                      "description": "Label to which the resulting value is written in a replace action. It is mandatory for replace actions. Regex capture groups are available.",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "type": "object"
                },
                "type": [
                  "array",
                  "null"
                ]
              },
              "params": {
                "additionalProperties": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "description": "HTTP GET params to use when scraping.",
                "type": [
                  "object",
                  "null"
                ]
              },
              "path": {
                "description": "HTTP path to scrape metrics from. Defaults to \"/metrics\".",
                "type": [
                  "string",
                  "null"
                ]
              },
              "port": {
                "description": "Name or number of the port to scrape. The container metadata label is only populated if the port is referenced by name because port numbers are not unique across containers.",
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "integer"
                  }
                ],
                "x-kubernetes-int-or-string": true
              },
              "proxyUrl": {
                "description": "Proxy URL to scrape through. Encoded passwords are not supported.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "scheme": {
                "description": "Protocol scheme to use to scrape.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "timeout": {
                "description": "Timeout for metrics scrapes. Must be a valid Prometheus duration. Must not be larger then the scrape interval.",
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "port"
            ],
            "type": "object"
          },
          "type": "array"
        },
        "limits": {
          "additionalProperties": false,
          "description": "Limits to apply at scrape time.",
          "properties": {
            "labelNameLength": {
              "description": "Maximum label name length. Uses Prometheus default if left unspecified.",
              "format": "int64",
              "type": [
                "integer",
                "null"
              ]
            },
            "labelValueLength": {
              "description": "Maximum label value length. Uses Prometheus default if left unspecified.",
              "format": "int64",
              "type": [
                "integer",
                "null"
              ]
            },
            "labels": {
              "description": "Maximum number of labels accepted for a single sample. Uses Prometheus default if left unspecified.",
              "format": "int64",
              "type": [
                "integer",
                "null"
              ]
            },
            "samples": {
              "description": "Maximum number of samples accepted within a single scrape. Uses Prometheus default if left unspecified.",
              "format": "int64",
              "type": [
                "integer",
                "null"
              ]
            }
          },
          "type": [
            "object",
            "null"
          ]
        },
        "selector": {
          "additionalProperties": false,
          "description": "Label selector that specifies which pods are selected for this monitoring configuration.",
          "properties": {
            "matchExpressions": {
              "description": "matchExpressions is a list of label selector requirements. The requirements are ANDed.",
              "items": {
                "additionalProperties": false,
                "description": "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.",
                "properties": {
                  "key": {
                    "description": "key is the label key that the selector applies to.",
                    "type": "string"
                  },
                  "operator": {
                    "description": "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.",
                    "type": "string"
                  },
                  "values": {
                    "description": "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.",
                    "items": {
                      "type": "string"
                    },
                    "type": [
                      "array",
                      "null"
                    ]
                  }
                },
                "required": [
                  "key",
                  "operator"
                ],
                "type": "object"
              },
              "type": [
                "array",
                "null"
              ]
            },
            "matchLabels": {
              "additionalProperties": {
                "type": "string"
              },
              "description": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.",
              "type": [
                "object",
                "null"
              ]
            }
          },
          "type": "object",
          "x-kubernetes-map-type": "atomic"
        },
        "targetLabels": {
          "additionalProperties": false,
          "description": "Labels to add to the Prometheus target for discovered endpoints. The `instance` label is always set to `\u003cpod_name\u003e:\u003cport\u003e` or `\u003cnode_name\u003e:\u003cport\u003e` if the scraped pod is controlled by a DaemonSet.",
          "properties": {
            "fromPod": {
              "description": "Labels to transfer from the Kubernetes Pod to Prometheus target labels. Mappings are applied in order.",
              "items": {
                "additionalProperties": false,
                "description": "LabelMapping specifies how to transfer a label from a Kubernetes resource onto a Prometheus target.",
                "properties": {
                  "from": {
                    "description": "Kubenetes resource label to remap.",
                    "type": "string"
                  },
                  "to": {
                    "description": "Remapped Prometheus target label. Defaults to the same name as `From`.",
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "from"
                ],
                "type": "object"
              },
              "type": [
                "array",
                "null"
              ]
            },
            "metadata": {
              "description": "Pod metadata labels that are set on all scraped targets. Permitted keys are `pod`, `container`, and `node` for PodMonitoring and `pod`, `container`, `node`, and `namespace` for ClusterPodMonitoring. The `container` label is only populated if the scrape port is referenced by name. Defaults to [pod, container] for PodMonitoring and [namespace, pod, container] for ClusterPodMonitoring. If set to null, it will be interpreted as the empty list for PodMonitoring and to [namespace] for ClusterPodMonitoring. This is for backwards-compatibility only.",
              "items": {
                "type": "string"
              },
              "type": [
                "array",
                "null"
              ]
            }
          },
          "type": [
            "object",
            "null"
          ]
        }
      },
      "required": [
        "endpoints",
        "selector"
      ],
      "type": "object"
    },
    "status": {
      "additionalProperties": false,
      "description": "Most recently observed status of the resource.",
      "properties": {
        "conditions": {
          "description": "Represents the latest available observations of a podmonitor's current state.",
          "items": {
            "additionalProperties": false,
            "description": "MonitoringCondition describes a condition of a PodMonitoring.",
            "properties": {
              "lastTransitionTime": {
                "description": "Last time the condition transitioned from one status to another.",
                "format": "date-time",
                "type": [
                  "string",
                  "null"
                ]
              },
              "lastUpdateTime": {
                "description": "The last time this condition was updated.",
                "format": "date-time",
                "type": [
                  "string",
                  "null"
                ]
              },
              "message": {
                "description": "A human-readable message indicating details about the transition.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "reason": {
                "description": "The reason for the condition's last transition.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "status": {
                "description": "Status of the condition, one of True, False, Unknown.",
                "type": "string"
              },
              "type": {
                "description": "MonitoringConditionType is the type of MonitoringCondition.",
                "type": "string"
              }
            },
            "required": [
              "status",
              "type"
            ],
            "type": "object"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "endpointStatuses": {
          "description": "Represents the latest available observations of target state for each ScrapeEndpoint.",
          "items": {
            "additionalProperties": false,
            "properties": {
              "activeTargets": {
                "description": "Total number of active targets.",
                "format": "int64",
                "type": [
                  "integer",
                  "null"
                ]
              },
              "collectorsFraction": {
                "description": "Fraction of collectors included in status, bounded [0,1]. Ideally, this should always be 1. Anything less can be considered a problem and should be investigated.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "lastUpdateTime": {
                "description": "Last time this status was updated.",
                "format": "date-time",
                "type": [
                  "string",
                  "null"
                ]
              },
              "name": {
                "description": "The name of the ScrapeEndpoint.",
                "type": "string"
              },
              "sampleGroups": {
                "description": "A fixed sample of targets grouped by error type.",
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "count": {
                      "description": "Total count of similar errors.",
                      "format": "int32",
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "sampleTargets": {
                      "description": "Targets emitting the error message.",
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "health": {
                            "description": "Health status.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "labels": {
                            "additionalProperties": {
                              "description": "A LabelValue is an associated value for a LabelName.",
                              "type": "string"
                            },
                            "description": "The label set, keys and values, of the target.",
                            "type": [
                              "object",
                              "null"
                            ]
                          },
                          "lastError": {
                            "description": "Error message.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastScrapeDurationSeconds": {
                            "description": "Scrape duration in seconds.",
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "type": "object"
                      },
                      "type": [
                        "array",
                        "null"
                      ]
                    }
                  },
                  "type": "object"
                },
                "type": [
                  "array",
                  "null"
                ]
              },
              "unhealthyTargets": {
                "description": "Total number of active, unhealthy targets.",
                "format": "int64",
                "type": [
                  "integer",
                  "null"
                ]
              }
            },
            "required": [
              "name"
            ],
            "type": "object"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "observedGeneration": {
          "description": "The generation observed by the controller.",
          "format": "int64",
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "type": [
        "object",
        "null"
      ]
    }
  },
  "required": [
    "spec"
  ],
  "type": "object"
}