Class PodMonitorSpec

    • 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()
        bodySizeLimit when defined 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 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.
      • 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 defines 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)
        jobLabel defines 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()
        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()
        PodMonitorSpec contains specification parameters for a PodMonitor.
      • setNamespaceSelector

        public void setNamespaceSelector​(NamespaceSelector namespaceSelector)
        PodMonitorSpec contains specification parameters for a PodMonitor.
      • 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()
        PodMonitorSpec contains specification parameters for a PodMonitor.
      • setNativeHistogramMinBucketFactor

        public void setNativeHistogramMinBucketFactor​(Quantity nativeHistogramMinBucketFactor)
        PodMonitorSpec contains specification parameters for a PodMonitor.
      • getPodMetricsEndpoints

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

        public void setPodMetricsEndpoints​(List<PodMetricsEndpoint> podMetricsEndpoints)
        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()
        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()
        PodMonitorSpec contains specification parameters for a PodMonitor.
      • setSelector

        public void setSelector​(LabelSelector selector)
        PodMonitorSpec contains specification parameters for a PodMonitor.
      • 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.

      • 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)