diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 90e97c4cc9..77250e92e6 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -76346,6 +76346,7 @@ components: - $ref: "#/components/schemas/ObservabilityPipelineThrottleProcessor" - $ref: "#/components/schemas/ObservabilityPipelineAddMetricTagsProcessor" - $ref: "#/components/schemas/ObservabilityPipelineAggregateProcessor" + - $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableProcessor" - $ref: "#/components/schemas/ObservabilityPipelineMetricTagsProcessor" - $ref: "#/components/schemas/ObservabilityPipelineRenameMetricTagsProcessor" - $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessor" @@ -78491,6 +78492,187 @@ components: - name - value type: object + ObservabilityPipelineMetricEnrichmentTableFile: + description: Defines a static enrichment table loaded from a CSV file for metric enrichment. + properties: + encoding: + $ref: "#/components/schemas/ObservabilityPipelineEnrichmentTableFileEncoding" + key: + $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableFileKey" + path: + description: Path to the CSV file. + example: /etc/enrichment/lookup.csv + type: string + required: + - encoding + - key + - path + type: object + ObservabilityPipelineMetricEnrichmentTableFileKey: + description: Defines how to map a metric lookup value to a CSV column during enrichment table lookups. + properties: + column: + description: The CSV column name or index to match against the lookup value. + example: service + type: string + source: + $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableLookupSource" + required: + - column + - source + type: object + ObservabilityPipelineMetricEnrichmentTableFileProcessor: + description: An `enrichment_table` processor that enriches metrics using a static CSV file. + properties: + display_name: + $ref: "#/components/schemas/ObservabilityPipelineComponentDisplayName" + enabled: + description: Indicates whether the processor is enabled. + example: true + type: boolean + file: + $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableFile" + 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: enrichment-table-processor + type: string + include: + description: A Datadog search query used to determine which metrics this processor targets. + example: "*" + type: string + type: + $ref: "#/components/schemas/ObservabilityPipelineEnrichmentTableProcessorType" + required: + - id + - type + - include + - file + - enabled + type: object + ObservabilityPipelineMetricEnrichmentTableLookupSource: + description: |- + Specifies the source of the key value used for metric enrichment table lookups. + The lookup key can be either the metric name or a metric tag. + oneOf: + - $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableMetricNameLookup" + - $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableTagLookup" + ObservabilityPipelineMetricEnrichmentTableMetricNameLookup: + description: Uses the metric name as the lookup key for enrichment table matching. + properties: + type: + $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType" + required: + - type + type: object + ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType: + default: metric_name + description: The lookup source type. The value should always be `metric_name`. + enum: [metric_name] + example: metric_name + type: string + x-enum-varnames: + - METRIC_NAME + ObservabilityPipelineMetricEnrichmentTableProcessor: + description: |- + The `enrichment_table` processor enriches metrics with tags from a static CSV file or a Datadog reference table. + It looks up a row using the metric name or a metric tag value. It then adds each column of the matching row as a + metric tag, overwriting any existing tag with the same key. Exactly one of `file` or `reference_table` must be + configured. + + **Supported pipeline types:** metrics + oneOf: + - $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableFileProcessor" + - $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor" + x-pipeline-types: [metrics] + ObservabilityPipelineMetricEnrichmentTableReferenceKey: + description: Defines the metric lookup value used as the reference-table row ID. + properties: + source: + $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableLookupSource" + required: + - source + type: object + ObservabilityPipelineMetricEnrichmentTableReferenceTable: + description: Uses a Datadog reference table to enrich metrics. + properties: + app_key_key: + description: |- + The name of the environment variable or secret that holds the Datadog application key used to access the + reference table. + example: DD_APP_KEY + type: string + columns: + description: |- + A list of column names to include from the reference table. If not provided, all columns are included. + items: + description: The name of a column to include from the reference table. + type: string + maxItems: 50 + type: array + key: + $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableReferenceKey" + table_id: + description: The unique identifier of the reference table. + example: 550e8400-e29b-41d4-a716-446655440000 + type: string + required: + - key + - table_id + type: object + ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor: + description: An `enrichment_table` processor that enriches metrics using a Datadog reference table. + 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: enrichment-table-processor + type: string + include: + description: A Datadog search query used to determine which metrics this processor targets. + example: "*" + type: string + reference_table: + $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableReferenceTable" + type: + $ref: "#/components/schemas/ObservabilityPipelineEnrichmentTableProcessorType" + required: + - id + - type + - include + - reference_table + - enabled + type: object + ObservabilityPipelineMetricEnrichmentTableTagLookup: + description: Uses a metric tag as the lookup key for enrichment table matching. + properties: + name: + description: The Datadog tag key used as the lookup key. + example: service + maxLength: 200 + type: string + type: + $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableTagLookupType" + required: + - type + - name + type: object + ObservabilityPipelineMetricEnrichmentTableTagLookupType: + default: tag + description: The lookup source type. The value should always be `tag`. + enum: [tag] + example: tag + type: string + x-enum-varnames: + - TAG ObservabilityPipelineMetricTagsProcessor: description: |- The `metric_tags` processor filters metrics based on their tags using Datadog tag key patterns. diff --git a/examples/v2/observability-pipelines/ValidatePipeline_1795564228.py b/examples/v2/observability-pipelines/ValidatePipeline_1795564228.py new file mode 100644 index 0000000000..59303f859c --- /dev/null +++ b/examples/v2/observability-pipelines/ValidatePipeline_1795564228.py @@ -0,0 +1,121 @@ +""" +Validate a metrics pipeline with enrichment table processor file lookup returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.observability_pipelines_api import ObservabilityPipelinesApi +from datadog_api_client.v2.model.observability_pipeline_config import ObservabilityPipelineConfig +from datadog_api_client.v2.model.observability_pipeline_config_pipeline_type import ( + ObservabilityPipelineConfigPipelineType, +) +from datadog_api_client.v2.model.observability_pipeline_config_processor_group import ( + ObservabilityPipelineConfigProcessorGroup, +) +from datadog_api_client.v2.model.observability_pipeline_data_attributes import ObservabilityPipelineDataAttributes +from datadog_api_client.v2.model.observability_pipeline_datadog_agent_source import ( + ObservabilityPipelineDatadogAgentSource, +) +from datadog_api_client.v2.model.observability_pipeline_datadog_agent_source_type import ( + ObservabilityPipelineDatadogAgentSourceType, +) +from datadog_api_client.v2.model.observability_pipeline_datadog_metrics_destination import ( + ObservabilityPipelineDatadogMetricsDestination, +) +from datadog_api_client.v2.model.observability_pipeline_datadog_metrics_destination_type import ( + ObservabilityPipelineDatadogMetricsDestinationType, +) +from datadog_api_client.v2.model.observability_pipeline_enrichment_table_file_encoding import ( + ObservabilityPipelineEnrichmentTableFileEncoding, +) +from datadog_api_client.v2.model.observability_pipeline_enrichment_table_file_encoding_type import ( + ObservabilityPipelineEnrichmentTableFileEncodingType, +) +from datadog_api_client.v2.model.observability_pipeline_enrichment_table_processor_type import ( + ObservabilityPipelineEnrichmentTableProcessorType, +) +from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_file import ( + ObservabilityPipelineMetricEnrichmentTableFile, +) +from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_file_key import ( + ObservabilityPipelineMetricEnrichmentTableFileKey, +) +from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_file_processor import ( + ObservabilityPipelineMetricEnrichmentTableFileProcessor, +) +from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_tag_lookup import ( + ObservabilityPipelineMetricEnrichmentTableTagLookup, +) +from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_tag_lookup_type import ( + ObservabilityPipelineMetricEnrichmentTableTagLookupType, +) +from datadog_api_client.v2.model.observability_pipeline_spec import ObservabilityPipelineSpec +from datadog_api_client.v2.model.observability_pipeline_spec_data import ObservabilityPipelineSpecData + +body = ObservabilityPipelineSpec( + data=ObservabilityPipelineSpecData( + attributes=ObservabilityPipelineDataAttributes( + config=ObservabilityPipelineConfig( + pipeline_type=ObservabilityPipelineConfigPipelineType.METRICS, + destinations=[ + ObservabilityPipelineDatadogMetricsDestination( + id="datadog-metrics-destination", + inputs=[ + "my-processor-group", + ], + type=ObservabilityPipelineDatadogMetricsDestinationType.DATADOG_METRICS, + ), + ], + processor_groups=[ + ObservabilityPipelineConfigProcessorGroup( + enabled=True, + id="my-processor-group", + include="*", + inputs=[ + "datadog-agent-source", + ], + processors=[ + ObservabilityPipelineMetricEnrichmentTableFileProcessor( + enabled=True, + id="enrichment-table-processor", + include="*", + type=ObservabilityPipelineEnrichmentTableProcessorType.ENRICHMENT_TABLE, + file=ObservabilityPipelineMetricEnrichmentTableFile( + encoding=ObservabilityPipelineEnrichmentTableFileEncoding( + delimiter=",", + type=ObservabilityPipelineEnrichmentTableFileEncodingType.CSV, + includes_headers=True, + ), + key=ObservabilityPipelineMetricEnrichmentTableFileKey( + column="service", + source=ObservabilityPipelineMetricEnrichmentTableTagLookup( + type=ObservabilityPipelineMetricEnrichmentTableTagLookupType.TAG, + name="service", + ), + ), + path="/etc/enrichment/lookup.csv", + ), + ), + ], + ), + ], + sources=[ + ObservabilityPipelineDatadogAgentSource( + id="datadog-agent-source", + type=ObservabilityPipelineDatadogAgentSourceType.DATADOG_AGENT, + ), + ], + ), + name="Metrics Pipeline with Enrichment Table File Lookup", + ), + type="pipelines", + ), +) + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +with ApiClient(configuration) as api_client: + api_instance = ObservabilityPipelinesApi(api_client) + response = api_instance.validate_pipeline(body=body) + + print(response) diff --git a/examples/v2/observability-pipelines/ValidatePipeline_4239139905.py b/examples/v2/observability-pipelines/ValidatePipeline_4239139905.py new file mode 100644 index 0000000000..0313239c16 --- /dev/null +++ b/examples/v2/observability-pipelines/ValidatePipeline_4239139905.py @@ -0,0 +1,112 @@ +""" +Validate a metrics pipeline with enrichment table processor reference table returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.observability_pipelines_api import ObservabilityPipelinesApi +from datadog_api_client.v2.model.observability_pipeline_config import ObservabilityPipelineConfig +from datadog_api_client.v2.model.observability_pipeline_config_pipeline_type import ( + ObservabilityPipelineConfigPipelineType, +) +from datadog_api_client.v2.model.observability_pipeline_config_processor_group import ( + ObservabilityPipelineConfigProcessorGroup, +) +from datadog_api_client.v2.model.observability_pipeline_data_attributes import ObservabilityPipelineDataAttributes +from datadog_api_client.v2.model.observability_pipeline_datadog_agent_source import ( + ObservabilityPipelineDatadogAgentSource, +) +from datadog_api_client.v2.model.observability_pipeline_datadog_agent_source_type import ( + ObservabilityPipelineDatadogAgentSourceType, +) +from datadog_api_client.v2.model.observability_pipeline_datadog_metrics_destination import ( + ObservabilityPipelineDatadogMetricsDestination, +) +from datadog_api_client.v2.model.observability_pipeline_datadog_metrics_destination_type import ( + ObservabilityPipelineDatadogMetricsDestinationType, +) +from datadog_api_client.v2.model.observability_pipeline_enrichment_table_processor_type import ( + ObservabilityPipelineEnrichmentTableProcessorType, +) +from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_metric_name_lookup import ( + ObservabilityPipelineMetricEnrichmentTableMetricNameLookup, +) +from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_metric_name_lookup_type import ( + ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType, +) +from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_reference_key import ( + ObservabilityPipelineMetricEnrichmentTableReferenceKey, +) +from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_reference_table import ( + ObservabilityPipelineMetricEnrichmentTableReferenceTable, +) +from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_reference_table_processor import ( + ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor, +) +from datadog_api_client.v2.model.observability_pipeline_spec import ObservabilityPipelineSpec +from datadog_api_client.v2.model.observability_pipeline_spec_data import ObservabilityPipelineSpecData + +body = ObservabilityPipelineSpec( + data=ObservabilityPipelineSpecData( + attributes=ObservabilityPipelineDataAttributes( + config=ObservabilityPipelineConfig( + pipeline_type=ObservabilityPipelineConfigPipelineType.METRICS, + destinations=[ + ObservabilityPipelineDatadogMetricsDestination( + id="datadog-metrics-destination", + inputs=[ + "my-processor-group", + ], + type=ObservabilityPipelineDatadogMetricsDestinationType.DATADOG_METRICS, + ), + ], + processor_groups=[ + ObservabilityPipelineConfigProcessorGroup( + enabled=True, + id="my-processor-group", + include="*", + inputs=[ + "datadog-agent-source", + ], + processors=[ + ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor( + enabled=True, + id="enrichment-table-processor", + include="*", + type=ObservabilityPipelineEnrichmentTableProcessorType.ENRICHMENT_TABLE, + reference_table=ObservabilityPipelineMetricEnrichmentTableReferenceTable( + table_id="metric-enrichment", + key=ObservabilityPipelineMetricEnrichmentTableReferenceKey( + source=ObservabilityPipelineMetricEnrichmentTableMetricNameLookup( + type=ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType.METRIC_NAME, + ), + ), + columns=[ + "environment", + "team", + ], + ), + ), + ], + ), + ], + sources=[ + ObservabilityPipelineDatadogAgentSource( + id="datadog-agent-source", + type=ObservabilityPipelineDatadogAgentSourceType.DATADOG_AGENT, + ), + ], + ), + name="Metrics Pipeline with Enrichment Table Reference Table", + ), + type="pipelines", + ), +) + +configuration = Configuration() +configuration.access_token = environ["DD_BEARER_TOKEN"] +with ApiClient(configuration) as api_client: + api_instance = ObservabilityPipelinesApi(api_client) + response = api_instance.validate_pipeline(body=body) + + print(response) diff --git a/src/datadog_api_client/v2/model/observability_pipeline_config_processor_group.py b/src/datadog_api_client/v2/model/observability_pipeline_config_processor_group.py index d2cad80203..7f0dd28faa 100644 --- a/src/datadog_api_client/v2/model/observability_pipeline_config_processor_group.py +++ b/src/datadog_api_client/v2/model/observability_pipeline_config_processor_group.py @@ -77,6 +77,9 @@ from datadog_api_client.v2.model.observability_pipeline_aggregate_processor import ( ObservabilityPipelineAggregateProcessor, ) + from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_processor import ( + ObservabilityPipelineMetricEnrichmentTableProcessor, + ) from datadog_api_client.v2.model.observability_pipeline_metric_tags_processor import ( ObservabilityPipelineMetricTagsProcessor, ) @@ -146,6 +149,7 @@ def __init__( ObservabilityPipelineThrottleProcessor, ObservabilityPipelineAddMetricTagsProcessor, ObservabilityPipelineAggregateProcessor, + ObservabilityPipelineMetricEnrichmentTableProcessor, ObservabilityPipelineMetricTagsProcessor, ObservabilityPipelineRenameMetricTagsProcessor, ObservabilityPipelineTagCardinalityLimitProcessor, diff --git a/src/datadog_api_client/v2/model/observability_pipeline_config_processor_item.py b/src/datadog_api_client/v2/model/observability_pipeline_config_processor_item.py index cc838caf3d..67ccea048e 100644 --- a/src/datadog_api_client/v2/model/observability_pipeline_config_processor_item.py +++ b/src/datadog_api_client/v2/model/observability_pipeline_config_processor_item.py @@ -255,6 +255,9 @@ def _composed_schemas(_): from datadog_api_client.v2.model.observability_pipeline_aggregate_processor import ( ObservabilityPipelineAggregateProcessor, ) + from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_processor import ( + ObservabilityPipelineMetricEnrichmentTableProcessor, + ) from datadog_api_client.v2.model.observability_pipeline_metric_tags_processor import ( ObservabilityPipelineMetricTagsProcessor, ) @@ -291,6 +294,7 @@ def _composed_schemas(_): ObservabilityPipelineThrottleProcessor, ObservabilityPipelineAddMetricTagsProcessor, ObservabilityPipelineAggregateProcessor, + ObservabilityPipelineMetricEnrichmentTableProcessor, ObservabilityPipelineMetricTagsProcessor, ObservabilityPipelineRenameMetricTagsProcessor, ObservabilityPipelineTagCardinalityLimitProcessor, diff --git a/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_file.py b/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_file.py new file mode 100644 index 0000000000..5346828402 --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_file.py @@ -0,0 +1,68 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.observability_pipeline_enrichment_table_file_encoding import ( + ObservabilityPipelineEnrichmentTableFileEncoding, + ) + from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_file_key import ( + ObservabilityPipelineMetricEnrichmentTableFileKey, + ) + + +class ObservabilityPipelineMetricEnrichmentTableFile(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.observability_pipeline_enrichment_table_file_encoding import ( + ObservabilityPipelineEnrichmentTableFileEncoding, + ) + from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_file_key import ( + ObservabilityPipelineMetricEnrichmentTableFileKey, + ) + + return { + "encoding": (ObservabilityPipelineEnrichmentTableFileEncoding,), + "key": (ObservabilityPipelineMetricEnrichmentTableFileKey,), + "path": (str,), + } + + attribute_map = { + "encoding": "encoding", + "key": "key", + "path": "path", + } + + def __init__( + self_, + encoding: ObservabilityPipelineEnrichmentTableFileEncoding, + key: ObservabilityPipelineMetricEnrichmentTableFileKey, + path: str, + **kwargs, + ): + """ + Defines a static enrichment table loaded from a CSV file for metric enrichment. + + :param encoding: File encoding format. + :type encoding: ObservabilityPipelineEnrichmentTableFileEncoding + + :param key: Defines how to map a metric lookup value to a CSV column during enrichment table lookups. + :type key: ObservabilityPipelineMetricEnrichmentTableFileKey + + :param path: Path to the CSV file. + :type path: str + """ + super().__init__(kwargs) + + self_.encoding = encoding + self_.key = key + self_.path = path diff --git a/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_file_key.py b/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_file_key.py new file mode 100644 index 0000000000..93019d7e1b --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_file_key.py @@ -0,0 +1,66 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_lookup_source import ( + ObservabilityPipelineMetricEnrichmentTableLookupSource, + ) + from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_metric_name_lookup import ( + ObservabilityPipelineMetricEnrichmentTableMetricNameLookup, + ) + from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_tag_lookup import ( + ObservabilityPipelineMetricEnrichmentTableTagLookup, + ) + + +class ObservabilityPipelineMetricEnrichmentTableFileKey(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_lookup_source import ( + ObservabilityPipelineMetricEnrichmentTableLookupSource, + ) + + return { + "column": (str,), + "source": (ObservabilityPipelineMetricEnrichmentTableLookupSource,), + } + + attribute_map = { + "column": "column", + "source": "source", + } + + def __init__( + self_, + column: str, + source: Union[ + ObservabilityPipelineMetricEnrichmentTableLookupSource, + ObservabilityPipelineMetricEnrichmentTableMetricNameLookup, + ObservabilityPipelineMetricEnrichmentTableTagLookup, + ], + **kwargs, + ): + """ + Defines how to map a metric lookup value to a CSV column during enrichment table lookups. + + :param column: The CSV column name or index to match against the lookup value. + :type column: str + + :param source: Specifies the source of the key value used for metric enrichment table lookups. + The lookup key can be either the metric name or a metric tag. + :type source: ObservabilityPipelineMetricEnrichmentTableLookupSource + """ + super().__init__(kwargs) + + self_.column = column + self_.source = source diff --git a/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_file_processor.py b/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_file_processor.py new file mode 100644 index 0000000000..fd3cf6bcbd --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_file_processor.py @@ -0,0 +1,93 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_file import ( + ObservabilityPipelineMetricEnrichmentTableFile, + ) + from datadog_api_client.v2.model.observability_pipeline_enrichment_table_processor_type import ( + ObservabilityPipelineEnrichmentTableProcessorType, + ) + + +class ObservabilityPipelineMetricEnrichmentTableFileProcessor(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_file import ( + ObservabilityPipelineMetricEnrichmentTableFile, + ) + from datadog_api_client.v2.model.observability_pipeline_enrichment_table_processor_type import ( + ObservabilityPipelineEnrichmentTableProcessorType, + ) + + return { + "display_name": (str,), + "enabled": (bool,), + "file": (ObservabilityPipelineMetricEnrichmentTableFile,), + "id": (str,), + "include": (str,), + "type": (ObservabilityPipelineEnrichmentTableProcessorType,), + } + + attribute_map = { + "display_name": "display_name", + "enabled": "enabled", + "file": "file", + "id": "id", + "include": "include", + "type": "type", + } + + def __init__( + self_, + enabled: bool, + file: ObservabilityPipelineMetricEnrichmentTableFile, + id: str, + include: str, + type: ObservabilityPipelineEnrichmentTableProcessorType, + display_name: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + An ``enrichment_table`` processor that enriches metrics using a static CSV file. + + :param display_name: The display name for a component. + :type display_name: str, optional + + :param enabled: Indicates whether the processor is enabled. + :type enabled: bool + + :param file: Defines a static enrichment table loaded from a CSV file for metric enrichment. + :type file: ObservabilityPipelineMetricEnrichmentTableFile + + :param id: 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). + :type id: str + + :param include: A Datadog search query used to determine which metrics this processor targets. + :type include: str + + :param type: The processor type. The value should always be ``enrichment_table``. + :type type: ObservabilityPipelineEnrichmentTableProcessorType + """ + if display_name is not unset: + kwargs["display_name"] = display_name + super().__init__(kwargs) + + self_.enabled = enabled + self_.file = file + self_.id = id + self_.include = include + self_.type = type diff --git a/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_lookup_source.py b/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_lookup_source.py new file mode 100644 index 0000000000..6be5b58f5b --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_lookup_source.py @@ -0,0 +1,48 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class ObservabilityPipelineMetricEnrichmentTableLookupSource(ModelComposed): + def __init__(self, **kwargs): + """ + Specifies the source of the key value used for metric enrichment table lookups. + The lookup key can be either the metric name or a metric tag. + + :param type: The lookup source type. The value should always be `metric_name`. + :type type: ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType + + :param name: The Datadog tag key used as the lookup key. + :type name: str + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_metric_name_lookup import ( + ObservabilityPipelineMetricEnrichmentTableMetricNameLookup, + ) + from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_tag_lookup import ( + ObservabilityPipelineMetricEnrichmentTableTagLookup, + ) + + return { + "oneOf": [ + ObservabilityPipelineMetricEnrichmentTableMetricNameLookup, + ObservabilityPipelineMetricEnrichmentTableTagLookup, + ], + } diff --git a/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_metric_name_lookup.py b/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_metric_name_lookup.py new file mode 100644 index 0000000000..6b363372d3 --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_metric_name_lookup.py @@ -0,0 +1,44 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_metric_name_lookup_type import ( + ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType, + ) + + +class ObservabilityPipelineMetricEnrichmentTableMetricNameLookup(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_metric_name_lookup_type import ( + ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType, + ) + + return { + "type": (ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType,), + } + + attribute_map = { + "type": "type", + } + + def __init__(self_, type: ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType, **kwargs): + """ + Uses the metric name as the lookup key for enrichment table matching. + + :param type: The lookup source type. The value should always be ``metric_name``. + :type type: ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType + """ + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_metric_name_lookup_type.py b/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_metric_name_lookup_type.py new file mode 100644 index 0000000000..0d709126be --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_metric_name_lookup_type.py @@ -0,0 +1,37 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType(ModelSimple): + """ + The lookup source type. The value should always be `metric_name`. + + :param value: If omitted defaults to "metric_name". Must be one of ["metric_name"]. + :type value: str + """ + + allowed_values = { + "metric_name", + } + METRIC_NAME: ClassVar["ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType.METRIC_NAME = ( + ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType("metric_name") +) diff --git a/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_processor.py b/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_processor.py new file mode 100644 index 0000000000..8f9b052490 --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_processor.py @@ -0,0 +1,68 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class ObservabilityPipelineMetricEnrichmentTableProcessor(ModelComposed): + def __init__(self, **kwargs): + """ + The ``enrichment_table`` processor enriches metrics with tags from a static CSV file or a Datadog reference table. + It looks up a row using the metric name or a metric tag value. It then adds each column of the matching row as a + metric tag, overwriting any existing tag with the same key. Exactly one of ``file`` or ``reference_table`` must be + configured. + + **Supported pipeline types:** metrics + + :param display_name: The display name for a component. + :type display_name: str, optional + + :param enabled: Indicates whether the processor is enabled. + :type enabled: bool + + :param file: Defines a static enrichment table loaded from a CSV file for metric enrichment. + :type file: ObservabilityPipelineMetricEnrichmentTableFile + + :param id: 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). + :type id: str + + :param include: A Datadog search query used to determine which metrics this processor targets. + :type include: str + + :param type: The processor type. The value should always be `enrichment_table`. + :type type: ObservabilityPipelineEnrichmentTableProcessorType + + :param reference_table: Uses a Datadog reference table to enrich metrics. + :type reference_table: ObservabilityPipelineMetricEnrichmentTableReferenceTable + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_file_processor import ( + ObservabilityPipelineMetricEnrichmentTableFileProcessor, + ) + from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_reference_table_processor import ( + ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor, + ) + + return { + "oneOf": [ + ObservabilityPipelineMetricEnrichmentTableFileProcessor, + ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor, + ], + } diff --git a/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_reference_key.py b/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_reference_key.py new file mode 100644 index 0000000000..fb04d8716a --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_reference_key.py @@ -0,0 +1,59 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_lookup_source import ( + ObservabilityPipelineMetricEnrichmentTableLookupSource, + ) + from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_metric_name_lookup import ( + ObservabilityPipelineMetricEnrichmentTableMetricNameLookup, + ) + from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_tag_lookup import ( + ObservabilityPipelineMetricEnrichmentTableTagLookup, + ) + + +class ObservabilityPipelineMetricEnrichmentTableReferenceKey(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_lookup_source import ( + ObservabilityPipelineMetricEnrichmentTableLookupSource, + ) + + return { + "source": (ObservabilityPipelineMetricEnrichmentTableLookupSource,), + } + + attribute_map = { + "source": "source", + } + + def __init__( + self_, + source: Union[ + ObservabilityPipelineMetricEnrichmentTableLookupSource, + ObservabilityPipelineMetricEnrichmentTableMetricNameLookup, + ObservabilityPipelineMetricEnrichmentTableTagLookup, + ], + **kwargs, + ): + """ + Defines the metric lookup value used as the reference-table row ID. + + :param source: Specifies the source of the key value used for metric enrichment table lookups. + The lookup key can be either the metric name or a metric tag. + :type source: ObservabilityPipelineMetricEnrichmentTableLookupSource + """ + super().__init__(kwargs) + + self_.source = source diff --git a/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_reference_table.py b/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_reference_table.py new file mode 100644 index 0000000000..b05c04abe1 --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_reference_table.py @@ -0,0 +1,80 @@ +# 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. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_reference_key import ( + ObservabilityPipelineMetricEnrichmentTableReferenceKey, + ) + + +class ObservabilityPipelineMetricEnrichmentTableReferenceTable(ModelNormal): + validations = { + "columns": { + "max_items": 50, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_reference_key import ( + ObservabilityPipelineMetricEnrichmentTableReferenceKey, + ) + + return { + "app_key_key": (str,), + "columns": ([str],), + "key": (ObservabilityPipelineMetricEnrichmentTableReferenceKey,), + "table_id": (str,), + } + + attribute_map = { + "app_key_key": "app_key_key", + "columns": "columns", + "key": "key", + "table_id": "table_id", + } + + def __init__( + self_, + key: ObservabilityPipelineMetricEnrichmentTableReferenceKey, + table_id: str, + app_key_key: Union[str, UnsetType] = unset, + columns: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + Uses a Datadog reference table to enrich metrics. + + :param app_key_key: The name of the environment variable or secret that holds the Datadog application key used to access the + reference table. + :type app_key_key: str, optional + + :param columns: A list of column names to include from the reference table. If not provided, all columns are included. + :type columns: [str], optional + + :param key: Defines the metric lookup value used as the reference-table row ID. + :type key: ObservabilityPipelineMetricEnrichmentTableReferenceKey + + :param table_id: The unique identifier of the reference table. + :type table_id: str + """ + if app_key_key is not unset: + kwargs["app_key_key"] = app_key_key + if columns is not unset: + kwargs["columns"] = columns + super().__init__(kwargs) + + self_.key = key + self_.table_id = table_id diff --git a/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_reference_table_processor.py b/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_reference_table_processor.py new file mode 100644 index 0000000000..11b1cf79cf --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_reference_table_processor.py @@ -0,0 +1,93 @@ +# 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. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_reference_table import ( + ObservabilityPipelineMetricEnrichmentTableReferenceTable, + ) + from datadog_api_client.v2.model.observability_pipeline_enrichment_table_processor_type import ( + ObservabilityPipelineEnrichmentTableProcessorType, + ) + + +class ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_reference_table import ( + ObservabilityPipelineMetricEnrichmentTableReferenceTable, + ) + from datadog_api_client.v2.model.observability_pipeline_enrichment_table_processor_type import ( + ObservabilityPipelineEnrichmentTableProcessorType, + ) + + return { + "display_name": (str,), + "enabled": (bool,), + "id": (str,), + "include": (str,), + "reference_table": (ObservabilityPipelineMetricEnrichmentTableReferenceTable,), + "type": (ObservabilityPipelineEnrichmentTableProcessorType,), + } + + attribute_map = { + "display_name": "display_name", + "enabled": "enabled", + "id": "id", + "include": "include", + "reference_table": "reference_table", + "type": "type", + } + + def __init__( + self_, + enabled: bool, + id: str, + include: str, + reference_table: ObservabilityPipelineMetricEnrichmentTableReferenceTable, + type: ObservabilityPipelineEnrichmentTableProcessorType, + display_name: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + An ``enrichment_table`` processor that enriches metrics using a Datadog reference table. + + :param display_name: The display name for a component. + :type display_name: str, optional + + :param enabled: Indicates whether the processor is enabled. + :type enabled: bool + + :param id: 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). + :type id: str + + :param include: A Datadog search query used to determine which metrics this processor targets. + :type include: str + + :param reference_table: Uses a Datadog reference table to enrich metrics. + :type reference_table: ObservabilityPipelineMetricEnrichmentTableReferenceTable + + :param type: The processor type. The value should always be ``enrichment_table``. + :type type: ObservabilityPipelineEnrichmentTableProcessorType + """ + if display_name is not unset: + kwargs["display_name"] = display_name + super().__init__(kwargs) + + self_.enabled = enabled + self_.id = id + self_.include = include + self_.reference_table = reference_table + self_.type = type diff --git a/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_tag_lookup.py b/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_tag_lookup.py new file mode 100644 index 0000000000..128d04fbe3 --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_tag_lookup.py @@ -0,0 +1,56 @@ +# 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. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_tag_lookup_type import ( + ObservabilityPipelineMetricEnrichmentTableTagLookupType, + ) + + +class ObservabilityPipelineMetricEnrichmentTableTagLookup(ModelNormal): + validations = { + "name": { + "max_length": 200, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_tag_lookup_type import ( + ObservabilityPipelineMetricEnrichmentTableTagLookupType, + ) + + return { + "name": (str,), + "type": (ObservabilityPipelineMetricEnrichmentTableTagLookupType,), + } + + attribute_map = { + "name": "name", + "type": "type", + } + + def __init__(self_, name: str, type: ObservabilityPipelineMetricEnrichmentTableTagLookupType, **kwargs): + """ + Uses a metric tag as the lookup key for enrichment table matching. + + :param name: The Datadog tag key used as the lookup key. + :type name: str + + :param type: The lookup source type. The value should always be ``tag``. + :type type: ObservabilityPipelineMetricEnrichmentTableTagLookupType + """ + super().__init__(kwargs) + + self_.name = name + self_.type = type diff --git a/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_tag_lookup_type.py b/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_tag_lookup_type.py new file mode 100644 index 0000000000..5be0ffe1f2 --- /dev/null +++ b/src/datadog_api_client/v2/model/observability_pipeline_metric_enrichment_table_tag_lookup_type.py @@ -0,0 +1,37 @@ +# 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. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class ObservabilityPipelineMetricEnrichmentTableTagLookupType(ModelSimple): + """ + The lookup source type. The value should always be `tag`. + + :param value: If omitted defaults to "tag". Must be one of ["tag"]. + :type value: str + """ + + allowed_values = { + "tag", + } + TAG: ClassVar["ObservabilityPipelineMetricEnrichmentTableTagLookupType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ObservabilityPipelineMetricEnrichmentTableTagLookupType.TAG = ObservabilityPipelineMetricEnrichmentTableTagLookupType( + "tag" +) diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 80b8b628d8..07f6b2a53c 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -6571,6 +6571,42 @@ ObservabilityPipelineMemoryBufferSizeOptions, ) from datadog_api_client.v2.model.observability_pipeline_metadata_entry import ObservabilityPipelineMetadataEntry +from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_file import ( + ObservabilityPipelineMetricEnrichmentTableFile, +) +from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_file_key import ( + ObservabilityPipelineMetricEnrichmentTableFileKey, +) +from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_file_processor import ( + ObservabilityPipelineMetricEnrichmentTableFileProcessor, +) +from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_lookup_source import ( + ObservabilityPipelineMetricEnrichmentTableLookupSource, +) +from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_metric_name_lookup import ( + ObservabilityPipelineMetricEnrichmentTableMetricNameLookup, +) +from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_metric_name_lookup_type import ( + ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType, +) +from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_processor import ( + ObservabilityPipelineMetricEnrichmentTableProcessor, +) +from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_reference_key import ( + ObservabilityPipelineMetricEnrichmentTableReferenceKey, +) +from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_reference_table import ( + ObservabilityPipelineMetricEnrichmentTableReferenceTable, +) +from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_reference_table_processor import ( + ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor, +) +from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_tag_lookup import ( + ObservabilityPipelineMetricEnrichmentTableTagLookup, +) +from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_tag_lookup_type import ( + ObservabilityPipelineMetricEnrichmentTableTagLookupType, +) from datadog_api_client.v2.model.observability_pipeline_metric_tags_processor import ( ObservabilityPipelineMetricTagsProcessor, ) @@ -16545,6 +16581,18 @@ "ObservabilityPipelineMemoryBufferOptions", "ObservabilityPipelineMemoryBufferSizeOptions", "ObservabilityPipelineMetadataEntry", + "ObservabilityPipelineMetricEnrichmentTableFile", + "ObservabilityPipelineMetricEnrichmentTableFileKey", + "ObservabilityPipelineMetricEnrichmentTableFileProcessor", + "ObservabilityPipelineMetricEnrichmentTableLookupSource", + "ObservabilityPipelineMetricEnrichmentTableMetricNameLookup", + "ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType", + "ObservabilityPipelineMetricEnrichmentTableProcessor", + "ObservabilityPipelineMetricEnrichmentTableReferenceKey", + "ObservabilityPipelineMetricEnrichmentTableReferenceTable", + "ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor", + "ObservabilityPipelineMetricEnrichmentTableTagLookup", + "ObservabilityPipelineMetricEnrichmentTableTagLookupType", "ObservabilityPipelineMetricTagsProcessor", "ObservabilityPipelineMetricTagsProcessorRule", "ObservabilityPipelineMetricTagsProcessorRuleAction", diff --git a/tests/generated-test/test-runner-data/manifest.json b/tests/generated-test/test-runner-data/manifest.json index 7d13dd7229..d139ef88b0 100644 --- a/tests/generated-test/test-runner-data/manifest.json +++ b/tests/generated-test/test-runner-data/manifest.json @@ -7952,6 +7952,20 @@ "scenario": "Update a pipeline returns \"OK\" response", "version": "v2" }, + { + "feature": "Observability Pipelines", + "feature_file": "../../v2/features/observability_pipelines.feature", + "file": "v2/observability-pipelines/validate-a-metrics-pipeline-with-enrichment-table-processor-file-lookup-returns-ok-response.json", + "scenario": "Validate a metrics pipeline with enrichment table processor file lookup returns \"OK\" response", + "version": "v2" + }, + { + "feature": "Observability Pipelines", + "feature_file": "../../v2/features/observability_pipelines.feature", + "file": "v2/observability-pipelines/validate-a-metrics-pipeline-with-enrichment-table-processor-reference-table-returns-ok-response.json", + "scenario": "Validate a metrics pipeline with enrichment table processor reference table returns \"OK\" response", + "version": "v2" + }, { "feature": "Observability Pipelines", "feature_file": "../../v2/features/observability_pipelines.feature", diff --git a/tests/generated-test/test-runner-data/v2/observability-pipelines/validate-a-metrics-pipeline-with-enrichment-table-processor-file-lookup-returns-ok-response.json b/tests/generated-test/test-runner-data/v2/observability-pipelines/validate-a-metrics-pipeline-with-enrichment-table-processor-file-lookup-returns-ok-response.json new file mode 100644 index 0000000000..1e6e133340 --- /dev/null +++ b/tests/generated-test/test-runner-data/v2/observability-pipelines/validate-a-metrics-pipeline-with-enrichment-table-processor-file-lookup-returns-ok-response.json @@ -0,0 +1,84 @@ +{ + "api": "ObservabilityPipelines", + "expected_status": 200, + "feature": "Observability Pipelines", + "id": "v2/Observability Pipelines/Validate a metrics pipeline with enrichment table processor file lookup returns \"OK\" response", + "operation_id": "ValidatePipeline", + "request": { + "body": { + "schema": { + "format": null, + "ref": "ObservabilityPipelineSpec", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "config": { + "destinations": [ + { + "id": "datadog-metrics-destination", + "inputs": [ + "my-processor-group" + ], + "type": "datadog_metrics" + } + ], + "pipeline_type": "metrics", + "processor_groups": [ + { + "enabled": true, + "id": "my-processor-group", + "include": "*", + "inputs": [ + "datadog-agent-source" + ], + "processors": [ + { + "enabled": true, + "file": { + "encoding": { + "delimiter": ",", + "includes_headers": true, + "type": "csv" + }, + "key": { + "column": "service", + "source": { + "name": "service", + "type": "tag" + } + }, + "path": "/etc/enrichment/lookup.csv" + }, + "id": "enrichment-table-processor", + "include": "*", + "type": "enrichment_table" + } + ] + } + ], + "sources": [ + { + "id": "datadog-agent-source", + "type": "datadog_agent" + } + ] + }, + "name": "Metrics Pipeline with Enrichment Table File Lookup" + }, + "type": "pipelines" + } + } + }, + "content_type": "application/json", + "method": "POST", + "pagination": false, + "parameters": [], + "path": "/api/v2/obs-pipelines/pipelines/validate" + }, + "scenario": "Validate a metrics pipeline with enrichment table processor file lookup returns \"OK\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/tests/generated-test/test-runner-data/v2/observability-pipelines/validate-a-metrics-pipeline-with-enrichment-table-processor-reference-table-returns-ok-response.json b/tests/generated-test/test-runner-data/v2/observability-pipelines/validate-a-metrics-pipeline-with-enrichment-table-processor-reference-table-returns-ok-response.json new file mode 100644 index 0000000000..a9750587c7 --- /dev/null +++ b/tests/generated-test/test-runner-data/v2/observability-pipelines/validate-a-metrics-pipeline-with-enrichment-table-processor-reference-table-returns-ok-response.json @@ -0,0 +1,81 @@ +{ + "api": "ObservabilityPipelines", + "expected_status": 200, + "feature": "Observability Pipelines", + "id": "v2/Observability Pipelines/Validate a metrics pipeline with enrichment table processor reference table returns \"OK\" response", + "operation_id": "ValidatePipeline", + "request": { + "body": { + "schema": { + "format": null, + "ref": "ObservabilityPipelineSpec", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "config": { + "destinations": [ + { + "id": "datadog-metrics-destination", + "inputs": [ + "my-processor-group" + ], + "type": "datadog_metrics" + } + ], + "pipeline_type": "metrics", + "processor_groups": [ + { + "enabled": true, + "id": "my-processor-group", + "include": "*", + "inputs": [ + "datadog-agent-source" + ], + "processors": [ + { + "enabled": true, + "id": "enrichment-table-processor", + "include": "*", + "reference_table": { + "columns": [ + "environment", + "team" + ], + "key": { + "source": { + "type": "metric_name" + } + }, + "table_id": "metric-enrichment" + }, + "type": "enrichment_table" + } + ] + } + ], + "sources": [ + { + "id": "datadog-agent-source", + "type": "datadog_agent" + } + ] + }, + "name": "Metrics Pipeline with Enrichment Table Reference Table" + }, + "type": "pipelines" + } + } + }, + "content_type": "application/json", + "method": "POST", + "pagination": false, + "parameters": [], + "path": "/api/v2/obs-pipelines/pipelines/validate" + }, + "scenario": "Validate a metrics pipeline with enrichment table processor reference table returns \"OK\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/tests/generated-test/test-server-data/v2/observability-pipelines.json b/tests/generated-test/test-server-data/v2/observability-pipelines.json index 428d57f5b9..5211f2b1d1 100644 --- a/tests/generated-test/test-server-data/v2/observability-pipelines.json +++ b/tests/generated-test/test-server-data/v2/observability-pipelines.json @@ -1205,6 +1205,181 @@ "scenario": "Update a pipeline returns \"OK\" response", "version": "v2" }, + { + "feature": "Observability Pipelines", + "frozen_at": "2026-09-30T13:15:58.810Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "config": { + "destinations": [ + { + "id": "datadog-metrics-destination", + "inputs": [ + "my-processor-group" + ], + "type": "datadog_metrics" + } + ], + "pipeline_type": "metrics", + "processor_groups": [ + { + "enabled": true, + "id": "my-processor-group", + "include": "*", + "inputs": [ + "datadog-agent-source" + ], + "processors": [ + { + "enabled": true, + "file": { + "encoding": { + "delimiter": ",", + "includes_headers": true, + "type": "csv" + }, + "key": { + "column": "service", + "source": { + "name": "service", + "type": "tag" + } + }, + "path": "/etc/enrichment/lookup.csv" + }, + "id": "enrichment-table-processor", + "include": "*", + "type": "enrichment_table" + } + ] + } + ], + "sources": [ + { + "id": "datadog-agent-source", + "type": "datadog_agent" + } + ] + }, + "name": "Metrics Pipeline with Enrichment Table File Lookup" + }, + "type": "pipelines" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/obs-pipelines/pipelines/validate", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[]}\n" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + } + ], + "scenario": "Validate a metrics pipeline with enrichment table processor file lookup returns \"OK\" response", + "version": "v2" + }, + { + "feature": "Observability Pipelines", + "frozen_at": "2026-09-30T13:15:58.904Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "config": { + "destinations": [ + { + "id": "datadog-metrics-destination", + "inputs": [ + "my-processor-group" + ], + "type": "datadog_metrics" + } + ], + "pipeline_type": "metrics", + "processor_groups": [ + { + "enabled": true, + "id": "my-processor-group", + "include": "*", + "inputs": [ + "datadog-agent-source" + ], + "processors": [ + { + "enabled": true, + "id": "enrichment-table-processor", + "include": "*", + "reference_table": { + "columns": [ + "environment", + "team" + ], + "key": { + "source": { + "type": "metric_name" + } + }, + "table_id": "metric-enrichment" + }, + "type": "enrichment_table" + } + ] + } + ], + "sources": [ + { + "id": "datadog-agent-source", + "type": "datadog_agent" + } + ] + }, + "name": "Metrics Pipeline with Enrichment Table Reference Table" + }, + "type": "pipelines" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/obs-pipelines/pipelines/validate", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[]}\n" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + } + ], + "scenario": "Validate a metrics pipeline with enrichment table processor reference table returns \"OK\" response", + "version": "v2" + }, { "feature": "Observability Pipelines", "frozen_at": "2026-03-10T16:11:47.487Z", diff --git a/tests/v2/features/observability_pipelines.feature b/tests/v2/features/observability_pipelines.feature index 78729ae2e8..a25563f62a 100644 --- a/tests/v2/features/observability_pipelines.feature +++ b/tests/v2/features/observability_pipelines.feature @@ -149,6 +149,22 @@ Feature: Observability Pipelines And the response "data.attributes.config.destinations" has length 1 And the response "data.attributes.config.destinations[0].id" is equal to "updated-datadog-logs-destination-id" + @team:DataDog/observability-pipelines + Scenario: Validate a metrics pipeline with enrichment table processor file lookup returns "OK" response + Given new "ValidatePipeline" request + And body with value {"data": {"attributes": {"config": {"pipeline_type": "metrics", "destinations": [{"id": "datadog-metrics-destination", "inputs": ["my-processor-group"], "type": "datadog_metrics"}], "processor_groups": [{"enabled": true, "id": "my-processor-group", "include": "*", "inputs": ["datadog-agent-source"], "processors": [{"enabled": true, "id": "enrichment-table-processor", "include": "*", "type": "enrichment_table", "file": {"encoding": {"delimiter": ",", "type": "csv", "includes_headers": true}, "key": {"column": "service", "source": {"type": "tag", "name": "service"}}, "path": "/etc/enrichment/lookup.csv"}}]}], "sources": [{"id": "datadog-agent-source", "type": "datadog_agent"}]}, "name": "Metrics Pipeline with Enrichment Table File Lookup"}, "type": "pipelines"}} + When the request is sent + Then the response status is 200 OK + And the response "errors" has length 0 + + @team:DataDog/observability-pipelines + Scenario: Validate a metrics pipeline with enrichment table processor reference table returns "OK" response + Given new "ValidatePipeline" request + And body with value {"data": {"attributes": {"config": {"pipeline_type": "metrics", "destinations": [{"id": "datadog-metrics-destination", "inputs": ["my-processor-group"], "type": "datadog_metrics"}], "processor_groups": [{"enabled": true, "id": "my-processor-group", "include": "*", "inputs": ["datadog-agent-source"], "processors": [{"enabled": true, "id": "enrichment-table-processor", "include": "*", "type": "enrichment_table", "reference_table": {"table_id": "metric-enrichment", "key": {"source": {"type": "metric_name"}}, "columns": ["environment", "team"]}}]}], "sources": [{"id": "datadog-agent-source", "type": "datadog_agent"}]}, "name": "Metrics Pipeline with Enrichment Table Reference Table"}, "type": "pipelines"}} + When the request is sent + Then the response status is 200 OK + And the response "errors" has length 0 + @team:DataDog/observability-pipelines Scenario: Validate a metrics pipeline with opentelemetry source returns "OK" response Given new "ValidatePipeline" request