Skip to main content

timeseries_query

Creates, updates, deletes, gets or lists a timeseries_query resource.

Overview

Nametimeseries_query
TypeResource
Iddatadog.metrics.timeseries_query

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
display_namestringDisplay name of the metric. (example: system.cpu.idle)
aggrstringAggregation type. (example: avg)
endinteger (int64)End of the time window, milliseconds since Unix epoch.
expressionstringMetric expression. (example: system.cpu.idle{host:foo,env:test})
intervalinteger (int64)Number of milliseconds between data samples.
lengthinteger (int64)Number of data samples.
metricstringMetric name. (example: system.cpu.idle)
pointlistarrayList of points of the timeseries in milliseconds.
query_indexinteger (int64)The index of the series' query within the request.
scopestringMetric scope, comma separated list of tags. (example: host:foo,env:test)
startinteger (int64)Start of the time window, milliseconds since Unix epoch.
tag_setarrayUnique tags identifying this series.
unitarrayDetailed information about the metric unit. The first element describes the "primary unit" (for example, bytes in bytes per second). The second element describes the "per unit" (for example, second in bytes per second). If the second element is not present, the API returns null.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
query_metricsselectfrom, to, queryQuery timeseries points. Datadog recommends using the v2<br />/api/v2/query/timeseries endpoint over this endpoint for<br />querying timeseries data.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
frominteger (int64)Start of the queried time period, seconds since the Unix epoch.
querystringQuery string.
sitestringThe Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both.
tointeger (int64)End of the queried time period, seconds since the Unix epoch.

SELECT examples

Query timeseries points. Datadog recommends using the v2<br />/api/v2/query/timeseries endpoint over this endpoint for<br />querying timeseries data.

SELECT
display_name,
aggr,
end,
expression,
interval,
length,
metric,
pointlist,
query_index,
scope,
start,
tag_set,
unit
FROM datadog.metrics.timeseries_query
WHERE from = '{{ from }}' -- required
AND to = '{{ to }}' -- required
AND query = '{{ query }}' -- required
;