monitoring.coreos.com / v1 / PodMonitor
- string
.apiVersion
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
- string
.kind
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
- object
.metadata
- object required
.spec
Specification of desired Pod selection for target discovery by Prometheus.
- object
.spec .attachMetadata
attachMetadata
defines additional metadata which is added to the discovered targets.It requires Prometheus >= v2.35.0.
- boolean
.spec .attachMetadata .node
When set to true, Prometheus attaches node metadata to the discovered targets.
The Prometheus service account must have the
list
andwatch
permissions on theNodes
objects. - string
.spec .bodySizeLimit
When defined, bodySizeLimit specifies a job level limit on the size of uncompressed response body that will be accepted by Prometheus.
It requires Prometheus >= v2.28.0.
- boolean
.spec .convertClassicHistogramsToNHCB
Whether to convert all scraped classic histograms into a native histogram with custom buckets. It requires Prometheus >= v3.0.0.
- string
.spec .fallbackScrapeProtocol
The protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type.
It requires Prometheus >= v3.0.0.
- string
.spec .jobLabel
The label to use to retrieve the job name from.
jobLabel
selects the label from the associated KubernetesPod
object which will be used as thejob
label for all metrics.For example if
jobLabel
is set tofoo
and the KubernetesPod
object is labeled withfoo: bar
, then Prometheus adds thejob="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>
). - integer
.spec .keepDroppedTargets
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.
- integer
.spec .labelLimit
Per-scrape limit on number of labels that will be accepted for a sample.
It requires Prometheus >= v2.27.0.
- integer
.spec .labelNameLengthLimit
Per-scrape limit on length of labels name that will be accepted for a sample.
It requires Prometheus >= v2.27.0.
- integer
.spec .labelValueLengthLimit
Per-scrape limit on length of labels value that will be accepted for a sample.
It requires Prometheus >= v2.27.0.
- object
.spec .namespaceSelector
namespaceSelector
defines in which namespace(s) Prometheus should discover the pods. By default, the pods are discovered in the same namespace as thePodMonitor
object but it is possible to select pods across different/all namespaces. - boolean
.spec .namespaceSelector .any
Boolean describing whether all namespaces are selected in contrast to a list restricting them.
- array
.spec .namespaceSelector .matchNames
List of namespace names to select from.
- integer
.spec .nativeHistogramBucketLimit
If 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.
- integer | string
.spec .nativeHistogramMinBucketFactor
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.
- array
.spec .podMetricsEndpoints
Defines how to scrape metrics from the selected pods.
- object
.spec .podMetricsEndpoints[] .basicAuth
basicAuth
configures the Basic Authentication credentials to use when scraping the target.Cannot be set at the same time as
authorization
, oroauth2
. - object
.spec .podMetricsEndpoints[] .basicAuth .password
password
specifies a key of a Secret containing the password for authentication. - string required
.spec .podMetricsEndpoints[] .basicAuth .password .key
The key of the secret to select from. Must be a valid secret key.
- string
.spec .podMetricsEndpoints[] .basicAuth .password .name
Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- boolean
.spec .podMetricsEndpoints[] .basicAuth .password .optional
Specify whether the Secret or its key must be defined
- object
.spec .podMetricsEndpoints[] .basicAuth .username
username
specifies a key of a Secret containing the username for authentication. - string required
.spec .podMetricsEndpoints[] .basicAuth .username .key
The key of the secret to select from. Must be a valid secret key.
- string
.spec .podMetricsEndpoints[] .basicAuth .username .name
Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- boolean
.spec .podMetricsEndpoints[] .basicAuth .username .optional
Specify whether the Secret or its key must be defined
- object
.spec .podMetricsEndpoints[] .bearerTokenSecret
bearerTokenSecret
specifies a key of a Secret containing the bearer token for scraping targets. The secret needs to be in the same namespace as the PodMonitor object and readable by the Prometheus Operator.Deprecated: use
authorization
instead. - string required
.spec .podMetricsEndpoints[] .bearerTokenSecret .key
The key of the secret to select from. Must be a valid secret key.
- string
.spec .podMetricsEndpoints[] .bearerTokenSecret .name
Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- boolean
.spec .podMetricsEndpoints[] .bearerTokenSecret .optional
Specify whether the Secret or its key must be defined
- boolean
.spec .podMetricsEndpoints[] .enableHttp2
enableHttp2
can be used to disable HTTP2 when scraping the target. - boolean
.spec .podMetricsEndpoints[] .filterRunning
When true, the pods which are not running (e.g. either in Failed or Succeeded state) are dropped during the target discovery.
If unset, the filtering is enabled.
More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase
- boolean
.spec .podMetricsEndpoints[] .followRedirects
followRedirects
defines whether the scrape requests should follow HTTP 3xx redirects. - boolean
.spec .podMetricsEndpoints[] .honorLabels
When true,
honorLabels
preserves the metric’s labels when they collide with the target’s labels. - boolean
.spec .podMetricsEndpoints[] .honorTimestamps
honorTimestamps
controls whether Prometheus preserves the timestamps when exposed by the target. - string
.spec .podMetricsEndpoints[] .interval
Interval at which Prometheus scrapes the metrics from the target.
If empty, Prometheus uses the global scrape interval.
- array
.spec .podMetricsEndpoints[] .metricRelabelings
metricRelabelings
configures the relabeling rules to apply to the samples before ingestion. - string
.spec .podMetricsEndpoints[] .metricRelabelings[] .action
Action to perform based on the regex matching.
Uppercase
andLowercase
actions require Prometheus >= v2.36.0.DropEqual
andKeepEqual
actions require Prometheus >= v2.41.0.Default: “Replace”
- integer
.spec .podMetricsEndpoints[] .metricRelabelings[] .modulus
Modulus to take of the hash of the source label values.
Only applicable when the action is
HashMod
. - string
.spec .podMetricsEndpoints[] .metricRelabelings[] .regex
Regular expression against which the extracted value is matched.
- string
.spec .podMetricsEndpoints[] .metricRelabelings[] .replacement
Replacement value against which a Replace action is performed if the regular expression matches.
Regex capture groups are available.
- string
.spec .podMetricsEndpoints[] .metricRelabelings[] .separator
Separator is the string between concatenated SourceLabels.
- array
.spec .podMetricsEndpoints[] .metricRelabelings[] .sourceLabels
The source labels select values from existing labels. Their content is concatenated using the configured Separator and matched against the configured regular expression.
- string
.spec .podMetricsEndpoints[] .metricRelabelings[] .targetLabel
Label to which the resulting string is written in a replacement.
It is mandatory for
Replace
,HashMod
,Lowercase
,Uppercase
,KeepEqual
andDropEqual
actions.Regex capture groups are available.
- object
.spec .podMetricsEndpoints[] .oauth2
oauth2
configures the OAuth2 settings to use when scraping the target.It requires Prometheus >= 2.27.0.
Cannot be set at the same time as
authorization
, orbasicAuth
. - object required
.spec .podMetricsEndpoints[] .oauth2 .clientId
clientId
specifies a key of a Secret or ConfigMap containing the OAuth2 client’s ID. - object
.spec .podMetricsEndpoints[] .oauth2 .clientId .configMap
ConfigMap containing data to use for the targets.
- string required
.spec .podMetricsEndpoints[] .oauth2 .clientId .configMap .key
The key to select.
- string
.spec .podMetricsEndpoints[] .oauth2 .clientId .configMap .name
Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- boolean
.spec .podMetricsEndpoints[] .oauth2 .clientId .configMap .optional
Specify whether the ConfigMap or its key must be defined
- object
.spec .podMetricsEndpoints[] .oauth2 .clientId .secret
Secret containing data to use for the targets.
- string required
.spec .podMetricsEndpoints[] .oauth2 .clientId .secret .key
The key of the secret to select from. Must be a valid secret key.
- string
.spec .podMetricsEndpoints[] .oauth2 .clientId .secret .name
Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- boolean
.spec .podMetricsEndpoints[] .oauth2 .clientId .secret .optional
Specify whether the Secret or its key must be defined
- object required
.spec .podMetricsEndpoints[] .oauth2 .clientSecret
clientSecret
specifies a key of a Secret containing the OAuth2 client’s secret. - string required
.spec .podMetricsEndpoints[] .oauth2 .clientSecret .key
The key of the secret to select from. Must be a valid secret key.
- string
.spec .podMetricsEndpoints[] .oauth2 .clientSecret .name
Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- boolean
.spec .podMetricsEndpoints[] .oauth2 .clientSecret .optional
Specify whether the Secret or its key must be defined
- object
.spec .podMetricsEndpoints[] .oauth2 .endpointParams
endpointParams
configures the HTTP parameters to append to the token URL. - string
.spec .podMetricsEndpoints[] .oauth2 .noProxy
noProxy
is a 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.It requires Prometheus >= v2.43.0, Alertmanager >= v0.25.0 or Thanos >= v0.32.0.
- object
.spec .podMetricsEndpoints[] .oauth2 .proxyConnectHeader
ProxyConnectHeader optionally specifies headers to send to proxies during CONNECT requests.
It requires Prometheus >= v2.43.0, Alertmanager >= v0.25.0 or Thanos >= v0.32.0.
- boolean
.spec .podMetricsEndpoints[] .oauth2 .proxyFromEnvironment
Whether to use the proxy configuration defined by environment variables (HTTP_PROXY, HTTPS_PROXY, and NO_PROXY).
It requires Prometheus >= v2.43.0, Alertmanager >= v0.25.0 or Thanos >= v0.32.0.
- string
.spec .podMetricsEndpoints[] .oauth2 .proxyUrl
proxyURL
defines the HTTP proxy server to use. - array
.spec .podMetricsEndpoints[] .oauth2 .scopes
scopes
defines the OAuth2 scopes used for the token request. - object
.spec .podMetricsEndpoints[] .oauth2 .tlsConfig
TLS configuration to use when connecting to the OAuth2 server. It requires Prometheus >= v2.43.0.
- object
.spec .podMetricsEndpoints[] .oauth2 .tlsConfig .ca
Certificate authority used when verifying server certificates.
- object
.spec .podMetricsEndpoints[] .oauth2 .tlsConfig .ca .configMap
ConfigMap containing data to use for the targets.
- string required
.spec .podMetricsEndpoints[] .oauth2 .tlsConfig .ca .configMap .key
The key to select.
- string
.spec .podMetricsEndpoints[] .oauth2 .tlsConfig .ca .configMap .name
Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- boolean
.spec .podMetricsEndpoints[] .oauth2 .tlsConfig .ca .configMap .optional
Specify whether the ConfigMap or its key must be defined
- object
.spec .podMetricsEndpoints[] .oauth2 .tlsConfig .ca .secret
Secret containing data to use for the targets.
- string required
.spec .podMetricsEndpoints[] .oauth2 .tlsConfig .ca .secret .key
The key of the secret to select from. Must be a valid secret key.
- string
.spec .podMetricsEndpoints[] .oauth2 .tlsConfig .ca .secret .name
Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- boolean
.spec .podMetricsEndpoints[] .oauth2 .tlsConfig .ca .secret .optional
Specify whether the Secret or its key must be defined
- object
.spec .podMetricsEndpoints[] .oauth2 .tlsConfig .cert
Client certificate to present when doing client-authentication.
- object
.spec .podMetricsEndpoints[] .oauth2 .tlsConfig .cert .configMap
ConfigMap containing data to use for the targets.
- string required
.spec .podMetricsEndpoints[] .oauth2 .tlsConfig .cert .configMap .key
The key to select.
- string
.spec .podMetricsEndpoints[] .oauth2 .tlsConfig .cert .configMap .name
Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- boolean
.spec .podMetricsEndpoints[] .oauth2 .tlsConfig .cert .configMap .optional
Specify whether the ConfigMap or its key must be defined
- object
.spec .podMetricsEndpoints[] .oauth2 .tlsConfig .cert .secret
Secret containing data to use for the targets.
- string required
.spec .podMetricsEndpoints[] .oauth2 .tlsConfig .cert .secret .key
The key of the secret to select from. Must be a valid secret key.
- string
.spec .podMetricsEndpoints[] .oauth2 .tlsConfig .cert .secret .name
Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- boolean
.spec .podMetricsEndpoints[] .oauth2 .tlsConfig .cert .secret .optional
Specify whether the Secret or its key must be defined
- boolean
.spec .podMetricsEndpoints[] .oauth2 .tlsConfig .insecureSkipVerify
Disable target certificate validation.
- object
.spec .podMetricsEndpoints[] .oauth2 .tlsConfig .keySecret
Secret containing the client key file for the targets.
- string required
.spec .podMetricsEndpoints[] .oauth2 .tlsConfig .keySecret .key
The key of the secret to select from. Must be a valid secret key.
- string
.spec .podMetricsEndpoints[] .oauth2 .tlsConfig .keySecret .name
Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- boolean
.spec .podMetricsEndpoints[] .oauth2 .tlsConfig .keySecret .optional
Specify whether the Secret or its key must be defined
- string
.spec .podMetricsEndpoints[] .oauth2 .tlsConfig .maxVersion
Maximum acceptable TLS version.
It requires Prometheus >= v2.41.0 or Thanos >= v0.31.0.
- string
.spec .podMetricsEndpoints[] .oauth2 .tlsConfig .minVersion
Minimum acceptable TLS version.
It requires Prometheus >= v2.35.0 or Thanos >= v0.28.0.
- string
.spec .podMetricsEndpoints[] .oauth2 .tlsConfig .serverName
Used to verify the hostname for the targets.
- string required
.spec .podMetricsEndpoints[] .oauth2 .tokenUrl
tokenURL
configures the URL to fetch the token from. - object
.spec .podMetricsEndpoints[] .params
params
define optional HTTP URL parameters. - string
.spec .podMetricsEndpoints[] .path
HTTP path from which to scrape for metrics.
If empty, Prometheus uses the default value (e.g.
/metrics
). - string
.spec .podMetricsEndpoints[] .port
The
Pod
port name which exposes the endpoint.It takes precedence over the
portNumber
andtargetPort
fields. - integer
.spec .podMetricsEndpoints[] .portNumber
The
Pod
port number which exposes the endpoint. - string
.spec .podMetricsEndpoints[] .proxyUrl
proxyURL
configures the HTTP Proxy URL (e.g. “http://proxyserver:2195”) to go through when scraping the target. - array
.spec .podMetricsEndpoints[] .relabelings
relabelings
configures the relabeling rules to apply the target’s metadata labels.The 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
- string
.spec .podMetricsEndpoints[] .relabelings[] .action
Action to perform based on the regex matching.
Uppercase
andLowercase
actions require Prometheus >= v2.36.0.DropEqual
andKeepEqual
actions require Prometheus >= v2.41.0.Default: “Replace”
- integer
.spec .podMetricsEndpoints[] .relabelings[] .modulus
Modulus to take of the hash of the source label values.
Only applicable when the action is
HashMod
. - string
.spec .podMetricsEndpoints[] .relabelings[] .regex
Regular expression against which the extracted value is matched.
- string
.spec .podMetricsEndpoints[] .relabelings[] .replacement
Replacement value against which a Replace action is performed if the regular expression matches.
Regex capture groups are available.
- string
.spec .podMetricsEndpoints[] .relabelings[] .separator
Separator is the string between concatenated SourceLabels.
- array
.spec .podMetricsEndpoints[] .relabelings[] .sourceLabels
The source labels select values from existing labels. Their content is concatenated using the configured Separator and matched against the configured regular expression.
- string
.spec .podMetricsEndpoints[] .relabelings[] .targetLabel
Label to which the resulting string is written in a replacement.
It is mandatory for
Replace
,HashMod
,Lowercase
,Uppercase
,KeepEqual
andDropEqual
actions.Regex capture groups are available.
- string
.spec .podMetricsEndpoints[] .scheme
HTTP scheme to use for scraping.
http
andhttps
are the expected values unless you rewrite the__scheme__
label via relabeling.If empty, Prometheus uses the default value
http
. - string
.spec .podMetricsEndpoints[] .scrapeTimeout
Timeout after which Prometheus considers the scrape to be failed.
If empty, Prometheus uses the global scrape timeout unless it is less than the target’s scrape interval value in which the latter is used. The value cannot be greater than the scrape interval otherwise the operator will reject the resource.
- integer | string
.spec .podMetricsEndpoints[] .targetPort
Name or number of the target port of the
Pod
object behind the Service, the port must be specified with container port property.Deprecated: use ‘port’ or ‘portNumber’ instead.
- object
.spec .podMetricsEndpoints[] .tlsConfig
TLS configuration to use when scraping the target.
- object
.spec .podMetricsEndpoints[] .tlsConfig .ca
Certificate authority used when verifying server certificates.
- object
.spec .podMetricsEndpoints[] .tlsConfig .ca .configMap
ConfigMap containing data to use for the targets.
- string required
.spec .podMetricsEndpoints[] .tlsConfig .ca .configMap .key
The key to select.
- string
.spec .podMetricsEndpoints[] .tlsConfig .ca .configMap .name
Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- boolean
.spec .podMetricsEndpoints[] .tlsConfig .ca .configMap .optional
Specify whether the ConfigMap or its key must be defined
- object
.spec .podMetricsEndpoints[] .tlsConfig .ca .secret
Secret containing data to use for the targets.
- string required
.spec .podMetricsEndpoints[] .tlsConfig .ca .secret .key
The key of the secret to select from. Must be a valid secret key.
- string
.spec .podMetricsEndpoints[] .tlsConfig .ca .secret .name
Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- boolean
.spec .podMetricsEndpoints[] .tlsConfig .ca .secret .optional
Specify whether the Secret or its key must be defined
- object
.spec .podMetricsEndpoints[] .tlsConfig .cert
Client certificate to present when doing client-authentication.
- object
.spec .podMetricsEndpoints[] .tlsConfig .cert .configMap
ConfigMap containing data to use for the targets.
- string required
.spec .podMetricsEndpoints[] .tlsConfig .cert .configMap .key
The key to select.
- string
.spec .podMetricsEndpoints[] .tlsConfig .cert .configMap .name
Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- boolean
.spec .podMetricsEndpoints[] .tlsConfig .cert .configMap .optional
Specify whether the ConfigMap or its key must be defined
- object
.spec .podMetricsEndpoints[] .tlsConfig .cert .secret
Secret containing data to use for the targets.
- string required
.spec .podMetricsEndpoints[] .tlsConfig .cert .secret .key
The key of the secret to select from. Must be a valid secret key.
- string
.spec .podMetricsEndpoints[] .tlsConfig .cert .secret .name
Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- boolean
.spec .podMetricsEndpoints[] .tlsConfig .cert .secret .optional
Specify whether the Secret or its key must be defined
- boolean
.spec .podMetricsEndpoints[] .tlsConfig .insecureSkipVerify
Disable target certificate validation.
- object
.spec .podMetricsEndpoints[] .tlsConfig .keySecret
Secret containing the client key file for the targets.
- string required
.spec .podMetricsEndpoints[] .tlsConfig .keySecret .key
The key of the secret to select from. Must be a valid secret key.
- string
.spec .podMetricsEndpoints[] .tlsConfig .keySecret .name
Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
- boolean
.spec .podMetricsEndpoints[] .tlsConfig .keySecret .optional
Specify whether the Secret or its key must be defined
- string
.spec .podMetricsEndpoints[] .tlsConfig .maxVersion
Maximum acceptable TLS version.
It requires Prometheus >= v2.41.0 or Thanos >= v0.31.0.
- string
.spec .podMetricsEndpoints[] .tlsConfig .minVersion
Minimum acceptable TLS version.
It requires Prometheus >= v2.35.0 or Thanos >= v0.28.0.
- string
.spec .podMetricsEndpoints[] .tlsConfig .serverName
Used to verify the hostname for the targets.
- boolean
.spec .podMetricsEndpoints[] .trackTimestampsStaleness
trackTimestampsStaleness
defines whether Prometheus tracks staleness of the metrics that have an explicit timestamp present in scraped data. Has no effect ifhonorTimestamps
is false.It requires Prometheus >= v2.48.0.
- array
.spec .podTargetLabels
podTargetLabels
defines the labels which are transferred from the associated KubernetesPod
object onto the ingested metrics. - integer
.spec .sampleLimit
sampleLimit
defines a per-scrape limit on the number of scraped samples that will be accepted. - string
.spec .scrapeClass
The scrape class to apply.
- boolean
.spec .scrapeClassicHistograms
Whether to scrape a classic histogram that is also exposed as a native histogram. It requires Prometheus >= v2.45.0.
- array
.spec .scrapeProtocols
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.
- object required
.spec .selector
Label selector to select the Kubernetes
Pod
objects to scrape metrics from. - array
.spec .selector .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.spec .selector .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.spec .selector .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.spec .selector .matchExpressions[] .values
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.
- object
.spec .selector .matchLabels
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.
- string
.spec .selectorMechanism
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.
- integer
.spec .targetLimit
targetLimit
defines a limit on the number of scraped targets that will be accepted.