| OLD | NEW |
| 1 # Setting up timeseries monitoring on App Engine. | 1 # Setting up timeseries monitoring on App Engine. |
| 2 | 2 |
| 3 1. Symlink this directory into your appengine app. | 3 1. Symlink this directory into your appengine app. |
| 4 | 4 |
| 5 cd infra/appengine/myapp | 5 cd infra/appengine/myapp |
| 6 ln -s ../../appengine_module/gae_ts_mon . | 6 ln -s ../../appengine_module/gae_ts_mon . |
| 7 | 7 |
| 8 1. Add the scheduled task to your `cron.yaml` file. Create it if you don't | 8 1. Add the scheduled task to your `cron.yaml` file. Create it if you don't |
| 9 have one already. | 9 have one already. |
| 10 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 @endpoints.method(...) | 52 @endpoints.method(...) |
| 53 def your_method(self, request): | 53 def your_method(self, request): |
| 54 ... | 54 ... |
| 55 | 55 |
| 56 1. Give your app's service account permission to send metrics to the API. | 56 1. Give your app's service account permission to send metrics to the API. |
| 57 You need the email address of your app's "App Engine default service | 57 You need the email address of your app's "App Engine default service |
| 58 account" from the `IAM & Admin` page in the cloud console. It'll look | 58 account" from the `IAM & Admin` page in the cloud console. It'll look |
| 59 something like `app-id@appspot.gserviceaccount.com`. | 59 something like `app-id@appspot.gserviceaccount.com`. |
| 60 Add it as a "Service Account Actor" of the "App Engine Metric Publishers" | 60 Add it as a "Service Account Actor" of the "App Engine Metric Publishers" |
| 61 service account in the | 61 service account in the |
| 62 (google.com:prodx-mon-chrome-infra project)[https://console.developers.googl
e.com/iam-admin/serviceaccounts/project?project=google.com:prodx-mon-chrome-infr
a&organizationId=433637338589] | 62 [google.com:prodx-mon-chrome-infra project](https://console.developers.googl
e.com/iam-admin/serviceaccounts/project?project=google.com:prodx-mon-chrome-infr
a&organizationId=433637338589) |
| 63 by selecting it from the list and clicking "Permissions". | 63 by selecting it from the list and clicking "Permissions". |
| 64 If you see an error "You do not have viewing permissions for the selected | 64 If you see an error "You do not have viewing permissions for the selected |
| 65 resource.", then please ask the current chrome-trooper to do it for you. | 65 resource.", then please ask the current chrome-trooper to do it for you. |
| 66 | 66 |
| 67 1. You also need to enable the Google Identity and Access Management (IAM) API | 67 1. You also need to enable the Google Identity and Access Management (IAM) API |
| 68 for your project if it's not enabled already. | 68 for your project if it's not enabled already. |
| 69 | 69 |
| 70 You're done! You can now use ts_mon metrics exactly as you normally would using | 70 You're done! You can now use ts_mon metrics exactly as you normally would using |
| 71 the infra_libs.ts_mon module. Here's a quick example, but see the | 71 the infra_libs.ts_mon module. Here's a quick example, but see the |
| 72 [timeseries monitoring docs](https://chrome-internal.googlesource.com/infra/infr
a_internal/+/master/doc/ts_mon.md) | 72 [timeseries monitoring docs](https://chrome-internal.googlesource.com/infra/infr
a_internal/+/master/doc/ts_mon.md) |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 only one instance will be running it at a time. A global metric is | 136 only one instance will be running it at a time. A global metric is |
| 137 then cleared the moment it is sent. Thus, global metrics will be sent | 137 then cleared the moment it is sent. Thus, global metrics will be sent |
| 138 at the correct intervals, regardless of the number of instances the | 138 at the correct intervals, regardless of the number of instances the |
| 139 app is currently running. | 139 app is currently running. |
| 140 | 140 |
| 141 Note also the use of `target_fields` parameter: it overrides the | 141 Note also the use of `target_fields` parameter: it overrides the |
| 142 default target fields which would otherwise distinguish the metric per | 142 default target fields which would otherwise distinguish the metric per |
| 143 module, version, or instance ID. Using `target_fields` in regular, | 143 module, version, or instance ID. Using `target_fields` in regular, |
| 144 "local" metrics is not allowed, as it would result in errors on the | 144 "local" metrics is not allowed, as it would result in errors on the |
| 145 monitoring endpoint, and loss of data. | 145 monitoring endpoint, and loss of data. |
| OLD | NEW |