Class PodMonitorSpec

  • All Implemented Interfaces:
    io.fabric8.kubernetes.api.builder.Editable<PodMonitorSpecBuilder>, io.fabric8.kubernetes.api.model.KubernetesResource, Serializable

    @Generated("io.fabric8.kubernetes.schema.generator.model.ModelGenerator")
    public class PodMonitorSpec
    extends Object
    implements io.fabric8.kubernetes.api.builder.Editable<PodMonitorSpecBuilder>, io.fabric8.kubernetes.api.model.KubernetesResource
    PodMonitorSpec contains specification parameters for a PodMonitor.
    See Also:
    Serialized Form
    • Constructor Detail

      • PodMonitorSpec

        public PodMonitorSpec()
        No args constructor for use in serialization
    • Method Detail

      • getAttachMetadata

        public AttachMetadata getAttachMetadata()
        PodMonitorSpec contains specification parameters for a PodMonitor.
      • setAttachMetadata

        public void setAttachMetadata​(AttachMetadata attachMetadata)
        PodMonitorSpec contains specification parameters for a PodMonitor.
      • getBodySizeLimit

        public String getBodySizeLimit()
        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)
        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()
        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)
        Whether to convert all scraped classic histograms into a native histogram with custom buckets. It requires Prometheus >= v3.0.0.
      • getFallbackScrapeProtocol

        public String getFallbackScrapeProtocol()
        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)
        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()
        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>`).

      • setJobLabel

        public void setJobLabel​(String jobLabel)
        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>`).

      • getKeepDroppedTargets

        public Long getKeepDroppedTargets()
        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)
        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()
        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)
        Per-scrape limit on number of labels that will be accepted for a sample.


        It requires Prometheus >= v2.27.0.

      • getLabelNameLengthLimit

        public Long getLabelNameLengthLimit()
        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)
        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()
        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)
        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()
        PodMonitorSpec contains specification parameters for a PodMonitor.
      • setNamespaceSelector

        public void setNamespaceSelector​(NamespaceSelector namespaceSelector)
        PodMonitorSpec contains specification parameters for a PodMonitor.
      • getNativeHistogramBucketLimit

        public Long getNativeHistogramBucketLimit()
        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.
      • setNativeHistogramBucketLimit

        public void setNativeHistogramBucketLimit​(Long 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.
      • getNativeHistogramMinBucketFactor

        public io.fabric8.kubernetes.api.model.Quantity getNativeHistogramMinBucketFactor()
        PodMonitorSpec contains specification parameters for a PodMonitor.
      • setNativeHistogramMinBucketFactor

        public void setNativeHistogramMinBucketFactor​(io.fabric8.kubernetes.api.model.Quantity nativeHistogramMinBucketFactor)
        PodMonitorSpec contains specification parameters for a PodMonitor.
      • getPodMetricsEndpoints

        public List<PodMetricsEndpoint> getPodMetricsEndpoints()
        Defines how to scrape metrics from the selected pods.
      • setPodMetricsEndpoints

        public void setPodMetricsEndpoints​(List<PodMetricsEndpoint> podMetricsEndpoints)
        Defines how to scrape metrics from the selected pods.
      • 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()
        The scrape class to apply.
      • setScrapeClass

        public void setScrapeClass​(String scrapeClass)
        The scrape class to apply.
      • getScrapeClassicHistograms

        public Boolean getScrapeClassicHistograms()
        Whether to scrape a classic histogram that is also exposed as a native histogram. It requires Prometheus >= v2.45.0.
      • setScrapeClassicHistograms

        public void setScrapeClassicHistograms​(Boolean scrapeClassicHistograms)
        Whether to scrape a classic histogram that is also exposed as a native histogram. It requires Prometheus >= v2.45.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 io.fabric8.kubernetes.api.model.LabelSelector getSelector()
        PodMonitorSpec contains specification parameters for a PodMonitor.
      • setSelector

        public void setSelector​(io.fabric8.kubernetes.api.model.LabelSelector selector)
        PodMonitorSpec contains specification parameters for a PodMonitor.
      • getSelectorMechanism

        public String getSelectorMechanism()
        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)
        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.

      • 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.
      • getAdditionalProperties

        public Map<String,​Object> getAdditionalProperties()
      • setAdditionalProperty

        public void setAdditionalProperty​(String name,
                                          Object value)
      • setAdditionalProperties

        public void setAdditionalProperties​(Map<String,​Object> additionalProperties)