Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50581,6 +50581,69 @@ components:
type: string
x-enum-varnames:
- RULESET
RumCrossProductSampling:
description: 'Configuration for additional APM trace data retention for sessions
that match this retention filter.

When a session matches the filter and is retained (based on `sample_rate`),
you can configure

the percentage of retained sessions with ingested traces whose traces are
indexed.'
properties:
trace_enabled:
description: Indicates whether trace cross-product sampling is enabled.
If `false`, no traces are indexed regardless of `trace_sample_rate`.
example: true
type: boolean
trace_sample_rate:
description: 'The percentage (0-100) of retained sessions with ingested
traces whose traces are indexed.

For example, 25.0 means 25% of retained sessions with ingested traces
have their traces indexed.'
example: 25.0
format: double
maximum: 100
minimum: 0
type: number
type: object
RumCrossProductSamplingCreate:
description: Configuration for cross-product sampling when creating a retention
filter.
properties:
trace_enabled:
description: Indicates whether trace cross-product sampling is enabled.
example: true
type: boolean
trace_sample_rate:
description: The percentage (0-100) of retained sessions with ingested traces
whose traces are indexed.
example: 25.0
format: double
maximum: 100
minimum: 0
type: number
required:
- trace_sample_rate
type: object
RumCrossProductSamplingUpdate:
description: Configuration for cross-product sampling when updating a retention
filter. All fields are optional for partial updates.
properties:
trace_enabled:
description: Indicates whether trace cross-product sampling is enabled.
example: true
type: boolean
trace_sample_rate:
description: The percentage (0-100) of retained sessions with ingested traces
whose traces are indexed.
example: 25.0
format: double
maximum: 100
minimum: 0
type: number
type: object
RumMetricCompute:
description: The compute rule to compute the rum-based metric.
properties:
Expand Down Expand Up @@ -50868,6 +50931,8 @@ components:
RumRetentionFilterAttributes:
description: The object describing attributes of a RUM retention filter.
properties:
cross_product_sampling:
$ref: '#/components/schemas/RumCrossProductSampling'
enabled:
$ref: '#/components/schemas/RumRetentionFilterEnabled'
event_type:
Expand All @@ -50882,6 +50947,8 @@ components:
RumRetentionFilterCreateAttributes:
description: The object describing attributes of a RUM retention filter to create.
properties:
cross_product_sampling:
$ref: '#/components/schemas/RumCrossProductSamplingCreate'
enabled:
$ref: '#/components/schemas/RumRetentionFilterEnabled'
event_type:
Expand Down Expand Up @@ -50983,6 +51050,8 @@ components:
RumRetentionFilterUpdateAttributes:
description: The object describing attributes of a RUM retention filter to update.
properties:
cross_product_sampling:
$ref: '#/components/schemas/RumCrossProductSamplingUpdate'
enabled:
$ref: '#/components/schemas/RumRetentionFilterEnabled'
event_type:
Expand Down
3 changes: 3 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4122,6 +4122,9 @@ def overrides
"v2.rum_bucket_response" => "RUMBucketResponse",
"v2.rum_compute" => "RUMCompute",
"v2.rum_compute_type" => "RUMComputeType",
"v2.rum_cross_product_sampling" => "RumCrossProductSampling",
"v2.rum_cross_product_sampling_create" => "RumCrossProductSamplingCreate",
"v2.rum_cross_product_sampling_update" => "RumCrossProductSamplingUpdate",
"v2.rum_event" => "RUMEvent",
"v2.rum_event_attributes" => "RUMEventAttributes",
"v2.rum_event_processing_scale" => "RUMEventProcessingScale",
Expand Down
140 changes: 140 additions & 0 deletions lib/datadog_api_client/v2/models/rum_cross_product_sampling.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
=begin
#Datadog API V2 Collection

#Collection of all Datadog Public endpoints.

The version of the OpenAPI document: 1.0
Contact: support@datadoghq.com
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator

Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
This product includes software developed at Datadog (https://www.datadoghq.com/).
Copyright 2020-Present Datadog, Inc.

=end

require 'date'
require 'time'

module DatadogAPIClient::V2
# Configuration for additional APM trace data retention for sessions that match this retention filter.
# When a session matches the filter and is retained (based on `sample_rate`), you can configure
# the percentage of retained sessions with ingested traces whose traces are indexed.
class RumCrossProductSampling
include BaseGenericModel

# Indicates whether trace cross-product sampling is enabled. If `false`, no traces are indexed regardless of `trace_sample_rate`.
attr_accessor :trace_enabled

# The percentage (0-100) of retained sessions with ingested traces whose traces are indexed.
# For example, 25.0 means 25% of retained sessions with ingested traces have their traces indexed.
attr_reader :trace_sample_rate

attr_accessor :additional_properties

# Attribute mapping from ruby-style variable name to JSON key.
# @!visibility private
def self.attribute_map
{
:'trace_enabled' => :'trace_enabled',
:'trace_sample_rate' => :'trace_sample_rate'
}
end

# Attribute type mapping.
# @!visibility private
def self.openapi_types
{
:'trace_enabled' => :'Boolean',
:'trace_sample_rate' => :'Float'
}
end

# Initializes the object
# @param attributes [Hash] Model attributes in the form of hash
# @!visibility private
def initialize(attributes = {})
if (!attributes.is_a?(Hash))
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RumCrossProductSampling` initialize method"
end

self.additional_properties = {}
# check to see if the attribute exists and convert string to symbol for hash key
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
self.additional_properties[k.to_sym] = v
else
h[k.to_sym] = v
end
}

if attributes.key?(:'trace_enabled')
self.trace_enabled = attributes[:'trace_enabled']
end

if attributes.key?(:'trace_sample_rate')
self.trace_sample_rate = attributes[:'trace_sample_rate']
end
end

# Check to see if the all the properties in the model are valid
# @return true if the model is valid
# @!visibility private
def valid?
return false if !@trace_sample_rate.nil? && @trace_sample_rate > 100
return false if !@trace_sample_rate.nil? && @trace_sample_rate < 0
true
end

# Custom attribute writer method with validation
# @param trace_sample_rate [Object] Object to be assigned
# @!visibility private
def trace_sample_rate=(trace_sample_rate)
if !trace_sample_rate.nil? && trace_sample_rate > 100
fail ArgumentError, 'invalid value for "trace_sample_rate", must be smaller than or equal to 100.'
end
if !trace_sample_rate.nil? && trace_sample_rate < 0
fail ArgumentError, 'invalid value for "trace_sample_rate", must be greater than or equal to 0.'
end
@trace_sample_rate = trace_sample_rate
end

# Returns the object in the form of hash, with additionalProperties support.
# @return [Hash] Returns the object in the form of hash
# @!visibility private
def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
if value.nil?
is_nullable = self.class.openapi_nullable.include?(attr)
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
end

hash[param] = _to_hash(value)
end
self.additional_properties.each_pair do |attr, value|
hash[attr] = value
end
hash
end

# Checks equality by comparing each attribute.
# @param o [Object] Object to be compared
# @!visibility private
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
trace_enabled == o.trace_enabled &&
trace_sample_rate == o.trace_sample_rate &&
additional_properties == o.additional_properties
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[trace_enabled, trace_sample_rate, additional_properties].hash
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
=begin
#Datadog API V2 Collection

#Collection of all Datadog Public endpoints.

The version of the OpenAPI document: 1.0
Contact: support@datadoghq.com
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator

Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
This product includes software developed at Datadog (https://www.datadoghq.com/).
Copyright 2020-Present Datadog, Inc.

=end

require 'date'
require 'time'

module DatadogAPIClient::V2
# Configuration for cross-product sampling when creating a retention filter.
class RumCrossProductSamplingCreate
include BaseGenericModel

# Indicates whether trace cross-product sampling is enabled.
attr_accessor :trace_enabled

# The percentage (0-100) of retained sessions with ingested traces whose traces are indexed.
attr_reader :trace_sample_rate

attr_accessor :additional_properties

# Attribute mapping from ruby-style variable name to JSON key.
# @!visibility private
def self.attribute_map
{
:'trace_enabled' => :'trace_enabled',
:'trace_sample_rate' => :'trace_sample_rate'
}
end

# Attribute type mapping.
# @!visibility private
def self.openapi_types
{
:'trace_enabled' => :'Boolean',
:'trace_sample_rate' => :'Float'
}
end

# Initializes the object
# @param attributes [Hash] Model attributes in the form of hash
# @!visibility private
def initialize(attributes = {})
if (!attributes.is_a?(Hash))
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RumCrossProductSamplingCreate` initialize method"
end

self.additional_properties = {}
# check to see if the attribute exists and convert string to symbol for hash key
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
self.additional_properties[k.to_sym] = v
else
h[k.to_sym] = v
end
}

if attributes.key?(:'trace_enabled')
self.trace_enabled = attributes[:'trace_enabled']
end

if attributes.key?(:'trace_sample_rate')
self.trace_sample_rate = attributes[:'trace_sample_rate']
end
end

# Check to see if the all the properties in the model are valid
# @return true if the model is valid
# @!visibility private
def valid?
return false if @trace_sample_rate.nil?
return false if @trace_sample_rate > 100
return false if @trace_sample_rate < 0
true
end

# Custom attribute writer method with validation
# @param trace_sample_rate [Object] Object to be assigned
# @!visibility private
def trace_sample_rate=(trace_sample_rate)
if trace_sample_rate.nil?
fail ArgumentError, 'invalid value for "trace_sample_rate", trace_sample_rate cannot be nil.'
end
if trace_sample_rate > 100
fail ArgumentError, 'invalid value for "trace_sample_rate", must be smaller than or equal to 100.'
end
if trace_sample_rate < 0
fail ArgumentError, 'invalid value for "trace_sample_rate", must be greater than or equal to 0.'
end
@trace_sample_rate = trace_sample_rate
end

# Returns the object in the form of hash, with additionalProperties support.
# @return [Hash] Returns the object in the form of hash
# @!visibility private
def to_hash
hash = {}
self.class.attribute_map.each_pair do |attr, param|
value = self.send(attr)
if value.nil?
is_nullable = self.class.openapi_nullable.include?(attr)
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
end

hash[param] = _to_hash(value)
end
self.additional_properties.each_pair do |attr, value|
hash[attr] = value
end
hash
end

# Checks equality by comparing each attribute.
# @param o [Object] Object to be compared
# @!visibility private
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
trace_enabled == o.trace_enabled &&
trace_sample_rate == o.trace_sample_rate &&
additional_properties == o.additional_properties
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[trace_enabled, trace_sample_rate, additional_properties].hash
end
end
end
Loading
Loading