diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index c554255f1343..b5268fe7d73a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -48499,6 +48499,118 @@ components: type: string x-enum-varnames: - ADD_HOSTNAME + ObservabilityPipelineAddMetricTagsProcessor: + description: |- + The `add_metric_tags` processor adds static tags to metrics. + + **Supported pipeline types:** metrics + properties: + display_name: + $ref: "#/components/schemas/ObservabilityPipelineComponentDisplayName" + enabled: + description: Indicates whether the processor is enabled. + example: true + type: boolean + id: + description: The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components). + example: "add-metric-tags-processor" + type: string + include: + description: A Datadog search query used to determine which metrics this processor targets. + example: "*" + type: string + tags: + description: A list of static tags (key-value pairs) added to each metric processed by this component. + items: + $ref: "#/components/schemas/ObservabilityPipelineFieldValue" + maxItems: 15 + type: array + type: + $ref: "#/components/schemas/ObservabilityPipelineAddMetricTagsProcessorType" + required: + - id + - type + - include + - tags + - enabled + type: object + x-pipeline-types: [metrics] + ObservabilityPipelineAddMetricTagsProcessorType: + default: add_metric_tags + description: The processor type. The value should always be `add_metric_tags`. + enum: [add_metric_tags] + example: add_metric_tags + type: string + x-enum-varnames: + - ADD_METRIC_TAGS + ObservabilityPipelineAggregateProcessor: + description: |- + The `aggregate` processor combines metrics that share the same name and tags into a single metric over a configurable interval. + + **Supported pipeline types:** metrics + properties: + display_name: + $ref: "#/components/schemas/ObservabilityPipelineComponentDisplayName" + enabled: + description: Indicates whether the processor is enabled. + example: true + type: boolean + id: + description: The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components). + example: "aggregate-processor" + type: string + include: + description: A Datadog search query used to determine which metrics this processor targets. + example: "*" + type: string + interval_secs: + description: The interval, in seconds, over which metrics are aggregated. + example: 10 + format: int64 + maximum: 60 + minimum: 1 + type: integer + mode: + $ref: "#/components/schemas/ObservabilityPipelineAggregateProcessorMode" + type: + $ref: "#/components/schemas/ObservabilityPipelineAggregateProcessorType" + required: + - id + - type + - include + - interval_secs + - mode + - enabled + type: object + x-pipeline-types: [metrics] + ObservabilityPipelineAggregateProcessorMode: + description: The aggregation mode applied to metrics that share the same name and tags within the interval. + enum: + - auto + - sum + - latest + - count + - max + - min + - mean + example: auto + type: string + x-enum-varnames: + - AUTO + - SUM + - LATEST + - COUNT + - MAX + - MIN + - MEAN + ObservabilityPipelineAggregateProcessorType: + default: aggregate + description: The processor type. The value should always be `aggregate`. + enum: [aggregate] + example: aggregate + type: string + x-enum-varnames: + - AGGREGATE ObservabilityPipelineAmazonDataFirehoseSource: description: |- The `amazon_data_firehose` source ingests logs from AWS Data Firehose. @@ -49210,7 +49322,11 @@ components: - $ref: "#/components/schemas/ObservabilityPipelineSensitiveDataScannerProcessor" - $ref: "#/components/schemas/ObservabilityPipelineSplitArrayProcessor" - $ref: "#/components/schemas/ObservabilityPipelineThrottleProcessor" + - $ref: "#/components/schemas/ObservabilityPipelineAddMetricTagsProcessor" + - $ref: "#/components/schemas/ObservabilityPipelineAggregateProcessor" - $ref: "#/components/schemas/ObservabilityPipelineMetricTagsProcessor" + - $ref: "#/components/schemas/ObservabilityPipelineRenameMetricTagsProcessor" + - $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessor" ObservabilityPipelineConfigSourceItem: description: "A data source for the pipeline." oneOf: @@ -52174,6 +52290,65 @@ components: type: string x-enum-varnames: - RENAME_FIELDS + ObservabilityPipelineRenameMetricTagsProcessor: + description: |- + The `rename_metric_tags` processor changes the keys of tags on metrics. + + **Supported pipeline types:** metrics + properties: + display_name: + $ref: "#/components/schemas/ObservabilityPipelineComponentDisplayName" + enabled: + description: Indicates whether the processor is enabled. + example: true + type: boolean + id: + description: The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components). + example: "rename-metric-tags-processor" + type: string + include: + description: A Datadog search query used to determine which metrics this processor targets. + example: "*" + type: string + tags: + description: A list of rename rules specifying which tag keys to rename on each metric. + items: + $ref: "#/components/schemas/ObservabilityPipelineRenameMetricTagsProcessorTag" + maxItems: 15 + type: array + type: + $ref: "#/components/schemas/ObservabilityPipelineRenameMetricTagsProcessorType" + required: + - id + - type + - include + - tags + - enabled + type: object + x-pipeline-types: [metrics] + ObservabilityPipelineRenameMetricTagsProcessorTag: + description: Defines how to rename a tag on metric events. + properties: + rename_to: + description: The new tag key to assign in place of the original. + example: "destination_tag" + type: string + tag: + description: The original tag key on the metric event. + example: "source_tag" + type: string + required: + - tag + - rename_to + type: object + ObservabilityPipelineRenameMetricTagsProcessorType: + default: rename_metric_tags + description: The processor type. The value should always be `rename_metric_tags`. + enum: [rename_metric_tags] + example: rename_metric_tags + type: string + x-enum-varnames: + - RENAME_METRIC_TAGS ObservabilityPipelineRsyslogDestination: description: |- The `rsyslog` destination forwards logs to an external `rsyslog` server over TCP or UDP using the syslog protocol. @@ -53365,6 +53540,141 @@ components: x-enum-varnames: - TCP - UDP + ObservabilityPipelineTagCardinalityLimitProcessor: + description: |- + The `tag_cardinality_limit` processor caps the number of distinct tag value combinations on metrics, dropping tags or events once the limit is exceeded. + + **Supported pipeline types:** metrics + properties: + display_name: + $ref: "#/components/schemas/ObservabilityPipelineComponentDisplayName" + enabled: + description: Indicates whether the processor is enabled. + example: true + type: boolean + id: + description: The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components). + example: "tag-cardinality-limit-processor" + type: string + include: + description: A Datadog search query used to determine which metrics this processor targets. + example: "*" + type: string + limit_exceeded_action: + $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorAction" + per_metric_limits: + description: A list of per-metric cardinality overrides that take precedence over the default `value_limit`. + items: + $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit" + maxItems: 100 + type: array + type: + $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorType" + value_limit: + description: The default maximum number of distinct tag value combinations allowed per metric. + example: 10000 + format: int64 + maximum: 1000000 + minimum: 0 + type: integer + required: + - id + - type + - include + - limit_exceeded_action + - value_limit + - enabled + type: object + x-pipeline-types: [metrics] + ObservabilityPipelineTagCardinalityLimitProcessorAction: + description: The action to take when the cardinality limit is exceeded. + enum: + - drop_tag + - drop_event + example: drop_tag + type: string + x-enum-varnames: + - DROP_TAG + - DROP_EVENT + ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit: + description: A cardinality override applied to a specific metric. + properties: + limit_exceeded_action: + $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorAction" + metric_name: + description: The name of the metric this override applies to. + example: "system.cpu.user" + type: string + mode: + $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode" + per_tag_limits: + description: A list of per-tag cardinality overrides that apply within this metric. + items: + $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit" + maxItems: 50 + type: array + value_limit: + description: The maximum number of distinct tag value combinations allowed for this metric. + example: 10000 + format: int64 + maximum: 1000000 + minimum: 0 + type: integer + required: + - metric_name + - mode + - limit_exceeded_action + - value_limit + type: object + ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode: + description: How the per-metric override is applied. `tracked` enforces a custom limit; `excluded` skips the metric entirely. + enum: + - tracked + - excluded + example: tracked + type: string + x-enum-varnames: + - TRACKED + - EXCLUDED + ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit: + description: A cardinality override for a specific tag key within a per-metric limit. + properties: + mode: + $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode" + tag_key: + description: The tag key this override applies to. + example: "host" + type: string + value_limit: + description: The maximum number of distinct values allowed for this tag. + example: 5000 + format: int64 + maximum: 1000000 + minimum: 0 + type: integer + required: + - tag_key + - mode + - value_limit + type: object + ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode: + description: How the per-tag override is applied. `limit_override` enforces a custom limit on the tag; `excluded` skips the tag from cardinality tracking. + enum: + - limit_override + - excluded + example: limit_override + type: string + x-enum-varnames: + - LIMIT_OVERRIDE + - EXCLUDED + ObservabilityPipelineTagCardinalityLimitProcessorType: + default: tag_cardinality_limit + description: The processor type. The value should always be `tag_cardinality_limit`. + enum: [tag_cardinality_limit] + example: tag_cardinality_limit + type: string + x-enum-varnames: + - TAG_CARDINALITY_LIMIT ObservabilityPipelineThrottleProcessor: description: |- The `throttle` processor limits the number of events that pass through over a given time window. diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 45d174b12c04..85ef6ab78982 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -4073,6 +4073,11 @@ def overrides "v2.observability_pipeline_add_fields_processor_type" => "ObservabilityPipelineAddFieldsProcessorType", "v2.observability_pipeline_add_hostname_processor" => "ObservabilityPipelineAddHostnameProcessor", "v2.observability_pipeline_add_hostname_processor_type" => "ObservabilityPipelineAddHostnameProcessorType", + "v2.observability_pipeline_add_metric_tags_processor" => "ObservabilityPipelineAddMetricTagsProcessor", + "v2.observability_pipeline_add_metric_tags_processor_type" => "ObservabilityPipelineAddMetricTagsProcessorType", + "v2.observability_pipeline_aggregate_processor" => "ObservabilityPipelineAggregateProcessor", + "v2.observability_pipeline_aggregate_processor_mode" => "ObservabilityPipelineAggregateProcessorMode", + "v2.observability_pipeline_aggregate_processor_type" => "ObservabilityPipelineAggregateProcessorType", "v2.observability_pipeline_amazon_data_firehose_source" => "ObservabilityPipelineAmazonDataFirehoseSource", "v2.observability_pipeline_amazon_data_firehose_source_type" => "ObservabilityPipelineAmazonDataFirehoseSourceType", "v2.observability_pipeline_amazon_open_search_destination" => "ObservabilityPipelineAmazonOpenSearchDestination", @@ -4269,6 +4274,9 @@ def overrides "v2.observability_pipeline_rename_fields_processor" => "ObservabilityPipelineRenameFieldsProcessor", "v2.observability_pipeline_rename_fields_processor_field" => "ObservabilityPipelineRenameFieldsProcessorField", "v2.observability_pipeline_rename_fields_processor_type" => "ObservabilityPipelineRenameFieldsProcessorType", + "v2.observability_pipeline_rename_metric_tags_processor" => "ObservabilityPipelineRenameMetricTagsProcessor", + "v2.observability_pipeline_rename_metric_tags_processor_tag" => "ObservabilityPipelineRenameMetricTagsProcessorTag", + "v2.observability_pipeline_rename_metric_tags_processor_type" => "ObservabilityPipelineRenameMetricTagsProcessorType", "v2.observability_pipeline_rsyslog_destination" => "ObservabilityPipelineRsyslogDestination", "v2.observability_pipeline_rsyslog_destination_type" => "ObservabilityPipelineRsyslogDestinationType", "v2.observability_pipeline_rsyslog_source" => "ObservabilityPipelineRsyslogSource", @@ -4356,6 +4364,13 @@ def overrides "v2.observability_pipeline_syslog_ng_source" => "ObservabilityPipelineSyslogNgSource", "v2.observability_pipeline_syslog_ng_source_type" => "ObservabilityPipelineSyslogNgSourceType", "v2.observability_pipeline_syslog_source_mode" => "ObservabilityPipelineSyslogSourceMode", + "v2.observability_pipeline_tag_cardinality_limit_processor" => "ObservabilityPipelineTagCardinalityLimitProcessor", + "v2.observability_pipeline_tag_cardinality_limit_processor_action" => "ObservabilityPipelineTagCardinalityLimitProcessorAction", + "v2.observability_pipeline_tag_cardinality_limit_processor_per_metric_limit" => "ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit", + "v2.observability_pipeline_tag_cardinality_limit_processor_per_metric_mode" => "ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode", + "v2.observability_pipeline_tag_cardinality_limit_processor_per_tag_limit" => "ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit", + "v2.observability_pipeline_tag_cardinality_limit_processor_per_tag_mode" => "ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode", + "v2.observability_pipeline_tag_cardinality_limit_processor_type" => "ObservabilityPipelineTagCardinalityLimitProcessorType", "v2.observability_pipeline_throttle_processor" => "ObservabilityPipelineThrottleProcessor", "v2.observability_pipeline_throttle_processor_type" => "ObservabilityPipelineThrottleProcessorType", "v2.observability_pipeline_tls" => "ObservabilityPipelineTls", diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_add_metric_tags_processor.rb b/lib/datadog_api_client/v2/models/observability_pipeline_add_metric_tags_processor.rb new file mode 100644 index 000000000000..f4e901821b84 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_add_metric_tags_processor.rb @@ -0,0 +1,225 @@ +=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 + # The `add_metric_tags` processor adds static tags to metrics. + # + # **Supported pipeline types:** metrics + class ObservabilityPipelineAddMetricTagsProcessor + include BaseGenericModel + + # The display name for a component. + attr_accessor :display_name + + # Indicates whether the processor is enabled. + attr_reader :enabled + + # The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components). + attr_reader :id + + # A Datadog search query used to determine which metrics this processor targets. + attr_reader :include + + # A list of static tags (key-value pairs) added to each metric processed by this component. + attr_reader :tags + + # The processor type. The value should always be `add_metric_tags`. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'display_name' => :'display_name', + :'enabled' => :'enabled', + :'id' => :'id', + :'include' => :'include', + :'tags' => :'tags', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'display_name' => :'String', + :'enabled' => :'Boolean', + :'id' => :'String', + :'include' => :'String', + :'tags' => :'Array', + :'type' => :'ObservabilityPipelineAddMetricTagsProcessorType' + } + 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::ObservabilityPipelineAddMetricTagsProcessor` 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?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'include') + self.include = attributes[:'include'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + 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 @enabled.nil? + return false if @id.nil? + return false if @include.nil? + return false if @tags.nil? + return false if @tags.length > 15 + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param enabled [Object] Object to be assigned + # @!visibility private + def enabled=(enabled) + if enabled.nil? + fail ArgumentError, 'invalid value for "enabled", enabled cannot be nil.' + end + @enabled = enabled + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param include [Object] Object to be assigned + # @!visibility private + def include=(include) + if include.nil? + fail ArgumentError, 'invalid value for "include", include cannot be nil.' + end + @include = include + end + + # Custom attribute writer method with validation + # @param tags [Object] Object to be assigned + # @!visibility private + def tags=(tags) + if tags.nil? + fail ArgumentError, 'invalid value for "tags", tags cannot be nil.' + end + if tags.length > 15 + fail ArgumentError, 'invalid value for "tags", number of items must be less than or equal to 15.' + end + @tags = tags + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + 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 && + display_name == o.display_name && + enabled == o.enabled && + id == o.id && + include == o.include && + tags == o.tags && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [display_name, enabled, id, include, tags, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_add_metric_tags_processor_type.rb b/lib/datadog_api_client/v2/models/observability_pipeline_add_metric_tags_processor_type.rb new file mode 100644 index 000000000000..648567d2b329 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_add_metric_tags_processor_type.rb @@ -0,0 +1,26 @@ +=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 + # The processor type. The value should always be `add_metric_tags`. + class ObservabilityPipelineAddMetricTagsProcessorType + include BaseEnumModel + + ADD_METRIC_TAGS = "add_metric_tags".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_aggregate_processor.rb b/lib/datadog_api_client/v2/models/observability_pipeline_aggregate_processor.rb new file mode 100644 index 000000000000..07be61b3dfb6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_aggregate_processor.rb @@ -0,0 +1,248 @@ +=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 + # The `aggregate` processor combines metrics that share the same name and tags into a single metric over a configurable interval. + # + # **Supported pipeline types:** metrics + class ObservabilityPipelineAggregateProcessor + include BaseGenericModel + + # The display name for a component. + attr_accessor :display_name + + # Indicates whether the processor is enabled. + attr_reader :enabled + + # The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components). + attr_reader :id + + # A Datadog search query used to determine which metrics this processor targets. + attr_reader :include + + # The interval, in seconds, over which metrics are aggregated. + attr_reader :interval_secs + + # The aggregation mode applied to metrics that share the same name and tags within the interval. + attr_reader :mode + + # The processor type. The value should always be `aggregate`. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'display_name' => :'display_name', + :'enabled' => :'enabled', + :'id' => :'id', + :'include' => :'include', + :'interval_secs' => :'interval_secs', + :'mode' => :'mode', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'display_name' => :'String', + :'enabled' => :'Boolean', + :'id' => :'String', + :'include' => :'String', + :'interval_secs' => :'Integer', + :'mode' => :'ObservabilityPipelineAggregateProcessorMode', + :'type' => :'ObservabilityPipelineAggregateProcessorType' + } + 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::ObservabilityPipelineAggregateProcessor` 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?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'include') + self.include = attributes[:'include'] + end + + if attributes.key?(:'interval_secs') + self.interval_secs = attributes[:'interval_secs'] + end + + if attributes.key?(:'mode') + self.mode = attributes[:'mode'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + 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 @enabled.nil? + return false if @id.nil? + return false if @include.nil? + return false if @interval_secs.nil? + return false if @interval_secs > 60 + return false if @interval_secs < 1 + return false if @mode.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param enabled [Object] Object to be assigned + # @!visibility private + def enabled=(enabled) + if enabled.nil? + fail ArgumentError, 'invalid value for "enabled", enabled cannot be nil.' + end + @enabled = enabled + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param include [Object] Object to be assigned + # @!visibility private + def include=(include) + if include.nil? + fail ArgumentError, 'invalid value for "include", include cannot be nil.' + end + @include = include + end + + # Custom attribute writer method with validation + # @param interval_secs [Object] Object to be assigned + # @!visibility private + def interval_secs=(interval_secs) + if interval_secs.nil? + fail ArgumentError, 'invalid value for "interval_secs", interval_secs cannot be nil.' + end + if interval_secs > 60 + fail ArgumentError, 'invalid value for "interval_secs", must be smaller than or equal to 60.' + end + if interval_secs < 1 + fail ArgumentError, 'invalid value for "interval_secs", must be greater than or equal to 1.' + end + @interval_secs = interval_secs + end + + # Custom attribute writer method with validation + # @param mode [Object] Object to be assigned + # @!visibility private + def mode=(mode) + if mode.nil? + fail ArgumentError, 'invalid value for "mode", mode cannot be nil.' + end + @mode = mode + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + 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 && + display_name == o.display_name && + enabled == o.enabled && + id == o.id && + include == o.include && + interval_secs == o.interval_secs && + mode == o.mode && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [display_name, enabled, id, include, interval_secs, mode, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_aggregate_processor_mode.rb b/lib/datadog_api_client/v2/models/observability_pipeline_aggregate_processor_mode.rb new file mode 100644 index 000000000000..e48067f12fd2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_aggregate_processor_mode.rb @@ -0,0 +1,32 @@ +=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 + # The aggregation mode applied to metrics that share the same name and tags within the interval. + class ObservabilityPipelineAggregateProcessorMode + include BaseEnumModel + + AUTO = "auto".freeze + SUM = "sum".freeze + LATEST = "latest".freeze + COUNT = "count".freeze + MAX = "max".freeze + MIN = "min".freeze + MEAN = "mean".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_aggregate_processor_type.rb b/lib/datadog_api_client/v2/models/observability_pipeline_aggregate_processor_type.rb new file mode 100644 index 000000000000..bc182b0d8373 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_aggregate_processor_type.rb @@ -0,0 +1,26 @@ +=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 + # The processor type. The value should always be `aggregate`. + class ObservabilityPipelineAggregateProcessorType + include BaseEnumModel + + AGGREGATE = "aggregate".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_config_processor_item.rb b/lib/datadog_api_client/v2/models/observability_pipeline_config_processor_item.rb index 9c6c290c3c53..402c3e6e483b 100644 --- a/lib/datadog_api_client/v2/models/observability_pipeline_config_processor_item.rb +++ b/lib/datadog_api_client/v2/models/observability_pipeline_config_processor_item.rb @@ -47,7 +47,11 @@ def openapi_one_of :'ObservabilityPipelineSensitiveDataScannerProcessor', :'ObservabilityPipelineSplitArrayProcessor', :'ObservabilityPipelineThrottleProcessor', - :'ObservabilityPipelineMetricTagsProcessor' + :'ObservabilityPipelineAddMetricTagsProcessor', + :'ObservabilityPipelineAggregateProcessor', + :'ObservabilityPipelineMetricTagsProcessor', + :'ObservabilityPipelineRenameMetricTagsProcessor', + :'ObservabilityPipelineTagCardinalityLimitProcessor' ] end # Builds the object diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_rename_metric_tags_processor.rb b/lib/datadog_api_client/v2/models/observability_pipeline_rename_metric_tags_processor.rb new file mode 100644 index 000000000000..535d76d02d31 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_rename_metric_tags_processor.rb @@ -0,0 +1,225 @@ +=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 + # The `rename_metric_tags` processor changes the keys of tags on metrics. + # + # **Supported pipeline types:** metrics + class ObservabilityPipelineRenameMetricTagsProcessor + include BaseGenericModel + + # The display name for a component. + attr_accessor :display_name + + # Indicates whether the processor is enabled. + attr_reader :enabled + + # The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components). + attr_reader :id + + # A Datadog search query used to determine which metrics this processor targets. + attr_reader :include + + # A list of rename rules specifying which tag keys to rename on each metric. + attr_reader :tags + + # The processor type. The value should always be `rename_metric_tags`. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'display_name' => :'display_name', + :'enabled' => :'enabled', + :'id' => :'id', + :'include' => :'include', + :'tags' => :'tags', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'display_name' => :'String', + :'enabled' => :'Boolean', + :'id' => :'String', + :'include' => :'String', + :'tags' => :'Array', + :'type' => :'ObservabilityPipelineRenameMetricTagsProcessorType' + } + 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::ObservabilityPipelineRenameMetricTagsProcessor` 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?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'include') + self.include = attributes[:'include'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + 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 @enabled.nil? + return false if @id.nil? + return false if @include.nil? + return false if @tags.nil? + return false if @tags.length > 15 + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param enabled [Object] Object to be assigned + # @!visibility private + def enabled=(enabled) + if enabled.nil? + fail ArgumentError, 'invalid value for "enabled", enabled cannot be nil.' + end + @enabled = enabled + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param include [Object] Object to be assigned + # @!visibility private + def include=(include) + if include.nil? + fail ArgumentError, 'invalid value for "include", include cannot be nil.' + end + @include = include + end + + # Custom attribute writer method with validation + # @param tags [Object] Object to be assigned + # @!visibility private + def tags=(tags) + if tags.nil? + fail ArgumentError, 'invalid value for "tags", tags cannot be nil.' + end + if tags.length > 15 + fail ArgumentError, 'invalid value for "tags", number of items must be less than or equal to 15.' + end + @tags = tags + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + 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 && + display_name == o.display_name && + enabled == o.enabled && + id == o.id && + include == o.include && + tags == o.tags && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [display_name, enabled, id, include, tags, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_rename_metric_tags_processor_tag.rb b/lib/datadog_api_client/v2/models/observability_pipeline_rename_metric_tags_processor_tag.rb new file mode 100644 index 000000000000..01e4f03e8a06 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_rename_metric_tags_processor_tag.rb @@ -0,0 +1,144 @@ +=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 + # Defines how to rename a tag on metric events. + class ObservabilityPipelineRenameMetricTagsProcessorTag + include BaseGenericModel + + # The new tag key to assign in place of the original. + attr_reader :rename_to + + # The original tag key on the metric event. + attr_reader :tag + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'rename_to' => :'rename_to', + :'tag' => :'tag' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'rename_to' => :'String', + :'tag' => :'String' + } + 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::ObservabilityPipelineRenameMetricTagsProcessorTag` 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?(:'rename_to') + self.rename_to = attributes[:'rename_to'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + 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 @rename_to.nil? + return false if @tag.nil? + true + end + + # Custom attribute writer method with validation + # @param rename_to [Object] Object to be assigned + # @!visibility private + def rename_to=(rename_to) + if rename_to.nil? + fail ArgumentError, 'invalid value for "rename_to", rename_to cannot be nil.' + end + @rename_to = rename_to + end + + # Custom attribute writer method with validation + # @param tag [Object] Object to be assigned + # @!visibility private + def tag=(tag) + if tag.nil? + fail ArgumentError, 'invalid value for "tag", tag cannot be nil.' + end + @tag = tag + 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 && + rename_to == o.rename_to && + tag == o.tag && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [rename_to, tag, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_rename_metric_tags_processor_type.rb b/lib/datadog_api_client/v2/models/observability_pipeline_rename_metric_tags_processor_type.rb new file mode 100644 index 000000000000..ec4395ea705f --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_rename_metric_tags_processor_type.rb @@ -0,0 +1,26 @@ +=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 + # The processor type. The value should always be `rename_metric_tags`. + class ObservabilityPipelineRenameMetricTagsProcessorType + include BaseEnumModel + + RENAME_METRIC_TAGS = "rename_metric_tags".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor.rb b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor.rb new file mode 100644 index 000000000000..8ef79c0df9c1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor.rb @@ -0,0 +1,271 @@ +=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 + # The `tag_cardinality_limit` processor caps the number of distinct tag value combinations on metrics, dropping tags or events once the limit is exceeded. + # + # **Supported pipeline types:** metrics + class ObservabilityPipelineTagCardinalityLimitProcessor + include BaseGenericModel + + # The display name for a component. + attr_accessor :display_name + + # Indicates whether the processor is enabled. + attr_reader :enabled + + # The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components). + attr_reader :id + + # A Datadog search query used to determine which metrics this processor targets. + attr_reader :include + + # The action to take when the cardinality limit is exceeded. + attr_reader :limit_exceeded_action + + # A list of per-metric cardinality overrides that take precedence over the default `value_limit`. + attr_reader :per_metric_limits + + # The processor type. The value should always be `tag_cardinality_limit`. + attr_reader :type + + # The default maximum number of distinct tag value combinations allowed per metric. + attr_reader :value_limit + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'display_name' => :'display_name', + :'enabled' => :'enabled', + :'id' => :'id', + :'include' => :'include', + :'limit_exceeded_action' => :'limit_exceeded_action', + :'per_metric_limits' => :'per_metric_limits', + :'type' => :'type', + :'value_limit' => :'value_limit' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'display_name' => :'String', + :'enabled' => :'Boolean', + :'id' => :'String', + :'include' => :'String', + :'limit_exceeded_action' => :'ObservabilityPipelineTagCardinalityLimitProcessorAction', + :'per_metric_limits' => :'Array', + :'type' => :'ObservabilityPipelineTagCardinalityLimitProcessorType', + :'value_limit' => :'Integer' + } + 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::ObservabilityPipelineTagCardinalityLimitProcessor` 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?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'include') + self.include = attributes[:'include'] + end + + if attributes.key?(:'limit_exceeded_action') + self.limit_exceeded_action = attributes[:'limit_exceeded_action'] + end + + if attributes.key?(:'per_metric_limits') + if (value = attributes[:'per_metric_limits']).is_a?(Array) + self.per_metric_limits = value + end + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'value_limit') + self.value_limit = attributes[:'value_limit'] + 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 @enabled.nil? + return false if @id.nil? + return false if @include.nil? + return false if @limit_exceeded_action.nil? + return false if !@per_metric_limits.nil? && @per_metric_limits.length > 100 + return false if @type.nil? + return false if @value_limit.nil? + return false if @value_limit > 1000000 + return false if @value_limit < 0 + true + end + + # Custom attribute writer method with validation + # @param enabled [Object] Object to be assigned + # @!visibility private + def enabled=(enabled) + if enabled.nil? + fail ArgumentError, 'invalid value for "enabled", enabled cannot be nil.' + end + @enabled = enabled + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param include [Object] Object to be assigned + # @!visibility private + def include=(include) + if include.nil? + fail ArgumentError, 'invalid value for "include", include cannot be nil.' + end + @include = include + end + + # Custom attribute writer method with validation + # @param limit_exceeded_action [Object] Object to be assigned + # @!visibility private + def limit_exceeded_action=(limit_exceeded_action) + if limit_exceeded_action.nil? + fail ArgumentError, 'invalid value for "limit_exceeded_action", limit_exceeded_action cannot be nil.' + end + @limit_exceeded_action = limit_exceeded_action + end + + # Custom attribute writer method with validation + # @param per_metric_limits [Object] Object to be assigned + # @!visibility private + def per_metric_limits=(per_metric_limits) + if !per_metric_limits.nil? && per_metric_limits.length > 100 + fail ArgumentError, 'invalid value for "per_metric_limits", number of items must be less than or equal to 100.' + end + @per_metric_limits = per_metric_limits + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Custom attribute writer method with validation + # @param value_limit [Object] Object to be assigned + # @!visibility private + def value_limit=(value_limit) + if value_limit.nil? + fail ArgumentError, 'invalid value for "value_limit", value_limit cannot be nil.' + end + if value_limit > 1000000 + fail ArgumentError, 'invalid value for "value_limit", must be smaller than or equal to 1000000.' + end + if value_limit < 0 + fail ArgumentError, 'invalid value for "value_limit", must be greater than or equal to 0.' + end + @value_limit = value_limit + 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 && + display_name == o.display_name && + enabled == o.enabled && + id == o.id && + include == o.include && + limit_exceeded_action == o.limit_exceeded_action && + per_metric_limits == o.per_metric_limits && + type == o.type && + value_limit == o.value_limit && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [display_name, enabled, id, include, limit_exceeded_action, per_metric_limits, type, value_limit, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_action.rb b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_action.rb new file mode 100644 index 000000000000..ba243acf75a9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_action.rb @@ -0,0 +1,27 @@ +=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 + # The action to take when the cardinality limit is exceeded. + class ObservabilityPipelineTagCardinalityLimitProcessorAction + include BaseEnumModel + + DROP_TAG = "drop_tag".freeze + DROP_EVENT = "drop_event".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_metric_limit.rb b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_metric_limit.rb new file mode 100644 index 000000000000..ccb077af387d --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_metric_limit.rb @@ -0,0 +1,217 @@ +=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 + # A cardinality override applied to a specific metric. + class ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit + include BaseGenericModel + + # The action to take when the cardinality limit is exceeded. + attr_reader :limit_exceeded_action + + # The name of the metric this override applies to. + attr_reader :metric_name + + # How the per-metric override is applied. `tracked` enforces a custom limit; `excluded` skips the metric entirely. + attr_reader :mode + + # A list of per-tag cardinality overrides that apply within this metric. + attr_reader :per_tag_limits + + # The maximum number of distinct tag value combinations allowed for this metric. + attr_reader :value_limit + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'limit_exceeded_action' => :'limit_exceeded_action', + :'metric_name' => :'metric_name', + :'mode' => :'mode', + :'per_tag_limits' => :'per_tag_limits', + :'value_limit' => :'value_limit' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'limit_exceeded_action' => :'ObservabilityPipelineTagCardinalityLimitProcessorAction', + :'metric_name' => :'String', + :'mode' => :'ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode', + :'per_tag_limits' => :'Array', + :'value_limit' => :'Integer' + } + 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::ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit` 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?(:'limit_exceeded_action') + self.limit_exceeded_action = attributes[:'limit_exceeded_action'] + end + + if attributes.key?(:'metric_name') + self.metric_name = attributes[:'metric_name'] + end + + if attributes.key?(:'mode') + self.mode = attributes[:'mode'] + end + + if attributes.key?(:'per_tag_limits') + if (value = attributes[:'per_tag_limits']).is_a?(Array) + self.per_tag_limits = value + end + end + + if attributes.key?(:'value_limit') + self.value_limit = attributes[:'value_limit'] + 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 @limit_exceeded_action.nil? + return false if @metric_name.nil? + return false if @mode.nil? + return false if !@per_tag_limits.nil? && @per_tag_limits.length > 50 + return false if @value_limit.nil? + return false if @value_limit > 1000000 + return false if @value_limit < 0 + true + end + + # Custom attribute writer method with validation + # @param limit_exceeded_action [Object] Object to be assigned + # @!visibility private + def limit_exceeded_action=(limit_exceeded_action) + if limit_exceeded_action.nil? + fail ArgumentError, 'invalid value for "limit_exceeded_action", limit_exceeded_action cannot be nil.' + end + @limit_exceeded_action = limit_exceeded_action + end + + # Custom attribute writer method with validation + # @param metric_name [Object] Object to be assigned + # @!visibility private + def metric_name=(metric_name) + if metric_name.nil? + fail ArgumentError, 'invalid value for "metric_name", metric_name cannot be nil.' + end + @metric_name = metric_name + end + + # Custom attribute writer method with validation + # @param mode [Object] Object to be assigned + # @!visibility private + def mode=(mode) + if mode.nil? + fail ArgumentError, 'invalid value for "mode", mode cannot be nil.' + end + @mode = mode + end + + # Custom attribute writer method with validation + # @param per_tag_limits [Object] Object to be assigned + # @!visibility private + def per_tag_limits=(per_tag_limits) + if !per_tag_limits.nil? && per_tag_limits.length > 50 + fail ArgumentError, 'invalid value for "per_tag_limits", number of items must be less than or equal to 50.' + end + @per_tag_limits = per_tag_limits + end + + # Custom attribute writer method with validation + # @param value_limit [Object] Object to be assigned + # @!visibility private + def value_limit=(value_limit) + if value_limit.nil? + fail ArgumentError, 'invalid value for "value_limit", value_limit cannot be nil.' + end + if value_limit > 1000000 + fail ArgumentError, 'invalid value for "value_limit", must be smaller than or equal to 1000000.' + end + if value_limit < 0 + fail ArgumentError, 'invalid value for "value_limit", must be greater than or equal to 0.' + end + @value_limit = value_limit + 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 && + limit_exceeded_action == o.limit_exceeded_action && + metric_name == o.metric_name && + mode == o.mode && + per_tag_limits == o.per_tag_limits && + value_limit == o.value_limit && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [limit_exceeded_action, metric_name, mode, per_tag_limits, value_limit, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_metric_mode.rb b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_metric_mode.rb new file mode 100644 index 000000000000..0a73d35dbc7e --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_metric_mode.rb @@ -0,0 +1,27 @@ +=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 + # How the per-metric override is applied. `tracked` enforces a custom limit; `excluded` skips the metric entirely. + class ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode + include BaseEnumModel + + TRACKED = "tracked".freeze + EXCLUDED = "excluded".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_tag_limit.rb b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_tag_limit.rb new file mode 100644 index 000000000000..7a853a7ed4a0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_tag_limit.rb @@ -0,0 +1,173 @@ +=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 + # A cardinality override for a specific tag key within a per-metric limit. + class ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit + include BaseGenericModel + + # How the per-tag override is applied. `limit_override` enforces a custom limit on the tag; `excluded` skips the tag from cardinality tracking. + attr_reader :mode + + # The tag key this override applies to. + attr_reader :tag_key + + # The maximum number of distinct values allowed for this tag. + attr_reader :value_limit + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'mode' => :'mode', + :'tag_key' => :'tag_key', + :'value_limit' => :'value_limit' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'mode' => :'ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode', + :'tag_key' => :'String', + :'value_limit' => :'Integer' + } + 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::ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit` 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?(:'mode') + self.mode = attributes[:'mode'] + end + + if attributes.key?(:'tag_key') + self.tag_key = attributes[:'tag_key'] + end + + if attributes.key?(:'value_limit') + self.value_limit = attributes[:'value_limit'] + 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 @mode.nil? + return false if @tag_key.nil? + return false if @value_limit.nil? + return false if @value_limit > 1000000 + return false if @value_limit < 0 + true + end + + # Custom attribute writer method with validation + # @param mode [Object] Object to be assigned + # @!visibility private + def mode=(mode) + if mode.nil? + fail ArgumentError, 'invalid value for "mode", mode cannot be nil.' + end + @mode = mode + end + + # Custom attribute writer method with validation + # @param tag_key [Object] Object to be assigned + # @!visibility private + def tag_key=(tag_key) + if tag_key.nil? + fail ArgumentError, 'invalid value for "tag_key", tag_key cannot be nil.' + end + @tag_key = tag_key + end + + # Custom attribute writer method with validation + # @param value_limit [Object] Object to be assigned + # @!visibility private + def value_limit=(value_limit) + if value_limit.nil? + fail ArgumentError, 'invalid value for "value_limit", value_limit cannot be nil.' + end + if value_limit > 1000000 + fail ArgumentError, 'invalid value for "value_limit", must be smaller than or equal to 1000000.' + end + if value_limit < 0 + fail ArgumentError, 'invalid value for "value_limit", must be greater than or equal to 0.' + end + @value_limit = value_limit + 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 && + mode == o.mode && + tag_key == o.tag_key && + value_limit == o.value_limit && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [mode, tag_key, value_limit, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_tag_mode.rb b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_tag_mode.rb new file mode 100644 index 000000000000..4e2dd13f7af9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_tag_mode.rb @@ -0,0 +1,27 @@ +=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 + # How the per-tag override is applied. `limit_override` enforces a custom limit on the tag; `excluded` skips the tag from cardinality tracking. + class ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode + include BaseEnumModel + + LIMIT_OVERRIDE = "limit_override".freeze + EXCLUDED = "excluded".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_type.rb b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_type.rb new file mode 100644 index 000000000000..955836a0e9b0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_type.rb @@ -0,0 +1,26 @@ +=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 + # The processor type. The value should always be `tag_cardinality_limit`. + class ObservabilityPipelineTagCardinalityLimitProcessorType + include BaseEnumModel + + TAG_CARDINALITY_LIMIT = "tag_cardinality_limit".freeze + end +end