prometheus-community / stackdriver_exporter

Google Stackdriver Prometheus exporter
Apache License 2.0
261 stars 98 forks source link

How to get metrics from multiple projects #132

Open sandyydk opened 3 years ago

sandyydk commented 3 years ago

What if I had a service account which had access to multiple projects and wanted to scrape GCP metrics for all of those projects? Currently we are able to get metrics only for the parent project and not other projects where we have access to.

/gcp_stackdriver_exporter/stackdriver_exporter --monitoring.metrics-type-prefixes loadbalancing.googleapis.com/

How to do that? How to use the roles/permissions of a service account to get metrics from other projects other than just adding those project names?

dmichel1 commented 3 years ago

You should just be able to add --google.project-id project-a,projectb as an argument.

https://github.com/prometheus-community/stackdriver_exporter#flags describes it more.

sandyydk commented 3 years ago

You should just be able to add --google.project-id project-a,projectb as an argument.

https://github.com/prometheus-community/stackdriver_exporter#flags describes it more.

This is a problem as it would mean that if an account has access to say 30 other accounts with role to obtain metrics, we would need to add all those account names to the flag and restart the exporter service. Would be convenient if we could get all metrics of all the projects to which we have access to.