Metrics

Query timeseries data across multiple products

Query timeseries data across various data sources and process the data by applying formulas and functions.

post/api/v2/query/timeseries

Request

  • Base URL
    https://api.datadoghq.com
  • URL
    https://api.datadoghq.com/api/v2/query/timeseries
  • Auth
    • API key in header DD-API-KEY and API key in header DD-APPLICATION-KEY
    • or OAuth 2
      Authorization code: /oauth2/v1/authorize
      Token URL: /oauth2/v1/token scopes: timeseries_query

Request body

Example request

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

Response

OK

errorsstring

The error generated by the request.

Example response

{
  "data": {
    "attributes": {
      "series": [
        {
          "group_tags": [
            "env:production"
          ],
          "unit": [
            {
              "family": "time",
              "name": "minute",
              "plural": "minutes",
              "scale_factor": 60,
              "short_name": "min"
            }
          ]
        }
      ],
      "times": [
        1568899800000
      ],
      "values": [
        [
          1575317847,
          0.5
        ]
      ]
    },
    "type": "timeseries_response"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.