Stackdriver / stackdriver-prometheus-sidecar

A sidecar for the Prometheus server that can send metrics to Stackdriver.
https://cloud.google.com/monitoring/kubernetes-engine/prometheus
Apache License 2.0
120 stars 43 forks source link

Remove required flag from `project-id` and get its value from GCE metadata #254

Closed kirecek closed 3 years ago

kirecek commented 3 years ago

This snippet sets the projectID to value fetched from GCE metadata:

    if *projectID == "" {
        *projectID = getGCEProjectID()
    }

However, this does not work because projectID cannot be empty due to required flag in kingpin config.

This MR removes the required thing and adds a little bit logging around the projectID setting.