{ "gcp": { "urls": [{ "xml_ns": "", "src": "", "var": "", "id": "projects", "url": "https://cloudresourcemanager.googleapis.com/v1/projects" }, { "xml_ns": "", "src": "projects", "var": "#(function() {var urls = [];var datetime = new Date();var endtime = datetime.toISOString();datetime.setSeconds(datetime.getSeconds() - 180);var starttime = datetime.toISOString();for (var i = 0; i < root.projects.length; i++){urls.push(\"/v3/projects/\" + root.projects[i].projectId + \"/timeSeries?filter=metric.type=\\\"compute.googleapis.com/instance/cpu/utilization\\\"&interval.endTime=\" + endtime + \"&interval.startTime=\" + starttime);}return urls;}) ();", "id": "instancecpuutilization", "url": "%var" }], "definition": { "resource_category": null, "defaults": { "checkcert": "yes", "port": 4443, "interval": 60, "httptimeout": 30000 }, "addedProfileFields": [{ "name": "authority", "value": "https://accounts.google.com/o/oauth2/auth", "type": "text", "label": "Authority" }, { "name": "scope", "value": "https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloud-platform.read-only https://www.googleapis.com/auth/cloudplatformprojects https://www.googleapis.com/auth/cloudplatformprojects.readonly", "type": "text", "label": "Scope" }, { "name": "client_id", "value": "", "type": "text", "label": "Client ID" }, { "name": "client_secret", "value": "", "type": "password", "label": "Client Secret" }, { "name": "client_secret_id", "value": "", "type": "text", "label": "Client Sercret ID" }, { "name": "project_id", "value": "", "type": "text", "label": "Project ID" }], "auth": "none", "xml_ns": "", "name": "gcp", "type": "https" }, "metrics": [ { "calculation": "$value * 100", "xml_ns": "", "attributes": { "uim": { "defaultpublishing": "true", "qos_name": "QOS_GCP_COMPUTE_PRJ_ZONE_INSTANCE_CPU_UTILIZATION", "qos_desc": "Compute Project Zone Instance CPU Utilization", "qos_abbr": "%", "metric_type": "9.1.1:3", "qos_unit": "pct", "source": "%hostname", "target": "$['timeSeries'][*]['resource']['labels']['project_id']%//%$['timeSeries'][*]['resource']['labels']['zone']%//%$['timeSeries'][*]['metric']['labels']['instance_name']", "conversion": "" } }, "name": "Instance CPU Utilization (%)", "value": "$['timeSeries'][*]['points'][0]['value']['doubleValue']", "url": "instancecpuutilization", "group": "Instance Metrics" }], "calculated_metrics": [] } }