stackdriver_exporter icon indicating copy to clipboard operation
stackdriver_exporter copied to clipboard

How to get metrics from multiple projects

Open sandyydk opened this issue 3 years ago • 2 comments

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?

sandyydk avatar Jul 14 '21 12:07 sandyydk

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.

dmichel1 avatar Sep 24 '21 19:09 dmichel1

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.

sandyydk avatar Oct 28 '21 10:10 sandyydk