Sha256: 0e72d713b9a5d4ffddef31001c791defa82179253176e88ff1d73d815b925c6e

Contents?: true

Size: 781 Bytes

Versions: 13

Compression:

Stored size: 781 Bytes

Contents

# Create a retention filter returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::APMRetentionFiltersAPI.new

body = DatadogAPIClient::V2::RetentionFilterCreateRequest.new({
  data: DatadogAPIClient::V2::RetentionFilterCreateData.new({
    attributes: DatadogAPIClient::V2::RetentionFilterCreateAttributes.new({
      enabled: true,
      filter: DatadogAPIClient::V2::SpansFilterCreate.new({
        query: "@http.status_code:200 service:my-service",
      }),
      filter_type: DatadogAPIClient::V2::RetentionFilterType::SPANS_SAMPLING_PROCESSOR,
      name: "my retention filter",
      rate: 1.0,
    }),
    type: DatadogAPIClient::V2::ApmRetentionFilterType::APM_RETENTION_FILTER,
  }),
})
p api_instance.create_apm_retention_filter(body)

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
datadog_api_client-2.28.1 examples/v2/apm-retention-filters/CreateApmRetentionFilter.rb
datadog_api_client-2.27.1 examples/v2/apm-retention-filters/CreateApmRetentionFilter.rb
datadog_api_client-2.26.1 examples/v2/apm-retention-filters/CreateApmRetentionFilter.rb
datadog_api_client-2.26.0 examples/v2/apm-retention-filters/CreateApmRetentionFilter.rb
datadog_api_client-2.25.0 examples/v2/apm-retention-filters/CreateApmRetentionFilter.rb
datadog_api_client-2.24.0 examples/v2/apm-retention-filters/CreateApmRetentionFilter.rb
datadog_api_client-2.22.0 examples/v2/apm-retention-filters/CreateApmRetentionFilter.rb
datadog_api_client-2.21.0 examples/v2/apm-retention-filters/CreateApmRetentionFilter.rb
datadog_api_client-2.20.0 examples/v2/apm-retention-filters/CreateApmRetentionFilter.rb
datadog_api_client-2.19.0 examples/v2/apm-retention-filters/CreateApmRetentionFilter.rb
datadog_api_client-2.18.0 examples/v2/apm-retention-filters/CreateApmRetentionFilter.rb
datadog_api_client-2.17.0 examples/v2/apm-retention-filters/CreateApmRetentionFilter.rb
datadog_api_client-2.16.0 examples/v2/apm-retention-filters/CreateApmRetentionFilter.rb