__THIS WILL PROBABLY CHARGE ($$$) YOUR GOOGLE ACCOUNT IF YOU RUN IT A BUNCH, I’M NOT RESPONSIBLE FOR THAT__
An example of the usage of the golang GCP monitoring API, meant to show a real example of it’s usage rather than Google’s examples, which are far too simple.
The code runs through the provided project and lists all available metrics, then calls to get 3 GCP compute CPU metrics in parallel, using a sync.WaitGroup
to wait on the goroutines.
Clone, go build, and run with:
golang-gcp-monitoring --service-account=<YOUR_SERVICE_ACCOUNT_PATH> --project-id=<YOUR_PROJECT_NAME>
or
go get -u github.com/peixian/golang-gcp-monitoring
golang-gcp-monitoring --service-account=<YOUR_SERVICE_ACCOUNT_PATH> --project-id=<YOUR_PROJECT_NAME>