Class ServiceMonitorSpec
- java.lang.Object
-
- io.fabric8.openshift.api.model.monitoring.v1.ServiceMonitorSpec
-
- All Implemented Interfaces:
Editable<ServiceMonitorSpecBuilder>,KubernetesResource,Serializable
@Generated("io.fabric8.kubernetes.schema.generator.model.ModelGenerator") public class ServiceMonitorSpec extends Object implements Editable<ServiceMonitorSpecBuilder>, KubernetesResource
ServiceMonitorSpec defines the specification parameters for a ServiceMonitor.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ServiceMonitorSpec()No args constructor for use in serializationServiceMonitorSpec(AttachMetadata attachMetadata, String bodySizeLimit, Boolean convertClassicHistogramsToNHCB, List<Endpoint> endpoints, String fallbackScrapeProtocol, String jobLabel, Long keepDroppedTargets, Long labelLimit, Long labelNameLengthLimit, Long labelValueLengthLimit, NamespaceSelector namespaceSelector, Long nativeHistogramBucketLimit, Quantity nativeHistogramMinBucketFactor, List<String> podTargetLabels, Long sampleLimit, String scrapeClass, Boolean scrapeClassicHistograms, Boolean scrapeNativeHistograms, List<String> scrapeProtocols, LabelSelector selector, String selectorMechanism, String serviceDiscoveryRole, List<String> targetLabels, Long targetLimit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ServiceMonitorSpecBuilderedit()Map<String,Object>getAdditionalProperties()AttachMetadatagetAttachMetadata()ServiceMonitorSpec defines the specification parameters for a ServiceMonitor.StringgetBodySizeLimit()bodySizeLimit when defined, bodySizeLimit specifies a job level limit on the size of uncompressed response body that will be accepted by Prometheus.BooleangetConvertClassicHistogramsToNHCB()convertClassicHistogramsToNHCB defines whether to convert all scraped classic histograms into a native histogram with custom buckets.List<Endpoint>getEndpoints()endpoints defines the list of endpoints part of this ServiceMonitor.StringgetFallbackScrapeProtocol()fallbackScrapeProtocol defines the protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type.StringgetJobLabel()jobLabel selects the label from the associated Kubernetes `Service` object which will be used as the `job` label for all metrics.LonggetKeepDroppedTargets()keepDroppedTargets defines the per-scrape limit on the number of targets dropped by relabeling that will be kept in memory. 0 means no limit.LonggetLabelLimit()labelLimit defines the per-scrape limit on number of labels that will be accepted for a sample.LonggetLabelNameLengthLimit()labelNameLengthLimit defines the per-scrape limit on length of labels name that will be accepted for a sample.LonggetLabelValueLengthLimit()labelValueLengthLimit defines the per-scrape limit on length of labels value that will be accepted for a sample.NamespaceSelectorgetNamespaceSelector()ServiceMonitorSpec defines the specification parameters for a ServiceMonitor.LonggetNativeHistogramBucketLimit()nativeHistogramBucketLimit defines ff there are more than this many buckets in a native histogram, buckets will be merged to stay within the limit.QuantitygetNativeHistogramMinBucketFactor()ServiceMonitorSpec defines the specification parameters for a ServiceMonitor.List<String>getPodTargetLabels()podTargetLabels defines the labels which are transferred from the associated Kubernetes `Pod` object onto the ingested metrics.LonggetSampleLimit()sampleLimit defines a per-scrape limit on the number of scraped samples that will be accepted.StringgetScrapeClass()scrapeClass defines the scrape class to apply.BooleangetScrapeClassicHistograms()scrapeClassicHistograms defines whether to scrape a classic histogram that is also exposed as a native histogram.BooleangetScrapeNativeHistograms()scrapeNativeHistograms defines whether to enable scraping of native histograms.List<String>getScrapeProtocols()scrapeProtocols defines the protocols to negotiate during a scrape.LabelSelectorgetSelector()ServiceMonitorSpec defines the specification parameters for a ServiceMonitor.StringgetSelectorMechanism()selectorMechanism defines the mechanism used to select the endpoints to scrape.StringgetServiceDiscoveryRole()serviceDiscoveryRole defines the service discovery role used to discover targets.List<String>getTargetLabels()targetLabels defines the labels which are transferred from the associated Kubernetes `Service` object onto the ingested metrics.LonggetTargetLimit()targetLimit defines a limit on the number of scraped targets that will be accepted.voidsetAdditionalProperties(Map<String,Object> additionalProperties)voidsetAdditionalProperty(String name, Object value)voidsetAttachMetadata(AttachMetadata attachMetadata)ServiceMonitorSpec defines the specification parameters for a ServiceMonitor.voidsetBodySizeLimit(String bodySizeLimit)bodySizeLimit when defined, bodySizeLimit specifies a job level limit on the size of uncompressed response body that will be accepted by Prometheus.voidsetConvertClassicHistogramsToNHCB(Boolean convertClassicHistogramsToNHCB)convertClassicHistogramsToNHCB defines whether to convert all scraped classic histograms into a native histogram with custom buckets.voidsetEndpoints(List<Endpoint> endpoints)endpoints defines the list of endpoints part of this ServiceMonitor.voidsetFallbackScrapeProtocol(String fallbackScrapeProtocol)fallbackScrapeProtocol defines the protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type.voidsetJobLabel(String jobLabel)jobLabel selects the label from the associated Kubernetes `Service` object which will be used as the `job` label for all metrics.voidsetKeepDroppedTargets(Long 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.voidsetLabelLimit(Long labelLimit)labelLimit defines the per-scrape limit on number of labels that will be accepted for a sample.voidsetLabelNameLengthLimit(Long labelNameLengthLimit)labelNameLengthLimit defines the per-scrape limit on length of labels name that will be accepted for a sample.voidsetLabelValueLengthLimit(Long labelValueLengthLimit)labelValueLengthLimit defines the per-scrape limit on length of labels value that will be accepted for a sample.voidsetNamespaceSelector(NamespaceSelector namespaceSelector)ServiceMonitorSpec defines the specification parameters for a ServiceMonitor.voidsetNativeHistogramBucketLimit(Long nativeHistogramBucketLimit)nativeHistogramBucketLimit defines ff there are more than this many buckets in a native histogram, buckets will be merged to stay within the limit.voidsetNativeHistogramMinBucketFactor(Quantity nativeHistogramMinBucketFactor)ServiceMonitorSpec defines the specification parameters for a ServiceMonitor.voidsetPodTargetLabels(List<String> podTargetLabels)podTargetLabels defines the labels which are transferred from the associated Kubernetes `Pod` object onto the ingested metrics.voidsetSampleLimit(Long sampleLimit)sampleLimit defines a per-scrape limit on the number of scraped samples that will be accepted.voidsetScrapeClass(String scrapeClass)scrapeClass defines the scrape class to apply.voidsetScrapeClassicHistograms(Boolean scrapeClassicHistograms)scrapeClassicHistograms defines whether to scrape a classic histogram that is also exposed as a native histogram.voidsetScrapeNativeHistograms(Boolean scrapeNativeHistograms)scrapeNativeHistograms defines whether to enable scraping of native histograms.voidsetScrapeProtocols(List<String> scrapeProtocols)scrapeProtocols defines the protocols to negotiate during a scrape.voidsetSelector(LabelSelector selector)ServiceMonitorSpec defines the specification parameters for a ServiceMonitor.voidsetSelectorMechanism(String selectorMechanism)selectorMechanism defines the mechanism used to select the endpoints to scrape.voidsetServiceDiscoveryRole(String serviceDiscoveryRole)serviceDiscoveryRole defines the service discovery role used to discover targets.voidsetTargetLabels(List<String> targetLabels)targetLabels defines the labels which are transferred from the associated Kubernetes `Service` object onto the ingested metrics.voidsetTargetLimit(Long targetLimit)targetLimit defines a limit on the number of scraped targets that will be accepted.ServiceMonitorSpecBuildertoBuilder()
-
-
-
Constructor Detail
-
ServiceMonitorSpec
public ServiceMonitorSpec()
No args constructor for use in serialization
-
ServiceMonitorSpec
public ServiceMonitorSpec(AttachMetadata attachMetadata, String bodySizeLimit, Boolean convertClassicHistogramsToNHCB, List<Endpoint> endpoints, String fallbackScrapeProtocol, String jobLabel, Long keepDroppedTargets, Long labelLimit, Long labelNameLengthLimit, Long labelValueLengthLimit, NamespaceSelector namespaceSelector, Long nativeHistogramBucketLimit, Quantity nativeHistogramMinBucketFactor, List<String> podTargetLabels, Long sampleLimit, String scrapeClass, Boolean scrapeClassicHistograms, Boolean scrapeNativeHistograms, List<String> scrapeProtocols, LabelSelector selector, String selectorMechanism, String serviceDiscoveryRole, List<String> targetLabels, Long targetLimit)
-
-
Method Detail
-
getAttachMetadata
public AttachMetadata getAttachMetadata()
ServiceMonitorSpec defines the specification parameters for a ServiceMonitor.
-
setAttachMetadata
public void setAttachMetadata(AttachMetadata attachMetadata)
ServiceMonitorSpec defines the specification parameters for a ServiceMonitor.
-
getBodySizeLimit
public String getBodySizeLimit()
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.
-
setBodySizeLimit
public void setBodySizeLimit(String 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.
-
getConvertClassicHistogramsToNHCB
public Boolean getConvertClassicHistogramsToNHCB()
convertClassicHistogramsToNHCB defines whether to convert all scraped classic histograms into a native histogram with custom buckets. It requires Prometheus >= v3.0.0.
-
setConvertClassicHistogramsToNHCB
public void setConvertClassicHistogramsToNHCB(Boolean convertClassicHistogramsToNHCB)
convertClassicHistogramsToNHCB defines whether to convert all scraped classic histograms into a native histogram with custom buckets. It requires Prometheus >= v3.0.0.
-
getEndpoints
public List<Endpoint> getEndpoints()
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.
-
setEndpoints
public void setEndpoints(List<Endpoint> 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.
-
getFallbackScrapeProtocol
public String getFallbackScrapeProtocol()
fallbackScrapeProtocol defines the protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type.It requires Prometheus >= v3.0.0.
-
setFallbackScrapeProtocol
public void setFallbackScrapeProtocol(String fallbackScrapeProtocol)
fallbackScrapeProtocol defines the protocol to use if a scrape returns blank, unparseable, or otherwise invalid Content-Type.It requires Prometheus >= v3.0.0.
-
getJobLabel
public String getJobLabel()
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`.
-
setJobLabel
public void setJobLabel(String 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`.
-
getKeepDroppedTargets
public Long getKeepDroppedTargets()
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.
-
setKeepDroppedTargets
public void setKeepDroppedTargets(Long 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.
-
getLabelLimit
public Long getLabelLimit()
labelLimit defines the per-scrape limit on number of labels that will be accepted for a sample.It requires Prometheus >= v2.27.0.
-
setLabelLimit
public void setLabelLimit(Long labelLimit)
labelLimit defines the per-scrape limit on number of labels that will be accepted for a sample.It requires Prometheus >= v2.27.0.
-
getLabelNameLengthLimit
public Long getLabelNameLengthLimit()
labelNameLengthLimit defines the per-scrape limit on length of labels name that will be accepted for a sample.It requires Prometheus >= v2.27.0.
-
setLabelNameLengthLimit
public void setLabelNameLengthLimit(Long 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.
-
getLabelValueLengthLimit
public Long getLabelValueLengthLimit()
labelValueLengthLimit defines the per-scrape limit on length of labels value that will be accepted for a sample.It requires Prometheus >= v2.27.0.
-
setLabelValueLengthLimit
public void setLabelValueLengthLimit(Long 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.
-
getNamespaceSelector
public NamespaceSelector getNamespaceSelector()
ServiceMonitorSpec defines the specification parameters for a ServiceMonitor.
-
setNamespaceSelector
public void setNamespaceSelector(NamespaceSelector namespaceSelector)
ServiceMonitorSpec defines the specification parameters for a ServiceMonitor.
-
getNativeHistogramBucketLimit
public Long getNativeHistogramBucketLimit()
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.
-
setNativeHistogramBucketLimit
public void setNativeHistogramBucketLimit(Long 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.
-
getNativeHistogramMinBucketFactor
public Quantity getNativeHistogramMinBucketFactor()
ServiceMonitorSpec defines the specification parameters for a ServiceMonitor.
-
setNativeHistogramMinBucketFactor
public void setNativeHistogramMinBucketFactor(Quantity nativeHistogramMinBucketFactor)
ServiceMonitorSpec defines the specification parameters for a ServiceMonitor.
-
getPodTargetLabels
public List<String> getPodTargetLabels()
podTargetLabels defines the labels which are transferred from the associated Kubernetes `Pod` object onto the ingested metrics.
-
setPodTargetLabels
public void setPodTargetLabels(List<String> podTargetLabels)
podTargetLabels defines the labels which are transferred from the associated Kubernetes `Pod` object onto the ingested metrics.
-
getSampleLimit
public Long getSampleLimit()
sampleLimit defines a per-scrape limit on the number of scraped samples that will be accepted.
-
setSampleLimit
public void setSampleLimit(Long sampleLimit)
sampleLimit defines a per-scrape limit on the number of scraped samples that will be accepted.
-
getScrapeClass
public String getScrapeClass()
scrapeClass defines the scrape class to apply.
-
setScrapeClass
public void setScrapeClass(String scrapeClass)
scrapeClass defines the scrape class to apply.
-
getScrapeClassicHistograms
public Boolean getScrapeClassicHistograms()
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.
-
setScrapeClassicHistograms
public void setScrapeClassicHistograms(Boolean 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.
-
getScrapeNativeHistograms
public Boolean getScrapeNativeHistograms()
scrapeNativeHistograms defines whether to enable scraping of native histograms. It requires Prometheus >= v3.8.0.
-
setScrapeNativeHistograms
public void setScrapeNativeHistograms(Boolean scrapeNativeHistograms)
scrapeNativeHistograms defines whether to enable scraping of native histograms. It requires Prometheus >= v3.8.0.
-
getScrapeProtocols
public List<String> getScrapeProtocols()
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.
-
setScrapeProtocols
public void setScrapeProtocols(List<String> 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.
-
getSelector
public LabelSelector getSelector()
ServiceMonitorSpec defines the specification parameters for a ServiceMonitor.
-
setSelector
public void setSelector(LabelSelector selector)
ServiceMonitorSpec defines the specification parameters for a ServiceMonitor.
-
getSelectorMechanism
public String getSelectorMechanism()
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.
-
setSelectorMechanism
public void setSelectorMechanism(String 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.
-
getServiceDiscoveryRole
public String getServiceDiscoveryRole()
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.
-
setServiceDiscoveryRole
public void setServiceDiscoveryRole(String 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.
-
getTargetLabels
public List<String> getTargetLabels()
targetLabels defines the labels which are transferred from the associated Kubernetes `Service` object onto the ingested metrics.
-
setTargetLabels
public void setTargetLabels(List<String> targetLabels)
targetLabels defines the labels which are transferred from the associated Kubernetes `Service` object onto the ingested metrics.
-
getTargetLimit
public Long getTargetLimit()
targetLimit defines a limit on the number of scraped targets that will be accepted.
-
setTargetLimit
public void setTargetLimit(Long targetLimit)
targetLimit defines a limit on the number of scraped targets that will be accepted.
-
edit
public ServiceMonitorSpecBuilder edit()
- Specified by:
editin interfaceEditable<ServiceMonitorSpecBuilder>
-
toBuilder
public ServiceMonitorSpecBuilder toBuilder()
-
-