Skip to content

Commit 8132c23

Browse files
dd-octo-sts[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 6261ff4 of spec repo (#4084)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 0d962da commit 8132c23

23 files changed

Lines changed: 1590 additions & 0 deletions

‎.generator/schemas/v2/openapi.yaml‎

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76346,6 +76346,7 @@ components:
7634676346
- $ref: "#/components/schemas/ObservabilityPipelineThrottleProcessor"
7634776347
- $ref: "#/components/schemas/ObservabilityPipelineAddMetricTagsProcessor"
7634876348
- $ref: "#/components/schemas/ObservabilityPipelineAggregateProcessor"
76349+
- $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableProcessor"
7634976350
- $ref: "#/components/schemas/ObservabilityPipelineMetricTagsProcessor"
7635076351
- $ref: "#/components/schemas/ObservabilityPipelineRenameMetricTagsProcessor"
7635176352
- $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessor"
@@ -78491,6 +78492,187 @@ components:
7849178492
- name
7849278493
- value
7849378494
type: object
78495+
ObservabilityPipelineMetricEnrichmentTableFile:
78496+
description: Defines a static enrichment table loaded from a CSV file for metric enrichment.
78497+
properties:
78498+
encoding:
78499+
$ref: "#/components/schemas/ObservabilityPipelineEnrichmentTableFileEncoding"
78500+
key:
78501+
$ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableFileKey"
78502+
path:
78503+
description: Path to the CSV file.
78504+
example: /etc/enrichment/lookup.csv
78505+
type: string
78506+
required:
78507+
- encoding
78508+
- key
78509+
- path
78510+
type: object
78511+
ObservabilityPipelineMetricEnrichmentTableFileKey:
78512+
description: Defines how to map a metric lookup value to a CSV column during enrichment table lookups.
78513+
properties:
78514+
column:
78515+
description: The CSV column name or index to match against the lookup value.
78516+
example: service
78517+
type: string
78518+
source:
78519+
$ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableLookupSource"
78520+
required:
78521+
- column
78522+
- source
78523+
type: object
78524+
ObservabilityPipelineMetricEnrichmentTableFileProcessor:
78525+
description: An `enrichment_table` processor that enriches metrics using a static CSV file.
78526+
properties:
78527+
display_name:
78528+
$ref: "#/components/schemas/ObservabilityPipelineComponentDisplayName"
78529+
enabled:
78530+
description: Indicates whether the processor is enabled.
78531+
example: true
78532+
type: boolean
78533+
file:
78534+
$ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableFile"
78535+
id:
78536+
description: |-
78537+
The unique identifier for this component. Used in other parts of the pipeline to reference this component
78538+
(for example, as the `input` to downstream components).
78539+
example: enrichment-table-processor
78540+
type: string
78541+
include:
78542+
description: A Datadog search query used to determine which metrics this processor targets.
78543+
example: "*"
78544+
type: string
78545+
type:
78546+
$ref: "#/components/schemas/ObservabilityPipelineEnrichmentTableProcessorType"
78547+
required:
78548+
- id
78549+
- type
78550+
- include
78551+
- file
78552+
- enabled
78553+
type: object
78554+
ObservabilityPipelineMetricEnrichmentTableLookupSource:
78555+
description: |-
78556+
Specifies the source of the key value used for metric enrichment table lookups.
78557+
The lookup key can be either the metric name or a metric tag.
78558+
oneOf:
78559+
- $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableMetricNameLookup"
78560+
- $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableTagLookup"
78561+
ObservabilityPipelineMetricEnrichmentTableMetricNameLookup:
78562+
description: Uses the metric name as the lookup key for enrichment table matching.
78563+
properties:
78564+
type:
78565+
$ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType"
78566+
required:
78567+
- type
78568+
type: object
78569+
ObservabilityPipelineMetricEnrichmentTableMetricNameLookupType:
78570+
default: metric_name
78571+
description: The lookup source type. The value should always be `metric_name`.
78572+
enum: [metric_name]
78573+
example: metric_name
78574+
type: string
78575+
x-enum-varnames:
78576+
- METRIC_NAME
78577+
ObservabilityPipelineMetricEnrichmentTableProcessor:
78578+
description: |-
78579+
The `enrichment_table` processor enriches metrics with tags from a static CSV file or a Datadog reference table.
78580+
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
78581+
metric tag, overwriting any existing tag with the same key. Exactly one of `file` or `reference_table` must be
78582+
configured.
78583+
78584+
**Supported pipeline types:** metrics
78585+
oneOf:
78586+
- $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableFileProcessor"
78587+
- $ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor"
78588+
x-pipeline-types: [metrics]
78589+
ObservabilityPipelineMetricEnrichmentTableReferenceKey:
78590+
description: Defines the metric lookup value used as the reference-table row ID.
78591+
properties:
78592+
source:
78593+
$ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableLookupSource"
78594+
required:
78595+
- source
78596+
type: object
78597+
ObservabilityPipelineMetricEnrichmentTableReferenceTable:
78598+
description: Uses a Datadog reference table to enrich metrics.
78599+
properties:
78600+
app_key_key:
78601+
description: |-
78602+
The name of the environment variable or secret that holds the Datadog application key used to access the
78603+
reference table.
78604+
example: DD_APP_KEY
78605+
type: string
78606+
columns:
78607+
description: |-
78608+
A list of column names to include from the reference table. If not provided, all columns are included.
78609+
items:
78610+
description: The name of a column to include from the reference table.
78611+
type: string
78612+
maxItems: 50
78613+
type: array
78614+
key:
78615+
$ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableReferenceKey"
78616+
table_id:
78617+
description: The unique identifier of the reference table.
78618+
example: 550e8400-e29b-41d4-a716-446655440000
78619+
type: string
78620+
required:
78621+
- key
78622+
- table_id
78623+
type: object
78624+
ObservabilityPipelineMetricEnrichmentTableReferenceTableProcessor:
78625+
description: An `enrichment_table` processor that enriches metrics using a Datadog reference table.
78626+
properties:
78627+
display_name:
78628+
$ref: "#/components/schemas/ObservabilityPipelineComponentDisplayName"
78629+
enabled:
78630+
description: Indicates whether the processor is enabled.
78631+
example: true
78632+
type: boolean
78633+
id:
78634+
description: |-
78635+
The unique identifier for this component. Used in other parts of the pipeline to reference this component
78636+
(for example, as the `input` to downstream components).
78637+
example: enrichment-table-processor
78638+
type: string
78639+
include:
78640+
description: A Datadog search query used to determine which metrics this processor targets.
78641+
example: "*"
78642+
type: string
78643+
reference_table:
78644+
$ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableReferenceTable"
78645+
type:
78646+
$ref: "#/components/schemas/ObservabilityPipelineEnrichmentTableProcessorType"
78647+
required:
78648+
- id
78649+
- type
78650+
- include
78651+
- reference_table
78652+
- enabled
78653+
type: object
78654+
ObservabilityPipelineMetricEnrichmentTableTagLookup:
78655+
description: Uses a metric tag as the lookup key for enrichment table matching.
78656+
properties:
78657+
name:
78658+
description: The Datadog tag key used as the lookup key.
78659+
example: service
78660+
maxLength: 200
78661+
type: string
78662+
type:
78663+
$ref: "#/components/schemas/ObservabilityPipelineMetricEnrichmentTableTagLookupType"
78664+
required:
78665+
- type
78666+
- name
78667+
type: object
78668+
ObservabilityPipelineMetricEnrichmentTableTagLookupType:
78669+
default: tag
78670+
description: The lookup source type. The value should always be `tag`.
78671+
enum: [tag]
78672+
example: tag
78673+
type: string
78674+
x-enum-varnames:
78675+
- TAG
7849478676
ObservabilityPipelineMetricTagsProcessor:
7849578677
description: |-
7849678678
The `metric_tags` processor filters metrics based on their tags using Datadog tag key patterns.
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
"""
2+
Validate a metrics pipeline with enrichment table processor file lookup returns "OK" response
3+
"""
4+
5+
from os import environ
6+
from datadog_api_client import ApiClient, Configuration
7+
from datadog_api_client.v2.api.observability_pipelines_api import ObservabilityPipelinesApi
8+
from datadog_api_client.v2.model.observability_pipeline_config import ObservabilityPipelineConfig
9+
from datadog_api_client.v2.model.observability_pipeline_config_pipeline_type import (
10+
ObservabilityPipelineConfigPipelineType,
11+
)
12+
from datadog_api_client.v2.model.observability_pipeline_config_processor_group import (
13+
ObservabilityPipelineConfigProcessorGroup,
14+
)
15+
from datadog_api_client.v2.model.observability_pipeline_data_attributes import ObservabilityPipelineDataAttributes
16+
from datadog_api_client.v2.model.observability_pipeline_datadog_agent_source import (
17+
ObservabilityPipelineDatadogAgentSource,
18+
)
19+
from datadog_api_client.v2.model.observability_pipeline_datadog_agent_source_type import (
20+
ObservabilityPipelineDatadogAgentSourceType,
21+
)
22+
from datadog_api_client.v2.model.observability_pipeline_datadog_metrics_destination import (
23+
ObservabilityPipelineDatadogMetricsDestination,
24+
)
25+
from datadog_api_client.v2.model.observability_pipeline_datadog_metrics_destination_type import (
26+
ObservabilityPipelineDatadogMetricsDestinationType,
27+
)
28+
from datadog_api_client.v2.model.observability_pipeline_enrichment_table_file_encoding import (
29+
ObservabilityPipelineEnrichmentTableFileEncoding,
30+
)
31+
from datadog_api_client.v2.model.observability_pipeline_enrichment_table_file_encoding_type import (
32+
ObservabilityPipelineEnrichmentTableFileEncodingType,
33+
)
34+
from datadog_api_client.v2.model.observability_pipeline_enrichment_table_processor_type import (
35+
ObservabilityPipelineEnrichmentTableProcessorType,
36+
)
37+
from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_file import (
38+
ObservabilityPipelineMetricEnrichmentTableFile,
39+
)
40+
from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_file_key import (
41+
ObservabilityPipelineMetricEnrichmentTableFileKey,
42+
)
43+
from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_file_processor import (
44+
ObservabilityPipelineMetricEnrichmentTableFileProcessor,
45+
)
46+
from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_tag_lookup import (
47+
ObservabilityPipelineMetricEnrichmentTableTagLookup,
48+
)
49+
from datadog_api_client.v2.model.observability_pipeline_metric_enrichment_table_tag_lookup_type import (
50+
ObservabilityPipelineMetricEnrichmentTableTagLookupType,
51+
)
52+
from datadog_api_client.v2.model.observability_pipeline_spec import ObservabilityPipelineSpec
53+
from datadog_api_client.v2.model.observability_pipeline_spec_data import ObservabilityPipelineSpecData
54+
55+
body = ObservabilityPipelineSpec(
56+
data=ObservabilityPipelineSpecData(
57+
attributes=ObservabilityPipelineDataAttributes(
58+
config=ObservabilityPipelineConfig(
59+
pipeline_type=ObservabilityPipelineConfigPipelineType.METRICS,
60+
destinations=[
61+
ObservabilityPipelineDatadogMetricsDestination(
62+
id="datadog-metrics-destination",
63+
inputs=[
64+
"my-processor-group",
65+
],
66+
type=ObservabilityPipelineDatadogMetricsDestinationType.DATADOG_METRICS,
67+
),
68+
],
69+
processor_groups=[
70+
ObservabilityPipelineConfigProcessorGroup(
71+
enabled=True,
72+
id="my-processor-group",
73+
include="*",
74+
inputs=[
75+
"datadog-agent-source",
76+
],
77+
processors=[
78+
ObservabilityPipelineMetricEnrichmentTableFileProcessor(
79+
enabled=True,
80+
id="enrichment-table-processor",
81+
include="*",
82+
type=ObservabilityPipelineEnrichmentTableProcessorType.ENRICHMENT_TABLE,
83+
file=ObservabilityPipelineMetricEnrichmentTableFile(
84+
encoding=ObservabilityPipelineEnrichmentTableFileEncoding(
85+
delimiter=",",
86+
type=ObservabilityPipelineEnrichmentTableFileEncodingType.CSV,
87+
includes_headers=True,
88+
),
89+
key=ObservabilityPipelineMetricEnrichmentTableFileKey(
90+
column="service",
91+
source=ObservabilityPipelineMetricEnrichmentTableTagLookup(
92+
type=ObservabilityPipelineMetricEnrichmentTableTagLookupType.TAG,
93+
name="service",
94+
),
95+
),
96+
path="/etc/enrichment/lookup.csv",
97+
),
98+
),
99+
],
100+
),
101+
],
102+
sources=[
103+
ObservabilityPipelineDatadogAgentSource(
104+
id="datadog-agent-source",
105+
type=ObservabilityPipelineDatadogAgentSourceType.DATADOG_AGENT,
106+
),
107+
],
108+
),
109+
name="Metrics Pipeline with Enrichment Table File Lookup",
110+
),
111+
type="pipelines",
112+
),
113+
)
114+
115+
configuration = Configuration()
116+
configuration.access_token = environ["DD_BEARER_TOKEN"]
117+
with ApiClient(configuration) as api_client:
118+
api_instance = ObservabilityPipelinesApi(api_client)
119+
response = api_instance.validate_pipeline(body=body)
120+
121+
print(response)

0 commit comments

Comments
 (0)