{
  "GlobalSettings": {
    "type": "dynamic",
    "separator": "_"
  },
  "vectors": [
    {
      "URL": "$BaseURL/timeSeries?aggregation.crossSeriesReducer=REDUCE_SUM&filter=metric.type=\"serviceruntime.googleapis.com/api/request_count\"&aggregation.perSeriesAligner=ALIGN_RATE&interval.startTime={$start_time}&interval.endTime={$end_time}&aggregation.alignmentPeriod=180s&aggregation.groupByFields=resource.label.\"project_id\"&aggregation.groupByFields=resource.label.\"location\"&aggregation.groupByFields=resource.label.\"service\"&aggregation.groupByFields=metric.label.\"protocol\"",
      "URLSetting": {
        "requestType": "get"
      },
      "path": [
        {
          "isPartOfHierarchy": true,
          "query": "$.timeSeries[*].resource.labels.project_id"
        },
        {
          "isPartOfHierarchy": true,
          "query": "$.timeSeries[*].resource.labels.location",
          "replaceVectorKey": "locationKey"
        },
        {
          "isPartOfHierarchy": true,
          "query": "$.timeSeries[*].resource.labels[?(@.location == 'locationKey')].service",
          "replaceVectorKey": "serviceKey"
        },
	{
          "isPartOfHierarchy": true,
          "query": "$.timeSeries[*].resource.labels[?(@.location == 'locationKey' && @.service == 'serviceKey')].metric.labels.protocol",
		  "replaceVectorKey": "protocolKey"
        }
      ],
      "metrics": [
        {
          "mPath": "$.timeSeries[*][?(@.resource.labels.location == 'locationKey' && @.resource.labels.service == 'serviceKey' && metric.labels.protocol == 'protocolKey')].points[0].value.",
          "operation": "none",
          "attribute": [
            {
              "operation": "none",
              "name": "doubleValue",
              "index": 1,
              "type": 1
            }
          ]
        }
      ]
    }
  ]
}
