Sha256: f1c7e99608b19843b88c0ca94ffcaa0aeee3a66f0f650c4d0fbfdaccb3559a69

Contents?: true

Size: 1.15 KB

Versions: 4

Compression:

Stored size: 1.15 KB

Contents

# Timeseries cross product query returns "OK" response

require "datadog_api_client"
DatadogAPIClient::V2.configure do |config|
  config.unstable_operations["v2.query_timeseries_data".to_sym] = true
end
api_instance = DatadogAPIClient::V2::MetricsAPI.new

body = DatadogAPIClient::V2::TimeseriesFormulaQueryRequest.new({
  data: DatadogAPIClient::V2::TimeseriesFormulaRequest.new({
    attributes: DatadogAPIClient::V2::TimeseriesFormulaRequestAttributes.new({
      formulas: [
        DatadogAPIClient::V2::QueryFormula.new({
          formula: "a",
          limit: DatadogAPIClient::V2::FormulaLimit.new({
            count: 10,
            order: DatadogAPIClient::V2::QuerySortOrder::DESC,
          }),
        }),
      ],
      from: 1671612804000,
      interval: 5000,
      queries: [
        DatadogAPIClient::V2::MetricsTimeseriesQuery.new({
          data_source: DatadogAPIClient::V2::MetricsDataSource::METRICS,
          query: "avg:system.cpu.user{*}",
          name: "a",
        }),
      ],
      to: 1671620004000,
    }),
    type: DatadogAPIClient::V2::TimeseriesFormulaRequestType::TIMESERIES_REQUEST,
  }),
})
p api_instance.query_timeseries_data(body)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
datadog_api_client-2.9.0 examples/v2/metrics/QueryTimeseriesData_301142940.rb
datadog_api_client-2.8.0 examples/v2/metrics/QueryTimeseriesData_301142940.rb
datadog_api_client-2.7.0 examples/v2/metrics/QueryTimeseriesData_301142940.rb
datadog_api_client-2.6.0 examples/v2/metrics/QueryTimeseriesData.rb