NAME
IO::K8s::PrometheusOperator::V1::ServiceMonitorSpec - spec defines the specification of desired Service selection for target discovery by Prometheus.
VERSION
version 1.108
attachMetadata
attachMetadata defines additional metadata which is added to the discovered targets.
It requires Prometheus >= v2.37.0.
bodySizeLimit
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
convertClassicHistogramsToNHCB defines whether to convert all scraped classic histograms into a native histogram with custom buckets. It requires Prometheus >= v3.0.0.
endpoints
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.
fallbackScrapeProtocol
fallbackScrapeProtocol defines the protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type.
It requires Prometheus >= v3.0.0.
jobLabel
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
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
labelLimit defines the per-scrape limit on number of labels that will be accepted for a sample.
It requires Prometheus >= v2.27.0.
labelNameLengthLimit
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
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
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
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
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
podTargetLabels defines the labels which are transferred from the associated Kubernetes `Pod` object onto the ingested metrics.
sampleLimit
sampleLimit defines a per-scrape limit on the number of scraped samples that will be accepted.
scrapeClass
scrapeClass defines the scrape class to apply.
scrapeClassicHistograms
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
scrapeNativeHistograms defines whether to enable scraping of native histograms. It requires Prometheus >= v3.8.0.
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.
selector
selector defines the label selector to select the Kubernetes `Endpoints` objects to scrape metrics from.
selectorMechanism
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
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
targetLabels defines the labels which are transferred from the associated Kubernetes `Service` object onto the ingested metrics.
targetLimit
targetLimit defines a limit on the number of scraped targets that will be accepted.
SUPPORT
Issues
Please report bugs and feature requests on GitHub at https://github.com/pplu/io-k8s-p5/issues.
CONTRIBUTING
Contributions are welcome! Please fork the repository and submit a pull request.
AUTHORS
Torsten Raudssus <getty@cpan.org>
Jose Luis Martinez Torres <jlmartin@cpan.org>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2018-2026 by Jose Luis Martinez Torres <jlmartin@cpan.org>.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004