Skip to content

Commit 29bf77a

Browse files
committed
Merge pull request #85 from GoogleCloudPlatform/monitoringtests
Add Monitoring Tests
2 parents 86d488c + 78bd52d commit 29bf77a

File tree

5 files changed

+408
-278
lines changed

5 files changed

+408
-278
lines changed

monitoring/README.md

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,47 +6,39 @@ Monitoring API to retrieve API data.
66
`create_custom_metric.js` demonstrates how to create a custom metric, write a timeseries value to it,
77
and read it back.
88

9-
109
# Run locally
1110

1211
Create local credentials by running the following command and following the oauth2 flow:
1312

1413
gcloud beta auth application-default login
1514

16-
Then to run:
15+
Then to run:
1716

1817
npm install
1918
node list_resources.js <YOUR-PROJECT-ID>
2019
node create_custom_metric.js <YOUR-PROJECT-ID>
2120

22-
2321
## Running on GCE, GAE, or other environments
2422

2523
On Google App Engine, the credentials should be found automatically.
2624

2725
On Google Compute Engine, the credentials should be found automatically, but require that
28-
you create the instance with the correct scopes.
26+
you create the instance with the correct scopes.
2927

3028
gcloud compute instances create --scopes="https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/compute.readonly" test-instance
3129

32-
If you did not create the instance with the right scopes, you can still upload a JSON service
30+
If you did not create the instance with the right scopes, you can still upload a JSON service
3331
account and set GOOGLE_APPLICATION_CREDENTIALS as described below.
3432

35-
3633
## Using a Service Account
3734

3835
In non-Google Cloud environments, GCE instances created without the correct scopes, or local
39-
workstations if the `gcloud beta auth application-default login` command fails, use a Service
36+
workstations if the `gcloud beta auth application-default login` command fails, use a Service
4037
Account by doing the following:
4138

4239
* Go to API Manager -> Credentials
43-
* Click 'New Credentials', and create a Service Account or [click here](https://console.cloud.google
44-
.com/project/_/apiui/credential/serviceaccount)
45-
Download the JSON for this service account, and set the `GOOGLE_APPLICATION_CREDENTIALS`
46-
environment variable to point to the file containing the JSON credentials.
47-
40+
* Click 'New Credentials', and create a Service Account or [click here](https://console.cloud.google.com/project/_/apiui/credential/serviceaccount)
41+
* Download the JSON for this service account, and set the `GOOGLE_APPLICATION_CREDENTIALS`
42+
environment variable to point to the file containing the JSON credentials.
4843

4944
export GOOGLE_APPLICATION_CREDENTIALS=~/Downloads/<project-id>-0123456789abcdef.json
50-
51-
52-

0 commit comments

Comments
 (0)