| /* |
| To each 'filter' two AND clauses will be appended |
| that restricts the results to a one minute window. |
| |
| To develop a query visit |
| |
| https://cloud.google.com/logging/docs/api/ref_v2beta1/rest/v2beta1/entries/list |
| |
| And use the APIs explorer at the end of the page to build |
| the query. You will also need to reference the structure |
| of LogEntry, which is how the data is stored: |
| |
| https://cloud.google.com/logging/docs/api/ref_v2beta1/rest/v2beta1/LogEntry |
| |
| While you can use the Google Logging UI to explore logs |
| and build queries, realize that as of today the UI builds |
| V1 queries, which don't work with the V2 API. |
| */ |
| { |
| metrics: [ |
| { |
| // The total rate of requests hitting skfe-1 and skfe-2. |
| name: "qps", |
| filter: "\ |
| resource.type=\"gce_instance\"\n\ |
| AND (\n\ |
| labels.\"compute.googleapis.com/resource_name\"=\"skia-skfe-1\"\n\ |
| OR labels.\"compute.googleapis.com/resource_name\"=\"skia-skfe-2\"\n\ |
| )\n\ |
| " |
| }, |
| |
| { |
| // The total rate of requests to fiddle that end up in a container |
| // violation. |
| name: "fiddle-sec-violations", |
| filter: "\ |
| resource.type=\"gce_instance\"\n\ |
| AND labels.\"compute.googleapis.com/resource_name\"=\"skia-fiddle\"\n\ |
| AND textPayload:\"Attempted Security Container Violation\"\n\ |
| " |
| } |
| ] |
| } |