prometheus operator v0.93.1

PodMonitor.spec.podMetricsEndpoints[].metricRelabelings.sourceLabels.spec

spec defines the specification of desired Pod selection for target discovery by Prometheus.

22 fields
PodMonitor.spec.podMetricsEndpoints[].metricRelabelings.sourceLabels.spec fields and descriptions
Field / TypeDescription
object

attachMetadata defines additional metadata which is added to the discovered targets. It requires Prometheus >= v2.35.0.

bodySizeLimit
string

bodySizeLimit when defined specifies a job level limit on the size of uncompressed response body that will be accepted by Prometheus. It requires Prometheus >= v2.28.0.

  • pattern: (^0|([0-9]*[.])?[0-9]+((K|M|G|T|E|P)i?)?B)$
convertClassicHistogramsToNHCB
boolean

convertClassicHistogramsToNHCB defines whether to convert all scraped classic histograms into a native histogram with custom buckets. It requires Prometheus >= v3.0.0.

fallbackScrapeProtocol
string

fallbackScrapeProtocol defines the protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type. It requires Prometheus >= v3.0.0.

  • enum: ["PrometheusProto","OpenMetricsText0.0.1","OpenMetricsText1.0.0","PrometheusText0.0.4","PrometheusText1.0.0"]
jobLabel
string

jobLabel defines the label to use to retrieve the job name from. `jobLabel` selects the label from the associated Kubernetes `Pod` object which will be used as the `job` label for all metrics. For example if `jobLabel` is set to `foo` and the Kubernetes `Pod` object is labeled with `foo: bar`, then Prometheus adds the `job="bar"` label to all ingested metrics. If the value of this field is empty, the `job` label of the metrics defaults to the namespace and name of the PodMonitor object (e.g. `<namespace>/<name>`).

keepDroppedTargets
integer

keepDroppedTargets defines the 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.

  • format: int64
  • minimum: 0
labelLimit
integer

labelLimit defines the per-scrape limit on number of labels that will be accepted for a sample. It requires Prometheus >= v2.27.0.

  • format: int64
  • minimum: 0
labelNameLengthLimit
integer

labelNameLengthLimit defines the per-scrape limit on length of labels name that will be accepted for a sample. It requires Prometheus >= v2.27.0.

  • format: int64
  • minimum: 0
labelValueLengthLimit
integer

labelValueLengthLimit defines the per-scrape limit on length of labels value that will be accepted for a sample. It requires Prometheus >= v2.27.0.

  • format: int64
  • minimum: 0
object

namespaceSelector defines in which namespace(s) Prometheus should discover the pods. By default, the pods are discovered in the same namespace as the `PodMonitor` object but it is possible to select pods across different/all namespaces.

nativeHistogramBucketLimit
integer

nativeHistogramBucketLimit defines ff there are more than this many buckets in a native histogram, buckets will be merged to stay within the limit. It requires Prometheus >= v2.45.0.

  • format: int64
  • minimum: 0
integer | string

nativeHistogramMinBucketFactor defines if the growth factor of one bucket to the next is smaller than this, buckets will be merged to increase the factor sufficiently. It requires Prometheus >= v2.50.0.

  • pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
  • x-kubernetes-int-or-string: true
object[]

podMetricsEndpoints defines how to scrape metrics from the selected pods.

string[]

podTargetLabels defines the labels which are transferred from the associated Kubernetes `Pod` object onto the ingested metrics.

sampleLimit
integer

sampleLimit defines a per-scrape limit on the number of scraped samples that will be accepted.

  • format: int64
  • minimum: 0
scrapeClass
string

scrapeClass defines the scrape class to apply.

  • minLength: 1
scrapeClassicHistograms
boolean

scrapeClassicHistograms defines whether to scrape a classic histogram that is also exposed as a native histogram. It requires Prometheus >= v2.45.0. Notice: `scrapeClassicHistograms` corresponds to the `always_scrape_classic_histograms` field in the Prometheus configuration.

scrapeNativeHistograms
boolean

scrapeNativeHistograms defines whether to enable scraping of native histograms. It requires Prometheus >= v3.8.0.

string[]

scrapeProtocols defines the protocols to negotiate during a scrape. It tells clients the protocols supported by Prometheus in order of preference (from most to least preferred). If unset, Prometheus uses its default value. It requires Prometheus >= v2.49.0.

  • x-kubernetes-list-type: "set"
object required

selector defines the label selector to select the Kubernetes `Pod` objects to scrape metrics from.

  • x-kubernetes-map-type: "atomic"
selectorMechanism
string

selectorMechanism defines the mechanism used to select the endpoints to scrape. By default, the selection process relies on relabel configurations to filter the discovered targets. Alternatively, you can opt in for role selectors, which may offer better efficiency in large clusters. Which strategy is best for your use case needs to be carefully evaluated. It requires Prometheus >= v2.17.0.

  • enum: ["RelabelConfig","RoleSelector"]
targetLimit
integer

targetLimit defines a limit on the number of scraped targets that will be accepted.

  • format: int64
  • minimum: 0