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
140 changes: 140 additions & 0 deletions api/datadogV2/model_rum_cross_product_sampling.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
// 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 2019-Present Datadog, Inc.

package datadogV2

import (
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)

// RumCrossProductSampling 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.
type RumCrossProductSampling struct {
// Indicates whether trace cross-product sampling is enabled. If `false`, no traces are indexed regardless of `trace_sample_rate`.
TraceEnabled *bool `json:"trace_enabled,omitempty"`
// 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.
TraceSampleRate *float64 `json:"trace_sample_rate,omitempty"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
UnparsedObject map[string]interface{} `json:"-"`
AdditionalProperties map[string]interface{} `json:"-"`
}

// NewRumCrossProductSampling instantiates a new RumCrossProductSampling object.
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed.
func NewRumCrossProductSampling() *RumCrossProductSampling {
this := RumCrossProductSampling{}
return &this
}

// NewRumCrossProductSamplingWithDefaults instantiates a new RumCrossProductSampling object.
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set.
func NewRumCrossProductSamplingWithDefaults() *RumCrossProductSampling {
this := RumCrossProductSampling{}
return &this
}

// GetTraceEnabled returns the TraceEnabled field value if set, zero value otherwise.
func (o *RumCrossProductSampling) GetTraceEnabled() bool {
if o == nil || o.TraceEnabled == nil {
var ret bool
return ret
}
return *o.TraceEnabled
}

// GetTraceEnabledOk returns a tuple with the TraceEnabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RumCrossProductSampling) GetTraceEnabledOk() (*bool, bool) {
if o == nil || o.TraceEnabled == nil {
return nil, false
}
return o.TraceEnabled, true
}

// HasTraceEnabled returns a boolean if a field has been set.
func (o *RumCrossProductSampling) HasTraceEnabled() bool {
return o != nil && o.TraceEnabled != nil
}

// SetTraceEnabled gets a reference to the given bool and assigns it to the TraceEnabled field.
func (o *RumCrossProductSampling) SetTraceEnabled(v bool) {
o.TraceEnabled = &v
}

// GetTraceSampleRate returns the TraceSampleRate field value if set, zero value otherwise.
func (o *RumCrossProductSampling) GetTraceSampleRate() float64 {
if o == nil || o.TraceSampleRate == nil {
var ret float64
return ret
}
return *o.TraceSampleRate
}

// GetTraceSampleRateOk returns a tuple with the TraceSampleRate field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RumCrossProductSampling) GetTraceSampleRateOk() (*float64, bool) {
if o == nil || o.TraceSampleRate == nil {
return nil, false
}
return o.TraceSampleRate, true
}

// HasTraceSampleRate returns a boolean if a field has been set.
func (o *RumCrossProductSampling) HasTraceSampleRate() bool {
return o != nil && o.TraceSampleRate != nil
}

// SetTraceSampleRate gets a reference to the given float64 and assigns it to the TraceSampleRate field.
func (o *RumCrossProductSampling) SetTraceSampleRate(v float64) {
o.TraceSampleRate = &v
}

// MarshalJSON serializes the struct using spec logic.
func (o RumCrossProductSampling) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
if o.TraceEnabled != nil {
toSerialize["trace_enabled"] = o.TraceEnabled
}
if o.TraceSampleRate != nil {
toSerialize["trace_sample_rate"] = o.TraceSampleRate
}

for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return datadog.Marshal(toSerialize)
}

// UnmarshalJSON deserializes the given payload.
func (o *RumCrossProductSampling) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
TraceEnabled *bool `json:"trace_enabled,omitempty"`
TraceSampleRate *float64 `json:"trace_sample_rate,omitempty"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"trace_enabled", "trace_sample_rate"})
} else {
return err
}
o.TraceEnabled = all.TraceEnabled
o.TraceSampleRate = all.TraceSampleRate

if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}

return nil
}
136 changes: 136 additions & 0 deletions api/datadogV2/model_rum_cross_product_sampling_create.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
// 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 2019-Present Datadog, Inc.

package datadogV2

import (
"fmt"

"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)

// RumCrossProductSamplingCreate Configuration for cross-product sampling when creating a retention filter.
type RumCrossProductSamplingCreate struct {
// Indicates whether trace cross-product sampling is enabled.
TraceEnabled *bool `json:"trace_enabled,omitempty"`
// The percentage (0-100) of retained sessions with ingested traces whose traces are indexed.
TraceSampleRate float64 `json:"trace_sample_rate"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
UnparsedObject map[string]interface{} `json:"-"`
AdditionalProperties map[string]interface{} `json:"-"`
}

// NewRumCrossProductSamplingCreate instantiates a new RumCrossProductSamplingCreate object.
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed.
func NewRumCrossProductSamplingCreate(traceSampleRate float64) *RumCrossProductSamplingCreate {
this := RumCrossProductSamplingCreate{}
this.TraceSampleRate = traceSampleRate
return &this
}

// NewRumCrossProductSamplingCreateWithDefaults instantiates a new RumCrossProductSamplingCreate object.
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set.
func NewRumCrossProductSamplingCreateWithDefaults() *RumCrossProductSamplingCreate {
this := RumCrossProductSamplingCreate{}
return &this
}

// GetTraceEnabled returns the TraceEnabled field value if set, zero value otherwise.
func (o *RumCrossProductSamplingCreate) GetTraceEnabled() bool {
if o == nil || o.TraceEnabled == nil {
var ret bool
return ret
}
return *o.TraceEnabled
}

// GetTraceEnabledOk returns a tuple with the TraceEnabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RumCrossProductSamplingCreate) GetTraceEnabledOk() (*bool, bool) {
if o == nil || o.TraceEnabled == nil {
return nil, false
}
return o.TraceEnabled, true
}

// HasTraceEnabled returns a boolean if a field has been set.
func (o *RumCrossProductSamplingCreate) HasTraceEnabled() bool {
return o != nil && o.TraceEnabled != nil
}

// SetTraceEnabled gets a reference to the given bool and assigns it to the TraceEnabled field.
func (o *RumCrossProductSamplingCreate) SetTraceEnabled(v bool) {
o.TraceEnabled = &v
}

// GetTraceSampleRate returns the TraceSampleRate field value.
func (o *RumCrossProductSamplingCreate) GetTraceSampleRate() float64 {
if o == nil {
var ret float64
return ret
}
return o.TraceSampleRate
}

// GetTraceSampleRateOk returns a tuple with the TraceSampleRate field value
// and a boolean to check if the value has been set.
func (o *RumCrossProductSamplingCreate) GetTraceSampleRateOk() (*float64, bool) {
if o == nil {
return nil, false
}
return &o.TraceSampleRate, true
}

// SetTraceSampleRate sets field value.
func (o *RumCrossProductSamplingCreate) SetTraceSampleRate(v float64) {
o.TraceSampleRate = v
}

// MarshalJSON serializes the struct using spec logic.
func (o RumCrossProductSamplingCreate) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
if o.TraceEnabled != nil {
toSerialize["trace_enabled"] = o.TraceEnabled
}
toSerialize["trace_sample_rate"] = o.TraceSampleRate

for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return datadog.Marshal(toSerialize)
}

// UnmarshalJSON deserializes the given payload.
func (o *RumCrossProductSamplingCreate) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
TraceEnabled *bool `json:"trace_enabled,omitempty"`
TraceSampleRate *float64 `json:"trace_sample_rate"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
if all.TraceSampleRate == nil {
return fmt.Errorf("required field trace_sample_rate missing")
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"trace_enabled", "trace_sample_rate"})
} else {
return err
}
o.TraceEnabled = all.TraceEnabled
o.TraceSampleRate = *all.TraceSampleRate

if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}

return nil
}
Loading