This end point allows you to query for metrics from any time period.

k9_get_metrics(query = NULL, metric = NULL, scope = NULL, by = NULL,
  from = NULL, to = NULL, .split_request = TRUE)

Arguments

query

query string

metric

metric name

scope

list of scopes (scope)

by

key to group aggregation

from

seconds since the unix epoch

to

seconds since the unix epoch

.split_request

if TRUE, automatically split the request when the target period is longer than a day

Details

You can query either query, or the combination of metric, scope and by. For example, on the one hand you can directly query by using query = "system.cpu.idle{role:db,environment:test}by{host,region}". On the other hand, you can specify metric = "system.cpu.idle", scope = list(role = "db", environment = "test") and by = c("host", "region"), to build the same query.

Note that, if query is given, the latter will be ignored. from and by can be one of these:

  • numeric

  • POSIXct

  • POSIXlt

  • Date

  • character (parsed by anytime::anytime())

  • NULL (the current epochtime will be used instead)

See also

http://docs.datadoghq.com/api/?lang=console#metrics http://docs.datadoghq.com/graphing/