v1

latestOpenAPI 3.0.02026-07-141,4077,1665.2 MB
Metrics

Query scalar data across multiple products

Query scalar values (as seen on Query Value, Table, and Toplist widgets). Multiple data sources are supported with the ability to process the data using formulas and functions.

post/api/v2/query/scalar

Request body

Example request

{
  "data": {
    "attributes": {
      "formulas": [
        {
          "formula": "a+b",
          "limit": {
            "count": 10
          }
        }
      ],
      "from": 1568899800000,
      "queries": [
        {
          "aggregator": "avg",
          "data_source": "metrics",
          "query": "avg:system.cpu.user{*} by {env}"
        }
      ],
      "to": 1568923200000
    },
    "type": "scalar_request"
  }
}

Response

OK

errorsstring

An error generated when processing a request.

Example response

{
  "data": {
    "attributes": {
      "columns": [
        {
          "name": "env",
          "type": "group",
          "values": [
            [
              "production"
            ],
            [
              "staging"
            ]
          ]
        }
      ]
    },
    "type": "scalar_response"
  }
}