v1

latestOpenAPI 3.0.02026-08-064311,0881.3 MB
metricsQuery

Run metrics queries

Execute multiple metrics queries. Limits of this API are described in Metrics Query Error Messages. For general information about Metrics Queries see Metrics Queries.

post/v1/metricsQueries

Request body

Example request

{
  "queries": [
    {
      "rowId": "A",
      "query": "metric=CPU_Idle",
      "quantization": 60000,
      "rollup": "Avg",
      "timeshift": -3600000
    }
  ],
  "timeRange": {
    "type": "BeginBoundedTimeRange",
    "from": {
      "type": "RelativeTimeRangeBoundary",
      "relativeTime": "-15m"
    }
  }
}

Response

A set of time series grouped by the query.

Example response

{
  "queryResult": [
    {
      "rowId": "A",
      "timeSeriesList": {
        "timeSeries": [
          {
            "metricDefinition": {
              "metric": "CPU_Total",
              "dimensions": {
                "_sourceHost": "us2-alert-1",
                "_sourceCategory": "alert"
              }
            },
            "points": {
              "timestamps": [
                1623258710000
              ],
              "values": [
                1.5
              ]
            }
          }
        ],
        "unit": "1/second",
        "timeShiftLabel": "-1h",
        "resultContext": {
          "quantizationGranularity": 30000,
          "rollup": "Avg",
          "actualQueryTimeRange": {
            "start": "2018-10-16T09:10:00Z",
            "end": "2018-10-16T09:20:00Z"
          }
        }
      }
    }
  ],
  "errors": {
    "id": "IUUQI-DGH5I-TJ045",
    "errors": [
      {
        "code": "auth:password_too_short",
        "message": "Your password was too short."
      },
      {
        "code": "auth:password_character_classes",
        "message": "Your password did not contain any non-alphanumeric characters"
      }
    ]
  }
}