Class KubernetesSDConfig

    • Method Detail

      • getApiServer

        public String getApiServer()
        apiServer defines the API server address consisting of a hostname or IP address followed by an optional port number. If left empty, Prometheus is assumed to run inside of the cluster. It will discover API servers automatically and use the pod's CA certificate and bearer token file at /var/run/secrets/kubernetes.io/serviceaccount/.
      • setApiServer

        public void setApiServer​(String apiServer)
        apiServer defines the API server address consisting of a hostname or IP address followed by an optional port number. If left empty, Prometheus is assumed to run inside of the cluster. It will discover API servers automatically and use the pod's CA certificate and bearer token file at /var/run/secrets/kubernetes.io/serviceaccount/.
      • getAttachMetadata

        public AttachMetadata getAttachMetadata()
        KubernetesSDConfig allows retrieving scrape targets from Kubernetes' REST API. See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config
      • setAttachMetadata

        public void setAttachMetadata​(AttachMetadata attachMetadata)
        KubernetesSDConfig allows retrieving scrape targets from Kubernetes' REST API. See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config
      • getAuthorization

        public SafeAuthorization getAuthorization()
        KubernetesSDConfig allows retrieving scrape targets from Kubernetes' REST API. See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config
      • setAuthorization

        public void setAuthorization​(SafeAuthorization authorization)
        KubernetesSDConfig allows retrieving scrape targets from Kubernetes' REST API. See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config
      • getBasicAuth

        public BasicAuth getBasicAuth()
        KubernetesSDConfig allows retrieving scrape targets from Kubernetes' REST API. See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config
      • setBasicAuth

        public void setBasicAuth​(BasicAuth basicAuth)
        KubernetesSDConfig allows retrieving scrape targets from Kubernetes' REST API. See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config
      • getEnableHTTP2

        public Boolean getEnableHTTP2()
        enableHTTP2 defines whether to enable HTTP2.
      • setEnableHTTP2

        public void setEnableHTTP2​(Boolean enableHTTP2)
        enableHTTP2 defines whether to enable HTTP2.
      • getFollowRedirects

        public Boolean getFollowRedirects()
        followRedirects defines whether HTTP requests follow HTTP 3xx redirects.
      • setFollowRedirects

        public void setFollowRedirects​(Boolean followRedirects)
        followRedirects defines whether HTTP requests follow HTTP 3xx redirects.
      • getNamespaces

        public NamespaceDiscovery getNamespaces()
        KubernetesSDConfig allows retrieving scrape targets from Kubernetes' REST API. See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config
      • setNamespaces

        public void setNamespaces​(NamespaceDiscovery namespaces)
        KubernetesSDConfig allows retrieving scrape targets from Kubernetes' REST API. See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config
      • getNoProxy

        public String getNoProxy()
        noProxy defines 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 defines 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.

      • getOauth2

        public OAuth2 getOauth2()
        KubernetesSDConfig allows retrieving scrape targets from Kubernetes' REST API. See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config
      • setOauth2

        public void setOauth2​(OAuth2 oauth2)
        KubernetesSDConfig allows retrieving scrape targets from Kubernetes' REST API. See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config
      • getProxyConnectHeader

        public Map<String,​List<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<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()
        proxyFromEnvironment defines 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)
        proxyFromEnvironment defines 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.
      • getRole

        public String getRole()
        role defines the Kubernetes role of the entities that should be discovered. Role `Endpointslice` requires Prometheus >= v2.21.0
      • setRole

        public void setRole​(String role)
        role defines the Kubernetes role of the entities that should be discovered. Role `Endpointslice` requires Prometheus >= v2.21.0
      • getSelectors

        public List<K8SSelectorConfig> getSelectors()
        selectors defines the selector to select objects. It requires Prometheus >= v2.17.0
      • setSelectors

        public void setSelectors​(List<K8SSelectorConfig> selectors)
        selectors defines the selector to select objects. It requires Prometheus >= v2.17.0
      • getTlsConfig

        public SafeTLSConfig getTlsConfig()
        KubernetesSDConfig allows retrieving scrape targets from Kubernetes' REST API. See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config
      • setTlsConfig

        public void setTlsConfig​(SafeTLSConfig tlsConfig)
        KubernetesSDConfig allows retrieving scrape targets from Kubernetes' REST API. See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config
      • getAdditionalProperties

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

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

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