GoogleCloudPlatform / k8s-stackdriver

Apache License 2.0
391 stars 212 forks source link

custom-metrics-stackdriver-adapter should use DefaultTokenSource #97

Open apstndb opened 6 years ago

apstndb commented 6 years ago

Although Stackdriver Monitoring is not support only GCP but also multi-cloud and hybrid-cloud deployment, custom-metrics-stackdriver-adapter is strongly tied with GCE/GKE because it use ComputeTokenSource. DefaultTokenSource should be more widely useful option because it allows to use GOOGLE_APPLICATION_CREDENTIALS.

I am not testing it yet but it will be a small patch like below. https://github.com/apstndb/k8s-stackdriver/commit/5cc3399c0225ea527e7b9bed6ab27b47b435a45b

x13n commented 6 years ago

cc @kawych

kawych commented 6 years ago

Agreed, when you have a PR I'm happy to review. Note that custom-metrics-stackdriver-adapter still uses Metadata Server to filter relevant timeseries from Stackdriver, so this will still only work on GCP, but this is a step in the right direction.

The next step should be to use Stackdriver Metadata Agent instead of Metadata Server for cluster metadata.

apstndb commented 6 years ago

The PR is merged. This issue's root reason is to support multi-cloud and hybrid deployment. So, it may be better to renamed if it is right direction.

Sorry, I have currently no time to finish it.