attachMetadata
|
object
|
attachMetadata defines additional metadata which is added to the
discovered targets.
It requires Prometheus >= v2.37.0. |
bodySizeLimit
|
string
|
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. |
convertClassicHistogramsToNHCB
|
boolean
|
convertClassicHistogramsToNHCB defines whether to convert all scraped classic histograms into a native histogram with custom buckets.
It requires Prometheus >= v3.0.0. |
endpoints
|
array
|
endpoints defines the list of endpoints part of this ServiceMonitor.
Defines how to scrape metrics from Kubernetes [Endpoints](https://kubernetes.io/docs/concepts/services-networking/service/#endpoints) objects.
In most cases, an Endpoints object is backed by a Kubernetes [Service](https://kubernetes.io/docs/concepts/services-networking/service/) object with the same name and labels. |
endpoints[]
|
object
|
Endpoint defines an endpoint serving Prometheus metrics to be scraped by
Prometheus. |
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. |
jobLabel
|
string
|
jobLabel selects the label from the associated Kubernetes Service
object which will be used as the job label for all metrics.
For example if jobLabel is set to foo and the Kubernetes Service
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 or if the label doesn’t exist for
the given Service, the job label of the metrics defaults to the name
of the associated Kubernetes Service. |
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. |
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. |
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. |
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. |
namespaceSelector
|
object
|
namespaceSelector defines in which namespace(s) Prometheus should discover the services.
By default, the services are discovered in the same namespace as the ServiceMonitor 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. |
nativeHistogramMinBucketFactor
|
integer-or-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. |
podTargetLabels
|
array (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. |
scrapeClass
|
string
|
scrapeClass defines the scrape class to apply. |
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. |
scrapeProtocols
|
array (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. |
selector
|
object
|
selector defines the label selector to select the Kubernetes Endpoints objects to scrape metrics from. |
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. |
serviceDiscoveryRole
|
string
|
serviceDiscoveryRole defines the service discovery role used to discover targets.
If set, the value should be either "Endpoints" or "EndpointSlice".
Otherwise it defaults to the value defined in the
Prometheus/PrometheusAgent resource. |
targetLabels
|
array (string)
|
targetLabels defines the labels which are transferred from the
associated Kubernetes Service object onto the ingested metrics. |
targetLimit
|
integer
|
targetLimit defines a limit on the number of scraped targets that will
be accepted. |