Sha256: a1c4db537b82bb7dfe439445d1ae8a7eb4c8dff5980b728b1ed7986cd55b651d

Contents?: true

Size: 1.17 KB

Versions: 6

Compression:

Stored size: 1.17 KB

Contents

# Timeseries cross product query returns "OK" response

require "datadog_api_client"
DatadogAPIClient.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: 1636625471000,
      interval: 5000,
      queries: [
        DatadogAPIClient::V2::MetricsTimeseriesQuery.new({
          data_source: DatadogAPIClient::V2::MetricsDataSource::METRICS,
          query: "avg:datadog.estimated_usage.metrics.custom{*}",
          name: "a",
        }),
      ],
      to: 1636629071000,
    }),
    type: DatadogAPIClient::V2::TimeseriesFormulaRequestType::TIMESERIES_REQUEST,
  }),
})
p api_instance.query_timeseries_data(body)

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
datadog_api_client-2.27.1 examples/v2/metrics/QueryTimeseriesData_301142940.rb
datadog_api_client-2.26.1 examples/v2/metrics/QueryTimeseriesData_301142940.rb
datadog_api_client-2.26.0 examples/v2/metrics/QueryTimeseriesData_301142940.rb
datadog_api_client-2.25.0 examples/v2/metrics/QueryTimeseriesData_301142940.rb
datadog_api_client-2.24.0 examples/v2/metrics/QueryTimeseriesData_301142940.rb
datadog_api_client-2.22.0 examples/v2/metrics/QueryTimeseriesData_301142940.rb