Class ScrapeConfigSpec

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

    @Generated("io.fabric8.kubernetes.schema.generator.model.ModelGenerator")
    public class ScrapeConfigSpec
    extends Object
    implements io.fabric8.kubernetes.api.builder.Editable<ScrapeConfigSpecBuilder>, io.fabric8.kubernetes.api.model.KubernetesResource
    ScrapeConfigSpec is a specification of the desired configuration for a scrape configuration.
    See Also:
    Serialized Form
    • Method Detail

      • getAuthorization

        public SafeAuthorization getAuthorization()
        ScrapeConfigSpec is a specification of the desired configuration for a scrape configuration.
      • setAuthorization

        public void setAuthorization​(SafeAuthorization authorization)
        ScrapeConfigSpec is a specification of the desired configuration for a scrape configuration.
      • getAzureSDConfigs

        public List<AzureSDConfig> getAzureSDConfigs()
        AzureSDConfigs defines a list of Azure service discovery configurations.
      • setAzureSDConfigs

        public void setAzureSDConfigs​(List<AzureSDConfig> azureSDConfigs)
        AzureSDConfigs defines a list of Azure service discovery configurations.
      • getBasicAuth

        public BasicAuth getBasicAuth()
        ScrapeConfigSpec is a specification of the desired configuration for a scrape configuration.
      • setBasicAuth

        public void setBasicAuth​(BasicAuth basicAuth)
        ScrapeConfigSpec is a specification of the desired configuration for a scrape configuration.
      • getConsulSDConfigs

        public List<ConsulSDConfig> getConsulSDConfigs()
        ConsulSDConfigs defines a list of Consul service discovery configurations.
      • setConsulSDConfigs

        public void setConsulSDConfigs​(List<ConsulSDConfig> consulSDConfigs)
        ConsulSDConfigs defines a list of Consul service discovery configurations.
      • 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.
      • getDigitalOceanSDConfigs

        public List<DigitalOceanSDConfig> getDigitalOceanSDConfigs()
        DigitalOceanSDConfigs defines a list of DigitalOcean service discovery configurations.
      • setDigitalOceanSDConfigs

        public void setDigitalOceanSDConfigs​(List<DigitalOceanSDConfig> digitalOceanSDConfigs)
        DigitalOceanSDConfigs defines a list of DigitalOcean service discovery configurations.
      • getDnsSDConfigs

        public List<DNSSDConfig> getDnsSDConfigs()
        DNSSDConfigs defines a list of DNS service discovery configurations.
      • setDnsSDConfigs

        public void setDnsSDConfigs​(List<DNSSDConfig> dnsSDConfigs)
        DNSSDConfigs defines a list of DNS service discovery configurations.
      • getDockerSDConfigs

        public List<DockerSDConfig> getDockerSDConfigs()
        DockerSDConfigs defines a list of Docker service discovery configurations.
      • setDockerSDConfigs

        public void setDockerSDConfigs​(List<DockerSDConfig> dockerSDConfigs)
        DockerSDConfigs defines a list of Docker service discovery configurations.
      • getDockerSwarmSDConfigs

        public List<DockerSwarmSDConfig> getDockerSwarmSDConfigs()
        DockerswarmSDConfigs defines a list of Dockerswarm service discovery configurations.
      • setDockerSwarmSDConfigs

        public void setDockerSwarmSDConfigs​(List<DockerSwarmSDConfig> dockerSwarmSDConfigs)
        DockerswarmSDConfigs defines a list of Dockerswarm service discovery configurations.
      • getEc2SDConfigs

        public List<EC2SDConfig> getEc2SDConfigs()
        EC2SDConfigs defines a list of EC2 service discovery configurations.
      • setEc2SDConfigs

        public void setEc2SDConfigs​(List<EC2SDConfig> ec2SDConfigs)
        EC2SDConfigs defines a list of EC2 service discovery configurations.
      • getEnableCompression

        public Boolean getEnableCompression()
        When false, Prometheus will request uncompressed response from the scraped target.


        It requires Prometheus >= v2.49.0.


        If unset, Prometheus uses true by default.

      • setEnableCompression

        public void setEnableCompression​(Boolean enableCompression)
        When false, Prometheus will request uncompressed response from the scraped target.


        It requires Prometheus >= v2.49.0.


        If unset, Prometheus uses true by default.

      • getEnableHTTP2

        public Boolean getEnableHTTP2()
        Whether to enable HTTP2.
      • setEnableHTTP2

        public void setEnableHTTP2​(Boolean enableHTTP2)
        Whether to enable HTTP2.
      • getEurekaSDConfigs

        public List<EurekaSDConfig> getEurekaSDConfigs()
        EurekaSDConfigs defines a list of Eureka service discovery configurations.
      • setEurekaSDConfigs

        public void setEurekaSDConfigs​(List<EurekaSDConfig> eurekaSDConfigs)
        EurekaSDConfigs defines a list of Eureka service discovery configurations.
      • 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.

      • getFileSDConfigs

        public List<FileSDConfig> getFileSDConfigs()
        FileSDConfigs defines a list of file service discovery configurations.
      • setFileSDConfigs

        public void setFileSDConfigs​(List<FileSDConfig> fileSDConfigs)
        FileSDConfigs defines a list of file service discovery configurations.
      • getGceSDConfigs

        public List<GCESDConfig> getGceSDConfigs()
        GCESDConfigs defines a list of GCE service discovery configurations.
      • setGceSDConfigs

        public void setGceSDConfigs​(List<GCESDConfig> gceSDConfigs)
        GCESDConfigs defines a list of GCE service discovery configurations.
      • getHetznerSDConfigs

        public List<HetznerSDConfig> getHetznerSDConfigs()
        HetznerSDConfigs defines a list of Hetzner service discovery configurations.
      • setHetznerSDConfigs

        public void setHetznerSDConfigs​(List<HetznerSDConfig> hetznerSDConfigs)
        HetznerSDConfigs defines a list of Hetzner service discovery configurations.
      • getHonorLabels

        public Boolean getHonorLabels()
        HonorLabels chooses the metric's labels on collisions with target labels.
      • setHonorLabels

        public void setHonorLabels​(Boolean honorLabels)
        HonorLabels chooses the metric's labels on collisions with target labels.
      • getHonorTimestamps

        public Boolean getHonorTimestamps()
        HonorTimestamps controls whether Prometheus respects the timestamps present in scraped data.
      • setHonorTimestamps

        public void setHonorTimestamps​(Boolean honorTimestamps)
        HonorTimestamps controls whether Prometheus respects the timestamps present in scraped data.
      • getHttpSDConfigs

        public List<HTTPSDConfig> getHttpSDConfigs()
        HTTPSDConfigs defines a list of HTTP service discovery configurations.
      • setHttpSDConfigs

        public void setHttpSDConfigs​(List<HTTPSDConfig> httpSDConfigs)
        HTTPSDConfigs defines a list of HTTP service discovery configurations.
      • getIonosSDConfigs

        public List<IonosSDConfig> getIonosSDConfigs()
        IonosSDConfigs defines a list of IONOS service discovery configurations.
      • setIonosSDConfigs

        public void setIonosSDConfigs​(List<IonosSDConfig> ionosSDConfigs)
        IonosSDConfigs defines a list of IONOS service discovery configurations.
      • getJobName

        public String getJobName()
        The value of the `job` label assigned to the scraped metrics by default.


        The `job_name` field in the rendered scrape configuration is always controlled by the operator to prevent duplicate job names, which Prometheus does not allow. Instead the `job` label is set by means of relabeling configs.

      • setJobName

        public void setJobName​(String jobName)
        The value of the `job` label assigned to the scraped metrics by default.


        The `job_name` field in the rendered scrape configuration is always controlled by the operator to prevent duplicate job names, which Prometheus does not allow. Instead the `job` label is set by means of relabeling configs.

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

      • getKubernetesSDConfigs

        public List<KubernetesSDConfig> getKubernetesSDConfigs()
        KubernetesSDConfigs defines a list of Kubernetes service discovery configurations.
      • setKubernetesSDConfigs

        public void setKubernetesSDConfigs​(List<KubernetesSDConfig> kubernetesSDConfigs)
        KubernetesSDConfigs defines a list of Kubernetes service discovery configurations.
      • getKumaSDConfigs

        public List<KumaSDConfig> getKumaSDConfigs()
        KumaSDConfigs defines a list of Kuma service discovery configurations.
      • setKumaSDConfigs

        public void setKumaSDConfigs​(List<KumaSDConfig> kumaSDConfigs)
        KumaSDConfigs defines a list of Kuma service discovery configurations.
      • getLabelLimit

        public Long getLabelLimit()
        Per-scrape limit on number of labels that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer.
      • setLabelLimit

        public void setLabelLimit​(Long labelLimit)
        Per-scrape limit on number of labels that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer.
      • getLabelNameLengthLimit

        public Long getLabelNameLengthLimit()
        Per-scrape limit on length of labels name that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer.
      • setLabelNameLengthLimit

        public void setLabelNameLengthLimit​(Long labelNameLengthLimit)
        Per-scrape limit on length of labels name that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer.
      • getLabelValueLengthLimit

        public Long getLabelValueLengthLimit()
        Per-scrape limit on length of labels value that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer.
      • setLabelValueLengthLimit

        public void setLabelValueLengthLimit​(Long labelValueLengthLimit)
        Per-scrape limit on length of labels value that will be accepted for a sample. Only valid in Prometheus versions 2.27.0 and newer.
      • getLightSailSDConfigs

        public List<LightSailSDConfig> getLightSailSDConfigs()
        LightsailSDConfigs defines a list of Lightsail service discovery configurations.
      • setLightSailSDConfigs

        public void setLightSailSDConfigs​(List<LightSailSDConfig> lightSailSDConfigs)
        LightsailSDConfigs defines a list of Lightsail service discovery configurations.
      • getLinodeSDConfigs

        public List<LinodeSDConfig> getLinodeSDConfigs()
        LinodeSDConfigs defines a list of Linode service discovery configurations.
      • setLinodeSDConfigs

        public void setLinodeSDConfigs​(List<LinodeSDConfig> linodeSDConfigs)
        LinodeSDConfigs defines a list of Linode service discovery configurations.
      • getMetricRelabelings

        public List<RelabelConfig> getMetricRelabelings()
        MetricRelabelConfigs to apply to samples before ingestion.
      • setMetricRelabelings

        public void setMetricRelabelings​(List<RelabelConfig> metricRelabelings)
        MetricRelabelConfigs to apply to samples before ingestion.
      • getMetricsPath

        public String getMetricsPath()
        MetricsPath HTTP path to scrape for metrics. If empty, Prometheus uses the default value (e.g. /metrics).
      • setMetricsPath

        public void setMetricsPath​(String metricsPath)
        MetricsPath HTTP path to scrape for metrics. If empty, Prometheus uses the default value (e.g. /metrics).
      • getNameEscapingScheme

        public String getNameEscapingScheme()
        Metric name escaping mode to request through content negotiation.


        It requires Prometheus >= v3.4.0.

      • setNameEscapingScheme

        public void setNameEscapingScheme​(String nameEscapingScheme)
        Metric name escaping mode to request through content negotiation.


        It requires Prometheus >= v3.4.0.

      • getNameValidationScheme

        public String getNameValidationScheme()
        Specifies the validation scheme for metric and label names.


        It requires Prometheus >= v3.0.0.

      • setNameValidationScheme

        public void setNameValidationScheme​(String nameValidationScheme)
        Specifies the validation scheme for metric and label names.


        It requires Prometheus >= v3.0.0.

      • 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()
        ScrapeConfigSpec is a specification of the desired configuration for a scrape configuration.
      • setNativeHistogramMinBucketFactor

        public void setNativeHistogramMinBucketFactor​(io.fabric8.kubernetes.api.model.Quantity nativeHistogramMinBucketFactor)
        ScrapeConfigSpec is a specification of the desired configuration for a scrape configuration.
      • getNoProxy

        public String getNoProxy()
        `noProxy` is a comma-separated string that can contain IPs, CIDR notation, domain names that should be excluded from proxying. IP and domain names can contain port numbers.


        It requires Prometheus >= v2.43.0, Alertmanager >= v0.25.0 or Thanos >= v0.32.0.

      • setNoProxy

        public void setNoProxy​(String noProxy)
        `noProxy` is a comma-separated string that can contain IPs, CIDR notation, domain names that should be excluded from proxying. IP and domain names can contain port numbers.


        It requires Prometheus >= v2.43.0, Alertmanager >= v0.25.0 or Thanos >= v0.32.0.

      • getNomadSDConfigs

        public List<NomadSDConfig> getNomadSDConfigs()
        NomadSDConfigs defines a list of Nomad service discovery configurations.
      • setNomadSDConfigs

        public void setNomadSDConfigs​(List<NomadSDConfig> nomadSDConfigs)
        NomadSDConfigs defines a list of Nomad service discovery configurations.
      • getOauth2

        public OAuth2 getOauth2()
        ScrapeConfigSpec is a specification of the desired configuration for a scrape configuration.
      • setOauth2

        public void setOauth2​(OAuth2 oauth2)
        ScrapeConfigSpec is a specification of the desired configuration for a scrape configuration.
      • getOpenstackSDConfigs

        public List<OpenStackSDConfig> getOpenstackSDConfigs()
        OpenStackSDConfigs defines a list of OpenStack service discovery configurations.
      • setOpenstackSDConfigs

        public void setOpenstackSDConfigs​(List<OpenStackSDConfig> openstackSDConfigs)
        OpenStackSDConfigs defines a list of OpenStack service discovery configurations.
      • getOvhcloudSDConfigs

        public List<OVHCloudSDConfig> getOvhcloudSDConfigs()
        OVHCloudSDConfigs defines a list of OVHcloud service discovery configurations.
      • setOvhcloudSDConfigs

        public void setOvhcloudSDConfigs​(List<OVHCloudSDConfig> ovhcloudSDConfigs)
        OVHCloudSDConfigs defines a list of OVHcloud service discovery configurations.
      • setParams

        public void setParams​(Map<String,​List<String>> params)
        Optional HTTP URL parameters
      • getProxyConnectHeader

        public Map<String,​List<io.fabric8.kubernetes.api.model.SecretKeySelector>> getProxyConnectHeader()
        ProxyConnectHeader optionally specifies headers to send to proxies during CONNECT requests.


        It requires Prometheus >= v2.43.0, Alertmanager >= v0.25.0 or Thanos >= v0.32.0.

      • setProxyConnectHeader

        public void setProxyConnectHeader​(Map<String,​List<io.fabric8.kubernetes.api.model.SecretKeySelector>> proxyConnectHeader)
        ProxyConnectHeader optionally specifies headers to send to proxies during CONNECT requests.


        It requires Prometheus >= v2.43.0, Alertmanager >= v0.25.0 or Thanos >= v0.32.0.

      • getProxyFromEnvironment

        public Boolean getProxyFromEnvironment()
        Whether to use the proxy configuration defined by environment variables (HTTP_PROXY, HTTPS_PROXY, and NO_PROXY).


        It requires Prometheus >= v2.43.0, Alertmanager >= v0.25.0 or Thanos >= v0.32.0.

      • setProxyFromEnvironment

        public void setProxyFromEnvironment​(Boolean proxyFromEnvironment)
        Whether to use the proxy configuration defined by environment variables (HTTP_PROXY, HTTPS_PROXY, and NO_PROXY).


        It requires Prometheus >= v2.43.0, Alertmanager >= v0.25.0 or Thanos >= v0.32.0.

      • getProxyUrl

        public String getProxyUrl()
        `proxyURL` defines the HTTP proxy server to use.
      • setProxyUrl

        public void setProxyUrl​(String proxyUrl)
        `proxyURL` defines the HTTP proxy server to use.
      • getPuppetDBSDConfigs

        public List<PuppetDBSDConfig> getPuppetDBSDConfigs()
        PuppetDBSDConfigs defines a list of PuppetDB service discovery configurations.
      • setPuppetDBSDConfigs

        public void setPuppetDBSDConfigs​(List<PuppetDBSDConfig> puppetDBSDConfigs)
        PuppetDBSDConfigs defines a list of PuppetDB service discovery configurations.
      • getRelabelings

        public List<RelabelConfig> getRelabelings()
        RelabelConfigs defines how to rewrite the target's labels before scraping. Prometheus Operator automatically adds relabelings for a few standard Kubernetes fields. The original scrape job's name is available via the `__tmp_prometheus_job_name` label. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
      • setRelabelings

        public void setRelabelings​(List<RelabelConfig> relabelings)
        RelabelConfigs defines how to rewrite the target's labels before scraping. Prometheus Operator automatically adds relabelings for a few standard Kubernetes fields. The original scrape job's name is available via the `__tmp_prometheus_job_name` label. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
      • getSampleLimit

        public Long getSampleLimit()
        SampleLimit defines per-scrape limit on number of scraped samples that will be accepted.
      • setSampleLimit

        public void setSampleLimit​(Long sampleLimit)
        SampleLimit defines per-scrape limit on number of scraped samples that will be accepted.
      • getScalewaySDConfigs

        public List<ScalewaySDConfig> getScalewaySDConfigs()
        ScalewaySDConfigs defines a list of Scaleway instances and baremetal service discovery configurations.
      • setScalewaySDConfigs

        public void setScalewaySDConfigs​(List<ScalewaySDConfig> scalewaySDConfigs)
        ScalewaySDConfigs defines a list of Scaleway instances and baremetal service discovery configurations.
      • getScheme

        public String getScheme()
        Configures the protocol scheme used for requests. If empty, Prometheus uses HTTP by default.
      • setScheme

        public void setScheme​(String scheme)
        Configures the protocol scheme used for requests. If empty, Prometheus uses HTTP by default.
      • 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.
      • getScrapeInterval

        public String getScrapeInterval()
        ScrapeInterval is the interval between consecutive scrapes.
      • setScrapeInterval

        public void setScrapeInterval​(String scrapeInterval)
        ScrapeInterval is the interval between consecutive scrapes.
      • getScrapeProtocols

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

      • getScrapeTimeout

        public String getScrapeTimeout()
        ScrapeTimeout is the number of seconds to wait until a scrape request times out. The value cannot be greater than the scrape interval otherwise the operator will reject the resource.
      • setScrapeTimeout

        public void setScrapeTimeout​(String scrapeTimeout)
        ScrapeTimeout is the number of seconds to wait until a scrape request times out. The value cannot be greater than the scrape interval otherwise the operator will reject the resource.
      • getStaticConfigs

        public List<StaticConfig> getStaticConfigs()
        StaticConfigs defines a list of static targets with a common label set.
      • setStaticConfigs

        public void setStaticConfigs​(List<StaticConfig> staticConfigs)
        StaticConfigs defines a list of static targets with a common label set.
      • 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.
      • getTlsConfig

        public SafeTLSConfig getTlsConfig()
        ScrapeConfigSpec is a specification of the desired configuration for a scrape configuration.
      • setTlsConfig

        public void setTlsConfig​(SafeTLSConfig tlsConfig)
        ScrapeConfigSpec is a specification of the desired configuration for a scrape configuration.
      • getTrackTimestampsStaleness

        public Boolean getTrackTimestampsStaleness()
        TrackTimestampsStaleness whether Prometheus tracks staleness of the metrics that have an explicit timestamp present in scraped data. Has no effect if `honorTimestamps` is false. It requires Prometheus >= v2.48.0.
      • setTrackTimestampsStaleness

        public void setTrackTimestampsStaleness​(Boolean trackTimestampsStaleness)
        TrackTimestampsStaleness whether Prometheus tracks staleness of the metrics that have an explicit timestamp present in scraped data. Has no effect if `honorTimestamps` is false. It requires Prometheus >= v2.48.0.
      • getAdditionalProperties

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

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

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