Sha256: cdccdb90bd97d3b15919d287a8605f2f95a730bdaa5863fecd47c6d9e1155d2e

Contents?: true

Size: 1.16 KB

Versions: 12

Compression:

Stored size: 1.16 KB

Contents

# Scalar cross product query returns "OK" response

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

body = DatadogAPIClient::V2::ScalarFormulaQueryRequest.new({
  data: DatadogAPIClient::V2::ScalarFormulaRequest.new({
    attributes: DatadogAPIClient::V2::ScalarFormulaRequestAttributes.new({
      formulas: [
        DatadogAPIClient::V2::QueryFormula.new({
          formula: "a",
          limit: DatadogAPIClient::V2::FormulaLimit.new({
            count: 10,
            order: DatadogAPIClient::V2::QuerySortOrder::DESC,
          }),
        }),
      ],
      from: 1671612804000,
      queries: [
        DatadogAPIClient::V2::MetricsScalarQuery.new({
          aggregator: DatadogAPIClient::V2::MetricsAggregator::AVG,
          data_source: DatadogAPIClient::V2::MetricsDataSource::METRICS,
          query: "avg:system.cpu.user{*}",
          name: "a",
        }),
      ],
      to: 1671620004000,
    }),
    type: DatadogAPIClient::V2::ScalarFormulaRequestType::SCALAR_REQUEST,
  }),
})
p api_instance.query_scalar_data(body)

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
datadog_api_client-2.21.0 examples/v2/metrics/QueryScalarData_3112571352.rb
datadog_api_client-2.20.0 examples/v2/metrics/QueryScalarData_3112571352.rb
datadog_api_client-2.19.0 examples/v2/metrics/QueryScalarData_3112571352.rb
datadog_api_client-2.18.0 examples/v2/metrics/QueryScalarData_3112571352.rb
datadog_api_client-2.17.0 examples/v2/metrics/QueryScalarData_3112571352.rb
datadog_api_client-2.16.0 examples/v2/metrics/QueryScalarData_3112571352.rb
datadog_api_client-2.15.0 examples/v2/metrics/QueryScalarData_3112571352.rb
datadog_api_client-2.14.0 examples/v2/metrics/QueryScalarData_3112571352.rb
datadog_api_client-2.13.0 examples/v2/metrics/QueryScalarData_3112571352.rb
datadog_api_client-2.12.0 examples/v2/metrics/QueryScalarData_3112571352.rb
datadog_api_client-2.11.0 examples/v2/metrics/QueryScalarData_3112571352.rb
datadog_api_client-2.10.0 examples/v2/metrics/QueryScalarData_3112571352.rb