Class GCESDConfig

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

    @Generated("io.fabric8.kubernetes.schema.generator.model.ModelGenerator")
    public class GCESDConfig
    extends Object
    implements io.fabric8.kubernetes.api.builder.Editable<GCESDConfigBuilder>, io.fabric8.kubernetes.api.model.KubernetesResource
    GCESDConfig configures scrape targets from GCP GCE instances. The private IP address is used by default, but may be changed to the public IP address with relabeling. See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#gce_sd_config


    The GCE service discovery will load the Google Cloud credentials from the file specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable. See https://cloud.google.com/kubernetes-engine/docs/tutorials/authenticating-to-cloud-platform


    A pre-requisite for using GCESDConfig is that a Secret containing valid Google Cloud credentials is mounted into the Prometheus or PrometheusAgent pod via the `.spec.secrets` field and that the GOOGLE_APPLICATION_CREDENTIALS environment variable is set to /etc/prometheus/secrets/<secret-name>/<credentials-filename.json>.

    See Also:
    Serialized Form
    • Constructor Detail

      • GCESDConfig

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

      • getFilter

        public String getFilter()
        Filter can be used optionally to filter the instance list by other criteria Syntax of this filter is described in the filter query parameter section: https://cloud.google.com/compute/docs/reference/latest/instances/list
      • setFilter

        public void setFilter​(String filter)
        Filter can be used optionally to filter the instance list by other criteria Syntax of this filter is described in the filter query parameter section: https://cloud.google.com/compute/docs/reference/latest/instances/list
      • getPort

        public Integer getPort()
        The port to scrape metrics from. If using the public IP address, this must instead be specified in the relabeling rule.
      • setPort

        public void setPort​(Integer port)
        The port to scrape metrics from. If using the public IP address, this must instead be specified in the relabeling rule.
      • getProject

        public String getProject()
        The Google Cloud Project ID
      • setProject

        public void setProject​(String project)
        The Google Cloud Project ID
      • getRefreshInterval

        public String getRefreshInterval()
        RefreshInterval configures the refresh interval at which Prometheus will re-read the instance list.
      • setRefreshInterval

        public void setRefreshInterval​(String refreshInterval)
        RefreshInterval configures the refresh interval at which Prometheus will re-read the instance list.
      • getTagSeparator

        public String getTagSeparator()
        The tag separator is used to separate the tags on concatenation
      • setTagSeparator

        public void setTagSeparator​(String tagSeparator)
        The tag separator is used to separate the tags on concatenation
      • getZone

        public String getZone()
        The zone of the scrape targets. If you need multiple zones use multiple GCESDConfigs.
      • setZone

        public void setZone​(String zone)
        The zone of the scrape targets. If you need multiple zones use multiple GCESDConfigs.
      • getAdditionalProperties

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

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

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