The module lifecycle stageGeneral Availability
The module has requirements for installation

The Deckhouse Kubernetes Platform installs CRDs but does not remove them when a module is disabled. If you no longer need the created CRDs, delete them.

PodMonitor

Scope: Namespaced
Version: v1

PodMonitor defines monitoring for a set of pods.
  • apiVersion
    string
    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
  • kind
    string
    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
  • metadata
    object
  • spec
    object
    Specification of desired Pod selection for target discovery by Prometheus.
    • spec.attachMetadata
      object
      Attaches node metadata to discovered targets. Requires Prometheus v2.35.0 and above.
      • spec.attachMetadata.node
        boolean
        When set to true, Prometheus must have permissions to get Nodes.
    • spec.jobLabel
      string
      The label to use to retrieve the job name from.
    • spec.keepDroppedTargets
      integer
      Per-scrape limit on the number of targets dropped by relabeling that will be kept in memory. 0 means no limit. It requires Prometheus >= v2.47.0.
    • spec.labelLimit
      integer
      Per-scrape limit on number of labels that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer.
    • spec.labelNameLengthLimit
      integer
      Per-scrape limit on length of labels name that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer.
    • spec.labelValueLengthLimit
      integer
      Per-scrape limit on length of labels value that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer.
    • spec.namespaceSelector
      object
      Selector to select which namespaces the Endpoints objects are discovered from.
      • spec.namespaceSelector.any
        boolean
        Boolean describing whether all namespaces are selected in contrast to a list restricting them.
      • spec.namespaceSelector.matchNames
        array of strings
        List of namespace names to select from.
    • spec.podMetricsEndpoints
      array of objects

      Required value

      A list of endpoints allowed as part of this PodMonitor.
      • spec.podMetricsEndpoints.authorization
        object
        Authorization section for this endpoint
        • spec.podMetricsEndpoints.authorization.credentials
          object
          Selects a key of a Secret in the namespace that contains the credentials for authentication.
          • spec.podMetricsEndpoints.authorization.credentials.key
            string

            Required value

            The key of the secret to select from. Must be a valid secret key.
          • spec.podMetricsEndpoints.authorization.credentials.name
            string
          • spec.podMetricsEndpoints.authorization.credentials.optional
            boolean
            Specify whether the Secret or its key must be defined
        • spec.podMetricsEndpoints.authorization.type
          string
          Defines the authentication type. The value is case-insensitive. “Basic” is not a supported value. Default: “Bearer”
      • spec.podMetricsEndpoints.basicAuth
        object
        BasicAuth allow an endpoint to authenticate over basic authentication. More info: https://prometheus.io/docs/operating/configuration/#endpoint
        • spec.podMetricsEndpoints.basicAuth.password
          object
          The secret in the service monitor namespace that contains the password for authentication.
          • spec.podMetricsEndpoints.basicAuth.password.key
            string

            Required value

            The key of the secret to select from. Must be a valid secret key.
          • spec.podMetricsEndpoints.basicAuth.password.name
            string
          • spec.podMetricsEndpoints.basicAuth.password.optional
            boolean
            Specify whether the Secret or its key must be defined
        • spec.podMetricsEndpoints.basicAuth.username
          object
          The secret in the service monitor namespace that contains the username for authentication.
          • spec.podMetricsEndpoints.basicAuth.username.key
            string

            Required value

            The key of the secret to select from. Must be a valid secret key.
          • spec.podMetricsEndpoints.basicAuth.username.name
            string
          • spec.podMetricsEndpoints.basicAuth.username.optional
            boolean
            Specify whether the Secret or its key must be defined
      • spec.podMetricsEndpoints.bearerTokenSecret
        object
        Secret to mount to read bearer token for scraping targets. The secret needs to be in the same namespace as the pod monitor and accessible by the Prometheus Operator.
        • spec.podMetricsEndpoints.bearerTokenSecret.key
          string

          Required value

          The key of the secret to select from. Must be a valid secret key.
        • spec.podMetricsEndpoints.bearerTokenSecret.name
          string
        • spec.podMetricsEndpoints.bearerTokenSecret.optional
          boolean
          Specify whether the Secret or its key must be defined
      • spec.podMetricsEndpoints.enableHttp2
        boolean
        Whether to enable HTTP2.
      • spec.podMetricsEndpoints.filterRunning
        boolean
        Drop pods that are not running. (Failed, Succeeded). Enabled by default. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase
      • spec.podMetricsEndpoints.followRedirects
        boolean
        FollowRedirects configures whether scrape requests follow HTTP 3xx redirects.
      • spec.podMetricsEndpoints.honorLabels
        boolean
        HonorLabels chooses the metric’s labels on collisions with target labels.
      • spec.podMetricsEndpoints.honorTimestamps
        boolean
        HonorTimestamps controls whether Prometheus respects the timestamps present in scraped data.
      • spec.podMetricsEndpoints.interval
        string
        Interval at which metrics should be scraped If not specified Prometheus’ global scrape interval is used.

        Pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$

      • spec.podMetricsEndpoints.metricRelabelings
        array of objects
        MetricRelabelConfigs to apply to samples before ingestion.
        • spec.podMetricsEndpoints.metricRelabelings.action
          string
          Action to perform based on the regex matching. Uppercase and Lowercase actions require Prometheus >= v2.36.0. DropEqual and KeepEqual actions require Prometheus >= v2.41.0. Default: “Replace”

          Default: replace

          Allowed values: replace, Replace, keep, Keep, drop, Drop, hashmod, HashMod, labelmap, LabelMap, labeldrop, LabelDrop, labelkeep, LabelKeep, lowercase, Lowercase, uppercase, Uppercase, keepequal, KeepEqual, dropequal, DropEqual

        • spec.podMetricsEndpoints.metricRelabelings.modulus
          integer
          Modulus to take of the hash of the source label values. Only applicable when the action is HashMod.
        • spec.podMetricsEndpoints.metricRelabelings.regex
          string
          Regular expression against which the extracted value is matched.
        • spec.podMetricsEndpoints.metricRelabelings.replacement
          string
          Replacement value against which a Replace action is performed if the regular expression matches. Regex capture groups are available.
        • spec.podMetricsEndpoints.metricRelabelings.separator
          string
          Separator is the string between concatenated SourceLabels.
        • spec.podMetricsEndpoints.metricRelabelings.sourceLabels
          array of strings
          The source labels select values from existing labels. Their content is concatenated using the configured Separator and matched against the configured regular expression.
          • spec.podMetricsEndpoints.metricRelabelings.sourceLabels.Element of the array
            string
            LabelName is a valid Prometheus label name which may only contain ASCII letters, numbers, as well as underscores.

            Pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$

        • spec.podMetricsEndpoints.metricRelabelings.targetLabel
          string
          Label to which the resulting string is written in a replacement. It is mandatory for Replace, HashMod, Lowercase, Uppercase, KeepEqual and DropEqual actions. Regex capture groups are available.
      • spec.podMetricsEndpoints.oauth2
        object
        OAuth2 for the URL. Only valid in Prometheus versions 2.27.0 and newer.
        • spec.podMetricsEndpoints.oauth2.clientId
          object

          Required value

          The secret or configmap containing the OAuth2 client id
          • spec.podMetricsEndpoints.oauth2.clientId.configMap
            object
            ConfigMap containing data to use for the targets.
            • spec.podMetricsEndpoints.oauth2.clientId.configMap.key
              string

              Required value

              The key to select.
            • spec.podMetricsEndpoints.oauth2.clientId.configMap.name
              string
            • spec.podMetricsEndpoints.oauth2.clientId.configMap.optional
              boolean
              Specify whether the ConfigMap or its key must be defined
          • spec.podMetricsEndpoints.oauth2.clientId.secret
            object
            Secret containing data to use for the targets.
            • spec.podMetricsEndpoints.oauth2.clientId.secret.key
              string

              Required value

              The key of the secret to select from. Must be a valid secret key.
            • spec.podMetricsEndpoints.oauth2.clientId.secret.name
              string
            • spec.podMetricsEndpoints.oauth2.clientId.secret.optional
              boolean
              Specify whether the Secret or its key must be defined
        • spec.podMetricsEndpoints.oauth2.clientSecret
          object

          Required value

          The secret containing the OAuth2 client secret
          • spec.podMetricsEndpoints.oauth2.clientSecret.key
            string

            Required value

            The key of the secret to select from. Must be a valid secret key.
          • spec.podMetricsEndpoints.oauth2.clientSecret.name
            string
          • spec.podMetricsEndpoints.oauth2.clientSecret.optional
            boolean
            Specify whether the Secret or its key must be defined
        • spec.podMetricsEndpoints.oauth2.endpointParams
          object
          Parameters to append to the token URL
        • spec.podMetricsEndpoints.oauth2.scopes
          array of strings
          OAuth2 scopes used for the token request
        • spec.podMetricsEndpoints.oauth2.tokenUrl
          string

          Required value

          The URL to fetch the token from

          Minimal length: 1

      • spec.podMetricsEndpoints.params
        object
        Optional HTTP URL parameters
      • spec.podMetricsEndpoints.path
        string
        HTTP path to scrape for metrics. If empty, Prometheus uses the default value (e.g. /metrics).
      • spec.podMetricsEndpoints.port
        string
        Name of the pod port this endpoint refers to. Mutually exclusive with targetPort.
      • spec.podMetricsEndpoints.proxyUrl
        string
        ProxyURL eg http://proxyserver:2195 Directs scrapes to proxy through this endpoint.
      • spec.podMetricsEndpoints.relabelings
        array of objects
        RelabelConfigs to apply to samples before scraping. Prometheus Operator automatically adds relabelings for a few standard Kubernetes fields. The original scrape job’s name is available via the __tmp_prometheus_job_name label. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
        • spec.podMetricsEndpoints.relabelings.action
          string
          Action to perform based on the regex matching. Uppercase and Lowercase actions require Prometheus >= v2.36.0. DropEqual and KeepEqual actions require Prometheus >= v2.41.0. Default: “Replace”

          Default: replace

          Allowed values: replace, Replace, keep, Keep, drop, Drop, hashmod, HashMod, labelmap, LabelMap, labeldrop, LabelDrop, labelkeep, LabelKeep, lowercase, Lowercase, uppercase, Uppercase, keepequal, KeepEqual, dropequal, DropEqual

        • spec.podMetricsEndpoints.relabelings.modulus
          integer
          Modulus to take of the hash of the source label values. Only applicable when the action is HashMod.
        • spec.podMetricsEndpoints.relabelings.regex
          string
          Regular expression against which the extracted value is matched.
        • spec.podMetricsEndpoints.relabelings.replacement
          string
          Replacement value against which a Replace action is performed if the regular expression matches. Regex capture groups are available.
        • spec.podMetricsEndpoints.relabelings.separator
          string
          Separator is the string between concatenated SourceLabels.
        • spec.podMetricsEndpoints.relabelings.sourceLabels
          array of strings
          The source labels select values from existing labels. Their content is concatenated using the configured Separator and matched against the configured regular expression.
          • spec.podMetricsEndpoints.relabelings.sourceLabels.Element of the array
            string
            LabelName is a valid Prometheus label name which may only contain ASCII letters, numbers, as well as underscores.

            Pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$

        • spec.podMetricsEndpoints.relabelings.targetLabel
          string
          Label to which the resulting string is written in a replacement. It is mandatory for Replace, HashMod, Lowercase, Uppercase, KeepEqual and DropEqual actions. Regex capture groups are available.
      • spec.podMetricsEndpoints.scheme
        string
        HTTP scheme to use for scraping. http and https are the expected values unless you rewrite the __scheme__ label via relabeling. If empty, Prometheus uses the default value http.

        Allowed values: http, https

      • spec.podMetricsEndpoints.scrapeTimeout
        string
        Timeout after which the scrape is ended If not specified, the Prometheus global scrape interval is used.

        Pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$

      • spec.podMetricsEndpoints.targetPort
        integer or string
        Deprecated: Use ‘port’ instead.
      • spec.podMetricsEndpoints.tlsConfig
        object
        TLS configuration to use when scraping the endpoint.
        • spec.podMetricsEndpoints.tlsConfig.ca
          object
          Certificate authority used when verifying server certificates.
          • spec.podMetricsEndpoints.tlsConfig.ca.configMap
            object
            ConfigMap containing data to use for the targets.
          • spec.podMetricsEndpoints.tlsConfig.ca.secret
            object
            Secret containing data to use for the targets.
            • spec.podMetricsEndpoints.tlsConfig.ca.secret.key
              string

              Required value

              The key of the secret to select from. Must be a valid secret key.
            • spec.podMetricsEndpoints.tlsConfig.ca.secret.name
              string
            • spec.podMetricsEndpoints.tlsConfig.ca.secret.optional
              boolean
              Specify whether the Secret or its key must be defined
        • spec.podMetricsEndpoints.tlsConfig.cert
          object
          Client certificate to present when doing client-authentication.
          • spec.podMetricsEndpoints.tlsConfig.cert.configMap
            object
            ConfigMap containing data to use for the targets.
            • spec.podMetricsEndpoints.tlsConfig.cert.configMap.key
              string

              Required value

              The key to select.
            • spec.podMetricsEndpoints.tlsConfig.cert.configMap.name
              string
            • spec.podMetricsEndpoints.tlsConfig.cert.configMap.optional
              boolean
              Specify whether the ConfigMap or its key must be defined
          • spec.podMetricsEndpoints.tlsConfig.cert.secret
            object
            Secret containing data to use for the targets.
            • spec.podMetricsEndpoints.tlsConfig.cert.secret.key
              string

              Required value

              The key of the secret to select from. Must be a valid secret key.
            • spec.podMetricsEndpoints.tlsConfig.cert.secret.name
              string
            • spec.podMetricsEndpoints.tlsConfig.cert.secret.optional
              boolean
              Specify whether the Secret or its key must be defined
        • spec.podMetricsEndpoints.tlsConfig.insecureSkipVerify
          boolean
          Disable target certificate validation.
        • spec.podMetricsEndpoints.tlsConfig.keySecret
          object
          Secret containing the client key file for the targets.
          • spec.podMetricsEndpoints.tlsConfig.keySecret.key
            string

            Required value

            The key of the secret to select from. Must be a valid secret key.
          • spec.podMetricsEndpoints.tlsConfig.keySecret.name
            string
          • spec.podMetricsEndpoints.tlsConfig.keySecret.optional
            boolean
            Specify whether the Secret or its key must be defined
        • spec.podMetricsEndpoints.tlsConfig.serverName
          string
          Used to verify the hostname for the targets.
    • spec.podTargetLabels
      array of strings
      PodTargetLabels transfers labels on the Kubernetes Pod onto the target.
    • spec.sampleLimit
      integer
      SampleLimit defines per-scrape limit on number of scraped samples that will be accepted.
    • spec.selector
      object

      Required value

      Selector to select Pod objects.
      • spec.selector.matchExpressions
        array of objects
        matchExpressions is a list of label selector requirements. The requirements are ANDed.
        • spec.selector.matchExpressions.key
          string
          key is the label key that the selector applies to.
        • spec.selector.matchExpressions.operator
          string
          operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
        • spec.selector.matchExpressions.values
          array of strings
          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.
      • spec.selector.matchLabels
        object
        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.
    • spec.targetLimit
      integer
      TargetLimit defines a limit on the number of scraped targets that will be accepted.

Probe

Scope: Namespaced
Version: v1

Probe defines monitoring for a set of static targets or ingresses.
  • apiVersion
    string
    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
  • kind
    string
    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
  • metadata
    object
  • spec
    object
    Specification of desired Ingress selection for target discovery by Prometheus.
    • spec.authorization
      object
      Authorization section for this endpoint
      • spec.authorization.credentials
        object
        Selects a key of a Secret in the namespace that contains the credentials for authentication.
      • spec.authorization.type
        string
        Defines the authentication type. The value is case-insensitive. “Basic” is not a supported value. Default: “Bearer”
    • spec.basicAuth
      object
      BasicAuth allow an endpoint to authenticate over basic authentication. More info: https://prometheus.io/docs/operating/configuration/#endpoint
      • spec.basicAuth.password
        object
        The secret in the service monitor namespace that contains the password for authentication.
      • spec.basicAuth.username
        object
        The secret in the service monitor namespace that contains the username for authentication.
    • spec.bearerTokenSecret
      object
      Secret to mount to read bearer token for scraping targets. The secret needs to be in the same namespace as the probe and accessible by the Prometheus Operator.
    • spec.interval
      string
      Interval at which targets are probed using the configured prober. If not specified Prometheus’ global scrape interval is used.

      Pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$

    • spec.jobName
      string
      The job name assigned to scraped metrics by default.
    • spec.keepDroppedTargets
      integer
      Per-scrape limit on the number of targets dropped by relabeling that will be kept in memory. 0 means no limit. It requires Prometheus >= v2.47.0.
    • spec.labelLimit
      integer
      Per-scrape limit on number of labels that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer.
    • spec.labelNameLengthLimit
      integer
      Per-scrape limit on length of labels name that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer.
    • spec.labelValueLengthLimit
      integer
      Per-scrape limit on length of labels value that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer.
    • spec.metricRelabelings
      array of objects
      MetricRelabelConfigs to apply to samples before ingestion.
      • spec.metricRelabelings.action
        string
        Action to perform based on the regex matching. Uppercase and Lowercase actions require Prometheus >= v2.36.0. DropEqual and KeepEqual actions require Prometheus >= v2.41.0. Default: “Replace”

        Default: replace

        Allowed values: replace, Replace, keep, Keep, drop, Drop, hashmod, HashMod, labelmap, LabelMap, labeldrop, LabelDrop, labelkeep, LabelKeep, lowercase, Lowercase, uppercase, Uppercase, keepequal, KeepEqual, dropequal, DropEqual

      • spec.metricRelabelings.modulus
        integer
        Modulus to take of the hash of the source label values. Only applicable when the action is HashMod.
      • spec.metricRelabelings.regex
        string
        Regular expression against which the extracted value is matched.
      • spec.metricRelabelings.replacement
        string
        Replacement value against which a Replace action is performed if the regular expression matches. Regex capture groups are available.
      • spec.metricRelabelings.separator
        string
        Separator is the string between concatenated SourceLabels.
      • spec.metricRelabelings.sourceLabels
        array of strings
        The source labels select values from existing labels. Their content is concatenated using the configured Separator and matched against the configured regular expression.
        • spec.metricRelabelings.sourceLabels.Element of the array
          string
          LabelName is a valid Prometheus label name which may only contain ASCII letters, numbers, as well as underscores.

          Pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$

      • spec.metricRelabelings.targetLabel
        string
        Label to which the resulting string is written in a replacement. It is mandatory for Replace, HashMod, Lowercase, Uppercase, KeepEqual and DropEqual actions. Regex capture groups are available.
    • spec.module
      string
      The module to use for probing specifying how to probe the target. Example module configuring in the blackbox exporter: https://github.com/prometheus/blackbox_exporter/blob/master/example.yml
    • spec.oauth2
      object
      OAuth2 for the URL. Only valid in Prometheus versions 2.27.0 and newer.
      • spec.oauth2.clientId
        object

        Required value

        The secret or configmap containing the OAuth2 client id
        • spec.oauth2.clientId.configMap
          object
          ConfigMap containing data to use for the targets.
        • spec.oauth2.clientId.secret
          object
          Secret containing data to use for the targets.
      • spec.oauth2.clientSecret
        object

        Required value

        The secret containing the OAuth2 client secret
      • spec.oauth2.endpointParams
        object
        Parameters to append to the token URL
      • spec.oauth2.scopes
        array of strings
        OAuth2 scopes used for the token request
      • spec.oauth2.tokenUrl
        string

        Required value

        The URL to fetch the token from

        Minimal length: 1

    • spec.prober
      object
      Specification for the prober to use for probing targets. The prober.URL parameter is required. Targets cannot be probed if left empty.
      • spec.prober.path
        string
        Path to collect metrics from. Defaults to /probe.

        Default: /probe

      • spec.prober.proxyUrl
        string
        Optional ProxyURL.
      • spec.prober.scheme
        string
        HTTP scheme to use for scraping. http and https are the expected values unless you rewrite the __scheme__ label via relabeling. If empty, Prometheus uses the default value http.

        Allowed values: http, https

      • spec.prober.url
        string

        Required value

        Mandatory URL of the prober.
    • spec.sampleLimit
      integer
      SampleLimit defines per-scrape limit on number of scraped samples that will be accepted.
    • spec.scrapeTimeout
      string
      Timeout for scraping metrics from the Prometheus exporter. If not specified, the Prometheus global scrape timeout is used.

      Pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$

    • spec.targetLimit
      integer
      TargetLimit defines a limit on the number of scraped targets that will be accepted.
    • spec.targets
      object
      Targets defines a set of static or dynamically discovered targets to probe.
      • spec.targets.ingress
        object
        ingress defines the Ingress objects to probe and the relabeling configuration. If staticConfig is also defined, staticConfig takes precedence.
        • spec.targets.ingress.namespaceSelector
          object
          From which namespaces to select Ingress objects.
          • spec.targets.ingress.namespaceSelector.any
            boolean
            Boolean describing whether all namespaces are selected in contrast to a list restricting them.
          • spec.targets.ingress.namespaceSelector.matchNames
            array of strings
            List of namespace names to select from.
        • spec.targets.ingress.relabelingConfigs
          array of objects
          RelabelConfigs to apply to the label set of the target before it gets scraped. The original ingress address is available via the __tmp_prometheus_ingress_address label. It can be used to customize the probed URL. The original scrape job’s name is available via the __tmp_prometheus_job_name label. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
          • spec.targets.ingress.relabelingConfigs.action
            string
            Action to perform based on the regex matching. Uppercase and Lowercase actions require Prometheus >= v2.36.0. DropEqual and KeepEqual actions require Prometheus >= v2.41.0. Default: “Replace”

            Default: replace

            Allowed values: replace, Replace, keep, Keep, drop, Drop, hashmod, HashMod, labelmap, LabelMap, labeldrop, LabelDrop, labelkeep, LabelKeep, lowercase, Lowercase, uppercase, Uppercase, keepequal, KeepEqual, dropequal, DropEqual

          • spec.targets.ingress.relabelingConfigs.modulus
            integer
            Modulus to take of the hash of the source label values. Only applicable when the action is HashMod.
          • spec.targets.ingress.relabelingConfigs.regex
            string
            Regular expression against which the extracted value is matched.
          • spec.targets.ingress.relabelingConfigs.replacement
            string
            Replacement value against which a Replace action is performed if the regular expression matches. Regex capture groups are available.
          • spec.targets.ingress.relabelingConfigs.separator
            string
            Separator is the string between concatenated SourceLabels.
          • spec.targets.ingress.relabelingConfigs.sourceLabels
            array of strings
            The source labels select values from existing labels. Their content is concatenated using the configured Separator and matched against the configured regular expression.
            • spec.targets.ingress.relabelingConfigs.sourceLabels.Element of the array
              string
              LabelName is a valid Prometheus label name which may only contain ASCII letters, numbers, as well as underscores.

              Pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$

          • spec.targets.ingress.relabelingConfigs.targetLabel
            string
            Label to which the resulting string is written in a replacement. It is mandatory for Replace, HashMod, Lowercase, Uppercase, KeepEqual and DropEqual actions. Regex capture groups are available.
        • spec.targets.ingress.selector
          object
          Selector to select the Ingress objects.
          • spec.targets.ingress.selector.matchExpressions
            array of objects
            matchExpressions is a list of label selector requirements. The requirements are ANDed.
            • spec.targets.ingress.selector.matchExpressions.key
              string
              key is the label key that the selector applies to.
            • spec.targets.ingress.selector.matchExpressions.operator
              string
              operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
            • spec.targets.ingress.selector.matchExpressions.values
              array of strings
              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.
          • spec.targets.ingress.selector.matchLabels
            object
            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.
      • spec.targets.staticConfig
        object
        staticConfig defines the static list of targets to probe and the relabeling configuration. If ingress is also defined, staticConfig takes precedence. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#static_config.
        • spec.targets.staticConfig.labels
          object
          Labels assigned to all metrics scraped from the targets.
        • spec.targets.staticConfig.relabelingConfigs
          array of objects
          RelabelConfigs to apply to the label set of the targets before it gets scraped. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
          • spec.targets.staticConfig.relabelingConfigs.action
            string
            Action to perform based on the regex matching. Uppercase and Lowercase actions require Prometheus >= v2.36.0. DropEqual and KeepEqual actions require Prometheus >= v2.41.0. Default: “Replace”

            Default: replace

            Allowed values: replace, Replace, keep, Keep, drop, Drop, hashmod, HashMod, labelmap, LabelMap, labeldrop, LabelDrop, labelkeep, LabelKeep, lowercase, Lowercase, uppercase, Uppercase, keepequal, KeepEqual, dropequal, DropEqual

          • spec.targets.staticConfig.relabelingConfigs.modulus
            integer
            Modulus to take of the hash of the source label values. Only applicable when the action is HashMod.
          • spec.targets.staticConfig.relabelingConfigs.regex
            string
            Regular expression against which the extracted value is matched.
          • spec.targets.staticConfig.relabelingConfigs.replacement
            string
            Replacement value against which a Replace action is performed if the regular expression matches. Regex capture groups are available.
          • spec.targets.staticConfig.relabelingConfigs.separator
            string
            Separator is the string between concatenated SourceLabels.
          • spec.targets.staticConfig.relabelingConfigs.sourceLabels
            array of strings
            The source labels select values from existing labels. Their content is concatenated using the configured Separator and matched against the configured regular expression.
            • spec.targets.staticConfig.relabelingConfigs.sourceLabels.Element of the array
              string
              LabelName is a valid Prometheus label name which may only contain ASCII letters, numbers, as well as underscores.

              Pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$

          • spec.targets.staticConfig.relabelingConfigs.targetLabel
            string
            Label to which the resulting string is written in a replacement. It is mandatory for Replace, HashMod, Lowercase, Uppercase, KeepEqual and DropEqual actions. Regex capture groups are available.
        • spec.targets.staticConfig.static
          array of strings
          The list of hosts to probe.
    • spec.tlsConfig
      object
      TLS configuration to use when scraping the endpoint.
      • spec.tlsConfig.ca
        object
        Certificate authority used when verifying server certificates.
        • spec.tlsConfig.ca.configMap
          object
          ConfigMap containing data to use for the targets.
        • spec.tlsConfig.ca.secret
          object
          Secret containing data to use for the targets.
      • spec.tlsConfig.cert
        object
        Client certificate to present when doing client-authentication.
        • spec.tlsConfig.cert.configMap
          object
          ConfigMap containing data to use for the targets.
        • spec.tlsConfig.cert.secret
          object
          Secret containing data to use for the targets.
      • spec.tlsConfig.insecureSkipVerify
        boolean
        Disable target certificate validation.
      • spec.tlsConfig.keySecret
        object
        Secret containing the client key file for the targets.
      • spec.tlsConfig.serverName
        string
        Used to verify the hostname for the targets.

ScrapeConfig

Scope: Namespaced
Version: v1alpha1

ScrapeConfig defines a namespaced Prometheus scrape_config to be aggregated across multiple namespaces into the Prometheus configuration.
  • apiVersion
    string
    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
  • kind
    string
    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
  • metadata
    object
  • spec
    object
    ScrapeConfigSpec is a specification of the desired configuration for a scrape configuration.
    • spec.authorization
      object
      Authorization header to use on every scrape request.
      • spec.authorization.credentials
        object
        Selects a key of a Secret in the namespace that contains the credentials for authentication.
      • spec.authorization.type
        string
        Defines the authentication type. The value is case-insensitive. “Basic” is not a supported value. Default: “Bearer”
    • spec.basicAuth
      object
      BasicAuth information to use on every scrape request.
      • spec.basicAuth.password
        object
        The secret in the service monitor namespace that contains the password for authentication.
      • spec.basicAuth.username
        object
        The secret in the service monitor namespace that contains the username for authentication.
    • spec.consulSDConfigs
      array of objects
      ConsulSDConfigs defines a list of Consul service discovery configurations.
      • spec.consulSDConfigs.allow_stale
        boolean
        Allow stale Consul results (see https://www.consul.io/api/features/consistency.html). Will reduce load on Consul. If unset, Prometheus uses its default value.
      • spec.consulSDConfigs.authorization
        object
        Authorization header configuration to authenticate against the Consul Server.
        • spec.consulSDConfigs.authorization.credentials
          object
          Selects a key of a Secret in the namespace that contains the credentials for authentication.
          • spec.consulSDConfigs.authorization.credentials.key
            string

            Required value

            The key of the secret to select from. Must be a valid secret key.
          • spec.consulSDConfigs.authorization.credentials.name
            string
          • spec.consulSDConfigs.authorization.credentials.optional
            boolean
            Specify whether the Secret or its key must be defined
        • spec.consulSDConfigs.authorization.type
          string
          Defines the authentication type. The value is case-insensitive. “Basic” is not a supported value. Default: “Bearer”
      • spec.consulSDConfigs.basicAuth
        object
        BasicAuth information to authenticate against the Consul Server. More info: https://prometheus.io/docs/operating/configuration/#endpoints
        • spec.consulSDConfigs.basicAuth.password
          object
          The secret in the service monitor namespace that contains the password for authentication.
          • spec.consulSDConfigs.basicAuth.password.key
            string

            Required value

            The key of the secret to select from. Must be a valid secret key.
          • spec.consulSDConfigs.basicAuth.password.name
            string
          • spec.consulSDConfigs.basicAuth.password.optional
            boolean
            Specify whether the Secret or its key must be defined
        • spec.consulSDConfigs.basicAuth.username
          object
          The secret in the service monitor namespace that contains the username for authentication.
          • spec.consulSDConfigs.basicAuth.username.key
            string

            Required value

            The key of the secret to select from. Must be a valid secret key.
          • spec.consulSDConfigs.basicAuth.username.name
            string
          • spec.consulSDConfigs.basicAuth.username.optional
            boolean
            Specify whether the Secret or its key must be defined
      • spec.consulSDConfigs.datacenter
        string
        Consul Datacenter name, if not provided it will use the local Consul Agent Datacenter.
      • spec.consulSDConfigs.enable_http2
        boolean
        Whether to enable HTTP2. If unset, Prometheus uses its default value.
      • spec.consulSDConfigs.follow_redirects
        boolean
        Configure whether HTTP requests follow HTTP 3xx redirects. If unset, Prometheus uses its default value.
      • spec.consulSDConfigs.namespace
        string
        Namespaces are only supported in Consul Enterprise.
      • spec.consulSDConfigs.no_proxy
        string
        Comma-separated string that can contain IPs, CIDR notation, domain names that should be excluded from proxying. IP and domain names can contain port numbers.
      • spec.consulSDConfigs.node_meta
        object
        Node metadata key/value pairs to filter nodes for a given service.
      • spec.consulSDConfigs.oauth2
        object
        Optional OAuth 2.0 configuration.
        • spec.consulSDConfigs.oauth2.clientId
          object

          Required value

          The secret or configmap containing the OAuth2 client id
          • spec.consulSDConfigs.oauth2.clientId.configMap
            object
            ConfigMap containing data to use for the targets.
          • spec.consulSDConfigs.oauth2.clientId.secret
            object
            Secret containing data to use for the targets.
            • spec.consulSDConfigs.oauth2.clientId.secret.key
              string

              Required value

              The key of the secret to select from. Must be a valid secret key.
            • spec.consulSDConfigs.oauth2.clientId.secret.name
              string
            • spec.consulSDConfigs.oauth2.clientId.secret.optional
              boolean
              Specify whether the Secret or its key must be defined
        • spec.consulSDConfigs.oauth2.clientSecret
          object

          Required value

          The secret containing the OAuth2 client secret
          • spec.consulSDConfigs.oauth2.clientSecret.key
            string

            Required value

            The key of the secret to select from. Must be a valid secret key.
          • spec.consulSDConfigs.oauth2.clientSecret.name
            string
          • spec.consulSDConfigs.oauth2.clientSecret.optional
            boolean
            Specify whether the Secret or its key must be defined
        • spec.consulSDConfigs.oauth2.endpointParams
          object
          Parameters to append to the token URL
        • spec.consulSDConfigs.oauth2.scopes
          array of strings
          OAuth2 scopes used for the token request
        • spec.consulSDConfigs.oauth2.tokenUrl
          string

          Required value

          The URL to fetch the token from

          Minimal length: 1

      • spec.consulSDConfigs.partition
        string
        Admin Partitions are only supported in Consul Enterprise.
      • spec.consulSDConfigs.proxy_connect_header
        object
        Specifies headers to send to proxies during CONNECT requests.
        • spec.consulSDConfigs.proxy_connect_header.<KEY_NAME>
          object

          <KEY_NAME> — item (key) name.

          SecretKeySelector selects a key of a Secret.

          • spec.consulSDConfigs.proxy_connect_header.<KEY_NAME>.key
            string

            Required value

            The key of the secret to select from. Must be a valid secret key.
          • spec.consulSDConfigs.proxy_connect_header.<KEY_NAME>.name
            string
          • spec.consulSDConfigs.proxy_connect_header.<KEY_NAME>.optional
            boolean
            Specify whether the Secret or its key must be defined
      • spec.consulSDConfigs.proxy_from_environment
        boolean
        Use proxy URL indicated by environment variables (HTTP_PROXY, https_proxy, HTTPs_PROXY, https_proxy, and no_proxy) If unset, Prometheus uses its default value.
      • spec.consulSDConfigs.proxy_url
        string
        Optional proxy URL.
      • spec.consulSDConfigs.refresh_interval
        string
        The time after which the provided names are refreshed. On large setup it might be a good idea to increase this value because the catalog will change all the time. If unset, Prometheus uses its default value.

        Pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$

      • spec.consulSDConfigs.scheme
        string
        HTTP Scheme default “http”

        Allowed values: HTTP, HTTPS

      • spec.consulSDConfigs.server
        string
        A valid string consisting of a hostname or IP followed by an optional port number.

        Minimal length: 1

      • spec.consulSDConfigs.services
        array of strings
        A list of services for which targets are retrieved. If omitted, all services are scraped.
      • spec.consulSDConfigs.tag_separator
        string
        The string by which Consul tags are joined into the tag label. If unset, Prometheus uses its default value.
      • spec.consulSDConfigs.tags
        array of strings
        An optional list of tags used to filter nodes for a given service. Services must contain all tags in the list.
      • spec.consulSDConfigs.tlsConfig
        object
        TLS Config
        • spec.consulSDConfigs.tlsConfig.ca
          object
          Certificate authority used when verifying server certificates.
          • spec.consulSDConfigs.tlsConfig.ca.configMap
            object
            ConfigMap containing data to use for the targets.
          • spec.consulSDConfigs.tlsConfig.ca.secret
            object
            Secret containing data to use for the targets.
            • spec.consulSDConfigs.tlsConfig.ca.secret.key
              string

              Required value

              The key of the secret to select from. Must be a valid secret key.
            • spec.consulSDConfigs.tlsConfig.ca.secret.name
              string
            • spec.consulSDConfigs.tlsConfig.ca.secret.optional
              boolean
              Specify whether the Secret or its key must be defined
        • spec.consulSDConfigs.tlsConfig.cert
          object
          Client certificate to present when doing client-authentication.
          • spec.consulSDConfigs.tlsConfig.cert.configMap
            object
            ConfigMap containing data to use for the targets.
          • spec.consulSDConfigs.tlsConfig.cert.secret
            object
            Secret containing data to use for the targets.
            • spec.consulSDConfigs.tlsConfig.cert.secret.key
              string

              Required value

              The key of the secret to select from. Must be a valid secret key.
            • spec.consulSDConfigs.tlsConfig.cert.secret.name
              string
            • spec.consulSDConfigs.tlsConfig.cert.secret.optional
              boolean
              Specify whether the Secret or its key must be defined
        • spec.consulSDConfigs.tlsConfig.insecureSkipVerify
          boolean
          Disable target certificate validation.
        • spec.consulSDConfigs.tlsConfig.keySecret
          object
          Secret containing the client key file for the targets.
          • spec.consulSDConfigs.tlsConfig.keySecret.key
            string

            Required value

            The key of the secret to select from. Must be a valid secret key.
          • spec.consulSDConfigs.tlsConfig.keySecret.name
            string
          • spec.consulSDConfigs.tlsConfig.keySecret.optional
            boolean
            Specify whether the Secret or its key must be defined
        • spec.consulSDConfigs.tlsConfig.serverName
          string
          Used to verify the hostname for the targets.
      • spec.consulSDConfigs.tokenRef
        object
        Consul ACL TokenRef, if not provided it will use the ACL from the local Consul Agent.
    • spec.dnsSDConfigs
      array of objects
      DNSSDConfigs defines a list of DNS service discovery configurations.
      • spec.dnsSDConfigs.names
        array of strings
        A list of DNS domain names to be queried.
      • spec.dnsSDConfigs.port
        integer
        The port number used if the query type is not SRV Ignored for SRV records
      • spec.dnsSDConfigs.refreshInterval
        string
        RefreshInterval configures the time after which the provided names are refreshed. If not set, Prometheus uses its default value.

        Pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$

      • spec.dnsSDConfigs.type
        string
        The type of DNS query to perform. One of SRV, A, AAAA or MX. If not set, Prometheus uses its default value.

        Allowed values: SRV, A, AAAA, MX

    • spec.fileSDConfigs
      array of objects
      FileSDConfigs defines a list of file service discovery configurations.
      • spec.fileSDConfigs.files
        array of strings
        List of files to be used for file discovery. Recommendation: use absolute paths. While relative paths work, the prometheus-operator project makes no guarantees about the working directory where the configuration file is stored. Files must be mounted using Prometheus.ConfigMaps or Prometheus.Secrets.
        • spec.fileSDConfigs.files.Element of the array
          string
          SDFile represents a file used for service discovery

          Pattern: ^[^*]*(\*[^/]*)?\.(json|yml|yaml|JSON|YML|YAML)$

      • spec.fileSDConfigs.refreshInterval
        string
        RefreshInterval configures the refresh interval at which Prometheus will reload the content of the files.

        Pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$

    • spec.honorLabels
      boolean
      HonorLabels chooses the metric’s labels on collisions with target labels.
    • spec.honorTimestamps
      boolean
      HonorTimestamps controls whether Prometheus respects the timestamps present in scraped data.
    • spec.httpSDConfigs
      array of objects
      HTTPSDConfigs defines a list of HTTP service discovery configurations.
      • spec.httpSDConfigs.authorization
        object
        Authorization header configuration to authenticate against the target HTTP endpoint.
        • spec.httpSDConfigs.authorization.credentials
          object
          Selects a key of a Secret in the namespace that contains the credentials for authentication.
          • spec.httpSDConfigs.authorization.credentials.key
            string

            Required value

            The key of the secret to select from. Must be a valid secret key.
          • spec.httpSDConfigs.authorization.credentials.name
            string
          • spec.httpSDConfigs.authorization.credentials.optional
            boolean
            Specify whether the Secret or its key must be defined
        • spec.httpSDConfigs.authorization.type
          string
          Defines the authentication type. The value is case-insensitive. “Basic” is not a supported value. Default: “Bearer”
      • spec.httpSDConfigs.basicAuth
        object
        BasicAuth information to authenticate against the target HTTP endpoint. More info: https://prometheus.io/docs/operating/configuration/#endpoints
        • spec.httpSDConfigs.basicAuth.password
          object
          The secret in the service monitor namespace that contains the password for authentication.
          • spec.httpSDConfigs.basicAuth.password.key
            string

            Required value

            The key of the secret to select from. Must be a valid secret key.
          • spec.httpSDConfigs.basicAuth.password.name
            string
          • spec.httpSDConfigs.basicAuth.password.optional
            boolean
            Specify whether the Secret or its key must be defined
        • spec.httpSDConfigs.basicAuth.username
          object
          The secret in the service monitor namespace that contains the username for authentication.
          • spec.httpSDConfigs.basicAuth.username.key
            string

            Required value

            The key of the secret to select from. Must be a valid secret key.
          • spec.httpSDConfigs.basicAuth.username.name
            string
          • spec.httpSDConfigs.basicAuth.username.optional
            boolean
            Specify whether the Secret or its key must be defined
      • spec.httpSDConfigs.refreshInterval
        string
        RefreshInterval configures the refresh interval at which Prometheus will re-query the endpoint to update the target list.

        Pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$

      • spec.httpSDConfigs.tlsConfig
        object
        TLS configuration applying to the target HTTP endpoint.
        • spec.httpSDConfigs.tlsConfig.ca
          object
          Certificate authority used when verifying server certificates.
          • spec.httpSDConfigs.tlsConfig.ca.configMap
            object
            ConfigMap containing data to use for the targets.
          • spec.httpSDConfigs.tlsConfig.ca.secret
            object
            Secret containing data to use for the targets.
            • spec.httpSDConfigs.tlsConfig.ca.secret.key
              string

              Required value

              The key of the secret to select from. Must be a valid secret key.
            • spec.httpSDConfigs.tlsConfig.ca.secret.name
              string
            • spec.httpSDConfigs.tlsConfig.ca.secret.optional
              boolean
              Specify whether the Secret or its key must be defined
        • spec.httpSDConfigs.tlsConfig.cert
          object
          Client certificate to present when doing client-authentication.
          • spec.httpSDConfigs.tlsConfig.cert.configMap
            object
            ConfigMap containing data to use for the targets.
          • spec.httpSDConfigs.tlsConfig.cert.secret
            object
            Secret containing data to use for the targets.
            • spec.httpSDConfigs.tlsConfig.cert.secret.key
              string

              Required value

              The key of the secret to select from. Must be a valid secret key.
            • spec.httpSDConfigs.tlsConfig.cert.secret.name
              string
            • spec.httpSDConfigs.tlsConfig.cert.secret.optional
              boolean
              Specify whether the Secret or its key must be defined
        • spec.httpSDConfigs.tlsConfig.insecureSkipVerify
          boolean
          Disable target certificate validation.
        • spec.httpSDConfigs.tlsConfig.keySecret
          object
          Secret containing the client key file for the targets.
          • spec.httpSDConfigs.tlsConfig.keySecret.key
            string

            Required value

            The key of the secret to select from. Must be a valid secret key.
          • spec.httpSDConfigs.tlsConfig.keySecret.name
            string
          • spec.httpSDConfigs.tlsConfig.keySecret.optional
            boolean
            Specify whether the Secret or its key must be defined
        • spec.httpSDConfigs.tlsConfig.serverName
          string
          Used to verify the hostname for the targets.
      • spec.httpSDConfigs.url
        string
        URL from which the targets are fetched.

        Minimal length: 1

        Pattern: ^http(s)?://.+$

    • spec.keepDroppedTargets
      integer
      Per-scrape limit on the number of targets dropped by relabeling that will be kept in memory. 0 means no limit. It requires Prometheus >= v2.47.0.
    • spec.kubernetesSDConfigs
      array of objects
      KubernetesSDConfigs defines a list of Kubernetes service discovery configurations.
      • spec.kubernetesSDConfigs.role
        string
        Role of the Kubernetes entities that should be discovered. Currently the only supported role is “Node”.

        Allowed values: Node

    • spec.labelLimit
      integer
      Per-scrape limit on number of labels that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer.
    • spec.labelNameLengthLimit
      integer
      Per-scrape limit on length of labels name that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer.
    • spec.labelValueLengthLimit
      integer
      Per-scrape limit on length of labels value that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer.
    • spec.metricRelabelings
      array of objects
      MetricRelabelConfigs to apply to samples before ingestion.
      • spec.metricRelabelings.action
        string
        Action to perform based on the regex matching. Uppercase and Lowercase actions require Prometheus >= v2.36.0. DropEqual and KeepEqual actions require Prometheus >= v2.41.0. Default: “Replace”

        Default: replace

        Allowed values: replace, Replace, keep, Keep, drop, Drop, hashmod, HashMod, labelmap, LabelMap, labeldrop, LabelDrop, labelkeep, LabelKeep, lowercase, Lowercase, uppercase, Uppercase, keepequal, KeepEqual, dropequal, DropEqual

      • spec.metricRelabelings.modulus
        integer
        Modulus to take of the hash of the source label values. Only applicable when the action is HashMod.
      • spec.metricRelabelings.regex
        string
        Regular expression against which the extracted value is matched.
      • spec.metricRelabelings.replacement
        string
        Replacement value against which a Replace action is performed if the regular expression matches. Regex capture groups are available.
      • spec.metricRelabelings.separator
        string
        Separator is the string between concatenated SourceLabels.
      • spec.metricRelabelings.sourceLabels
        array of strings
        The source labels select values from existing labels. Their content is concatenated using the configured Separator and matched against the configured regular expression.
        • spec.metricRelabelings.sourceLabels.Element of the array
          string
          LabelName is a valid Prometheus label name which may only contain ASCII letters, numbers, as well as underscores.

          Pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$

      • spec.metricRelabelings.targetLabel
        string
        Label to which the resulting string is written in a replacement. It is mandatory for Replace, HashMod, Lowercase, Uppercase, KeepEqual and DropEqual actions. Regex capture groups are available.
    • spec.metricsPath
      string
      MetricsPath HTTP path to scrape for metrics. If empty, Prometheus uses the default value (e.g. /metrics).
    • spec.params
      object
      Optional HTTP URL parameters
    • spec.relabelings
      array of objects
      RelabelConfigs defines how to rewrite the target’s labels before scraping. Prometheus Operator automatically adds relabelings for a few standard Kubernetes fields. The original scrape job’s name is available via the __tmp_prometheus_job_name label. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
      • spec.relabelings.action
        string
        Action to perform based on the regex matching. Uppercase and Lowercase actions require Prometheus >= v2.36.0. DropEqual and KeepEqual actions require Prometheus >= v2.41.0. Default: “Replace”

        Default: replace

        Allowed values: replace, Replace, keep, Keep, drop, Drop, hashmod, HashMod, labelmap, LabelMap, labeldrop, LabelDrop, labelkeep, LabelKeep, lowercase, Lowercase, uppercase, Uppercase, keepequal, KeepEqual, dropequal, DropEqual

      • spec.relabelings.modulus
        integer
        Modulus to take of the hash of the source label values. Only applicable when the action is HashMod.
      • spec.relabelings.regex
        string
        Regular expression against which the extracted value is matched.
      • spec.relabelings.replacement
        string
        Replacement value against which a Replace action is performed if the regular expression matches. Regex capture groups are available.
      • spec.relabelings.separator
        string
        Separator is the string between concatenated SourceLabels.
      • spec.relabelings.sourceLabels
        array of strings
        The source labels select values from existing labels. Their content is concatenated using the configured Separator and matched against the configured regular expression.
        • spec.relabelings.sourceLabels.Element of the array
          string
          LabelName is a valid Prometheus label name which may only contain ASCII letters, numbers, as well as underscores.

          Pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$

      • spec.relabelings.targetLabel
        string
        Label to which the resulting string is written in a replacement. It is mandatory for Replace, HashMod, Lowercase, Uppercase, KeepEqual and DropEqual actions. Regex capture groups are available.
    • spec.sampleLimit
      integer
      SampleLimit defines per-scrape limit on number of scraped samples that will be accepted.
    • spec.scheme
      string
      Configures the protocol scheme used for requests. If empty, Prometheus uses HTTP by default.

      Allowed values: HTTP, HTTPS

    • spec.scrapeInterval
      string
      ScrapeInterval is the interval between consecutive scrapes.

      Pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$

    • spec.scrapeTimeout
      string
      ScrapeTimeout is the number of seconds to wait until a scrape request times out.

      Pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$

    • spec.staticConfigs
      array of objects
      StaticConfigs defines a list of static targets with a common label set.
      • spec.staticConfigs.labels
        object
        Labels assigned to all metrics scraped from the targets.
      • spec.staticConfigs.targets
        array of strings
        List of targets for this static configuration.
        • spec.staticConfigs.targets.Element of the array
          string
          Target represents a target for Prometheus to scrape
    • spec.targetLimit
      integer
      TargetLimit defines a limit on the number of scraped targets that will be accepted.
    • spec.tlsConfig
      object
      TLS configuration to use on every scrape request
      • spec.tlsConfig.ca
        object
        Certificate authority used when verifying server certificates.
        • spec.tlsConfig.ca.configMap
          object
          ConfigMap containing data to use for the targets.
        • spec.tlsConfig.ca.secret
          object
          Secret containing data to use for the targets.
      • spec.tlsConfig.cert
        object
        Client certificate to present when doing client-authentication.
        • spec.tlsConfig.cert.configMap
          object
          ConfigMap containing data to use for the targets.
        • spec.tlsConfig.cert.secret
          object
          Secret containing data to use for the targets.
      • spec.tlsConfig.insecureSkipVerify
        boolean
        Disable target certificate validation.
      • spec.tlsConfig.keySecret
        object
        Secret containing the client key file for the targets.
      • spec.tlsConfig.serverName
        string
        Used to verify the hostname for the targets.

ServiceMonitor

Scope: Namespaced
Version: v1

ServiceMonitor defines monitoring for a set of services.
  • apiVersion
    string
    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
  • kind
    string
    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
  • metadata
    object
  • spec
    object
    Specification of desired Service selection for target discovery by Prometheus.
    • spec.attachMetadata
      object
      Attaches node metadata to discovered targets. Requires Prometheus v2.37.0 and above.
      • spec.attachMetadata.node
        boolean
        When set to true, Prometheus must have permissions to get Nodes.
    • spec.endpoints
      array of objects

      Required value

      A list of endpoints allowed as part of this ServiceMonitor.
      • spec.endpoints.authorization
        object
        Authorization section for this endpoint
        • spec.endpoints.authorization.credentials
          object
          Selects a key of a Secret in the namespace that contains the credentials for authentication.
          • spec.endpoints.authorization.credentials.key
            string

            Required value

            The key of the secret to select from. Must be a valid secret key.
          • spec.endpoints.authorization.credentials.name
            string
          • spec.endpoints.authorization.credentials.optional
            boolean
            Specify whether the Secret or its key must be defined
        • spec.endpoints.authorization.type
          string
          Defines the authentication type. The value is case-insensitive. “Basic” is not a supported value. Default: “Bearer”
      • spec.endpoints.basicAuth
        object
        BasicAuth allow an endpoint to authenticate over basic authentication More info: https://prometheus.io/docs/operating/configuration/#endpoints
        • spec.endpoints.basicAuth.password
          object
          The secret in the service monitor namespace that contains the password for authentication.
          • spec.endpoints.basicAuth.password.key
            string

            Required value

            The key of the secret to select from. Must be a valid secret key.
          • spec.endpoints.basicAuth.password.name
            string
          • spec.endpoints.basicAuth.password.optional
            boolean
            Specify whether the Secret or its key must be defined
        • spec.endpoints.basicAuth.username
          object
          The secret in the service monitor namespace that contains the username for authentication.
          • spec.endpoints.basicAuth.username.key
            string

            Required value

            The key of the secret to select from. Must be a valid secret key.
          • spec.endpoints.basicAuth.username.name
            string
          • spec.endpoints.basicAuth.username.optional
            boolean
            Specify whether the Secret or its key must be defined
      • spec.endpoints.bearerTokenFile
        string
        File to read bearer token for scraping targets.
      • spec.endpoints.bearerTokenSecret
        object
        Secret to mount to read bearer token for scraping targets. The secret needs to be in the same namespace as the service monitor and accessible by the Prometheus Operator.
      • spec.endpoints.enableHttp2
        boolean
        Whether to enable HTTP2.
      • spec.endpoints.filterRunning
        boolean
        Drop pods that are not running. (Failed, Succeeded). Enabled by default. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase
      • spec.endpoints.followRedirects
        boolean
        FollowRedirects configures whether scrape requests follow HTTP 3xx redirects.
      • spec.endpoints.honorLabels
        boolean
        HonorLabels chooses the metric’s labels on collisions with target labels.
      • spec.endpoints.honorTimestamps
        boolean
        HonorTimestamps controls whether Prometheus respects the timestamps present in scraped data.
      • spec.endpoints.interval
        string
        Interval at which metrics should be scraped If not specified Prometheus’ global scrape interval is used.

        Pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$

      • spec.endpoints.metricRelabelings
        array of objects
        MetricRelabelConfigs to apply to samples before ingestion.
        • spec.endpoints.metricRelabelings.action
          string
          Action to perform based on the regex matching. Uppercase and Lowercase actions require Prometheus >= v2.36.0. DropEqual and KeepEqual actions require Prometheus >= v2.41.0. Default: “Replace”

          Default: replace

          Allowed values: replace, Replace, keep, Keep, drop, Drop, hashmod, HashMod, labelmap, LabelMap, labeldrop, LabelDrop, labelkeep, LabelKeep, lowercase, Lowercase, uppercase, Uppercase, keepequal, KeepEqual, dropequal, DropEqual

        • spec.endpoints.metricRelabelings.modulus
          integer
          Modulus to take of the hash of the source label values. Only applicable when the action is HashMod.
        • spec.endpoints.metricRelabelings.regex
          string
          Regular expression against which the extracted value is matched.
        • spec.endpoints.metricRelabelings.replacement
          string
          Replacement value against which a Replace action is performed if the regular expression matches. Regex capture groups are available.
        • spec.endpoints.metricRelabelings.separator
          string
          Separator is the string between concatenated SourceLabels.
        • spec.endpoints.metricRelabelings.sourceLabels
          array of strings
          The source labels select values from existing labels. Their content is concatenated using the configured Separator and matched against the configured regular expression.
          • spec.endpoints.metricRelabelings.sourceLabels.Element of the array
            string
            LabelName is a valid Prometheus label name which may only contain ASCII letters, numbers, as well as underscores.

            Pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$

        • spec.endpoints.metricRelabelings.targetLabel
          string
          Label to which the resulting string is written in a replacement. It is mandatory for Replace, HashMod, Lowercase, Uppercase, KeepEqual and DropEqual actions. Regex capture groups are available.
      • spec.endpoints.oauth2
        object
        OAuth2 for the URL. Only valid in Prometheus versions 2.27.0 and newer.
        • spec.endpoints.oauth2.clientId
          object

          Required value

          The secret or configmap containing the OAuth2 client id
          • spec.endpoints.oauth2.clientId.configMap
            object
            ConfigMap containing data to use for the targets.
          • spec.endpoints.oauth2.clientId.secret
            object
            Secret containing data to use for the targets.
            • spec.endpoints.oauth2.clientId.secret.key
              string

              Required value

              The key of the secret to select from. Must be a valid secret key.
            • spec.endpoints.oauth2.clientId.secret.name
              string
            • spec.endpoints.oauth2.clientId.secret.optional
              boolean
              Specify whether the Secret or its key must be defined
        • spec.endpoints.oauth2.clientSecret
          object

          Required value

          The secret containing the OAuth2 client secret
          • spec.endpoints.oauth2.clientSecret.key
            string

            Required value

            The key of the secret to select from. Must be a valid secret key.
          • spec.endpoints.oauth2.clientSecret.name
            string
          • spec.endpoints.oauth2.clientSecret.optional
            boolean
            Specify whether the Secret or its key must be defined
        • spec.endpoints.oauth2.endpointParams
          object
          Parameters to append to the token URL
        • spec.endpoints.oauth2.scopes
          array of strings
          OAuth2 scopes used for the token request
        • spec.endpoints.oauth2.tokenUrl
          string

          Required value

          The URL to fetch the token from

          Minimal length: 1

      • spec.endpoints.params
        object
        Optional HTTP URL parameters
      • spec.endpoints.path
        string
        HTTP path to scrape for metrics. If empty, Prometheus uses the default value (e.g. /metrics).
      • spec.endpoints.port
        string
        Name of the service port this endpoint refers to. Mutually exclusive with targetPort.
      • spec.endpoints.proxyUrl
        string
        ProxyURL eg http://proxyserver:2195 Directs scrapes to proxy through this endpoint.
      • spec.endpoints.relabelings
        array of objects
        RelabelConfigs to apply to samples before scraping. Prometheus Operator automatically adds relabelings for a few standard Kubernetes fields. The original scrape job’s name is available via the __tmp_prometheus_job_name label. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
        • spec.endpoints.relabelings.action
          string
          Action to perform based on the regex matching. Uppercase and Lowercase actions require Prometheus >= v2.36.0. DropEqual and KeepEqual actions require Prometheus >= v2.41.0. Default: “Replace”

          Default: replace

          Allowed values: replace, Replace, keep, Keep, drop, Drop, hashmod, HashMod, labelmap, LabelMap, labeldrop, LabelDrop, labelkeep, LabelKeep, lowercase, Lowercase, uppercase, Uppercase, keepequal, KeepEqual, dropequal, DropEqual

        • spec.endpoints.relabelings.modulus
          integer
          Modulus to take of the hash of the source label values. Only applicable when the action is HashMod.
        • spec.endpoints.relabelings.regex
          string
          Regular expression against which the extracted value is matched.
        • spec.endpoints.relabelings.replacement
          string
          Replacement value against which a Replace action is performed if the regular expression matches. Regex capture groups are available.
        • spec.endpoints.relabelings.separator
          string
          Separator is the string between concatenated SourceLabels.
        • spec.endpoints.relabelings.sourceLabels
          array of strings
          The source labels select values from existing labels. Their content is concatenated using the configured Separator and matched against the configured regular expression.
          • spec.endpoints.relabelings.sourceLabels.Element of the array
            string
            LabelName is a valid Prometheus label name which may only contain ASCII letters, numbers, as well as underscores.

            Pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$

        • spec.endpoints.relabelings.targetLabel
          string
          Label to which the resulting string is written in a replacement. It is mandatory for Replace, HashMod, Lowercase, Uppercase, KeepEqual and DropEqual actions. Regex capture groups are available.
      • spec.endpoints.scheme
        string
        HTTP scheme to use for scraping. http and https are the expected values unless you rewrite the __scheme__ label via relabeling. If empty, Prometheus uses the default value http.

        Allowed values: http, https

      • spec.endpoints.scrapeTimeout
        string
        Timeout after which the scrape is ended If not specified, the Prometheus global scrape timeout is used unless it is less than Interval in which the latter is used.

        Pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$

      • spec.endpoints.targetPort
        integer or string
        Name or number of the target port of the Pod behind the Service, the port must be specified with container port property. Mutually exclusive with port.
      • spec.endpoints.tlsConfig
        object
        TLS configuration to use when scraping the endpoint
        • spec.endpoints.tlsConfig.ca
          object
          Certificate authority used when verifying server certificates.
          • spec.endpoints.tlsConfig.ca.configMap
            object
            ConfigMap containing data to use for the targets.
          • spec.endpoints.tlsConfig.ca.secret
            object
            Secret containing data to use for the targets.
            • spec.endpoints.tlsConfig.ca.secret.key
              string

              Required value

              The key of the secret to select from. Must be a valid secret key.
            • spec.endpoints.tlsConfig.ca.secret.name
              string
            • spec.endpoints.tlsConfig.ca.secret.optional
              boolean
              Specify whether the Secret or its key must be defined
        • spec.endpoints.tlsConfig.caFile
          string
          Path to the CA cert in the Prometheus container to use for the targets.
        • spec.endpoints.tlsConfig.cert
          object
          Client certificate to present when doing client-authentication.
          • spec.endpoints.tlsConfig.cert.configMap
            object
            ConfigMap containing data to use for the targets.
          • spec.endpoints.tlsConfig.cert.secret
            object
            Secret containing data to use for the targets.
            • spec.endpoints.tlsConfig.cert.secret.key
              string

              Required value

              The key of the secret to select from. Must be a valid secret key.
            • spec.endpoints.tlsConfig.cert.secret.name
              string
            • spec.endpoints.tlsConfig.cert.secret.optional
              boolean
              Specify whether the Secret or its key must be defined
        • spec.endpoints.tlsConfig.certFile
          string
          Path to the client cert file in the Prometheus container for the targets.
        • spec.endpoints.tlsConfig.insecureSkipVerify
          boolean
          Disable target certificate validation.
        • spec.endpoints.tlsConfig.keyFile
          string
          Path to the client key file in the Prometheus container for the targets.
        • spec.endpoints.tlsConfig.keySecret
          object
          Secret containing the client key file for the targets.
          • spec.endpoints.tlsConfig.keySecret.key
            string

            Required value

            The key of the secret to select from. Must be a valid secret key.
          • spec.endpoints.tlsConfig.keySecret.name
            string
          • spec.endpoints.tlsConfig.keySecret.optional
            boolean
            Specify whether the Secret or its key must be defined
        • spec.endpoints.tlsConfig.serverName
          string
          Used to verify the hostname for the targets.
    • spec.jobLabel
      string
      JobLabel selects the label from the associated Kubernetes service which will be used as the job label for all metrics. For example: If in ServiceMonitor.spec.jobLabel: foo and in Service.metadata.labels.foo: bar, then the job="bar" label is added to all metrics. If the value of this field is empty or if the label doesn’t exist for the given Service, the job label of the metrics defaults to the name of the Kubernetes Service.
    • spec.keepDroppedTargets
      integer
      Per-scrape limit on the number of targets dropped by relabeling that will be kept in memory. 0 means no limit. It requires Prometheus >= v2.47.0.
    • spec.labelLimit
      integer
      Per-scrape limit on number of labels that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer.
    • spec.labelNameLengthLimit
      integer
      Per-scrape limit on length of labels name that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer.
    • spec.labelValueLengthLimit
      integer
      Per-scrape limit on length of labels value that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer.
    • spec.namespaceSelector
      object
      Selector to select which namespaces the Kubernetes Endpoints objects are discovered from.
      • spec.namespaceSelector.any
        boolean
        Boolean describing whether all namespaces are selected in contrast to a list restricting them.
      • spec.namespaceSelector.matchNames
        array of strings
        List of namespace names to select from.
    • spec.podTargetLabels
      array of strings
      PodTargetLabels transfers labels on the Kubernetes Pod onto the created metrics.
    • spec.sampleLimit
      integer
      SampleLimit defines per-scrape limit on number of scraped samples that will be accepted.
    • spec.selector
      object

      Required value

      Selector to select Endpoints objects.
      • spec.selector.matchExpressions
        array of objects
        matchExpressions is a list of label selector requirements. The requirements are ANDed.
        • spec.selector.matchExpressions.key
          string
          key is the label key that the selector applies to.
        • spec.selector.matchExpressions.operator
          string
          operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
        • spec.selector.matchExpressions.values
          array of strings
          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.
      • spec.selector.matchLabels
        object
        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.
    • spec.targetLabels
      array of strings
      TargetLabels transfers labels from the Kubernetes Service onto the created metrics.
    • spec.targetLimit
      integer
      TargetLimit defines a limit on the number of scraped targets that will be accepted.