Skip to content

Commit 7daacc7

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 6261ff4 of spec repo
1 parent e6af252 commit 7daacc7

21 files changed

Lines changed: 3519 additions & 5 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: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
// Validate a metrics pipeline with enrichment table processor file lookup returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.ObservabilityPipelinesApi;
6+
import com.datadog.api.client.v2.model.ObservabilityPipelineConfig;
7+
import com.datadog.api.client.v2.model.ObservabilityPipelineConfigDestinationItem;
8+
import com.datadog.api.client.v2.model.ObservabilityPipelineConfigPipelineType;
9+
import com.datadog.api.client.v2.model.ObservabilityPipelineConfigProcessorGroup;
10+
import com.datadog.api.client.v2.model.ObservabilityPipelineConfigProcessorItem;
11+
import com.datadog.api.client.v2.model.ObservabilityPipelineConfigSourceItem;
12+
import com.datadog.api.client.v2.model.ObservabilityPipelineDataAttributes;
13+
import com.datadog.api.client.v2.model.ObservabilityPipelineDatadogAgentSource;
14+
import com.datadog.api.client.v2.model.ObservabilityPipelineDatadogAgentSourceType;
15+
import com.datadog.api.client.v2.model.ObservabilityPipelineDatadogMetricsDestination;
16+
import com.datadog.api.client.v2.model.ObservabilityPipelineDatadogMetricsDestinationType;
17+
import com.datadog.api.client.v2.model.ObservabilityPipelineEnrichmentTableFileEncoding;
18+
import com.datadog.api.client.v2.model.ObservabilityPipelineEnrichmentTableFileEncodingType;
19+
import com.datadog.api.client.v2.model.ObservabilityPipelineEnrichmentTableProcessorType;
20+
import com.datadog.api.client.v2.model.ObservabilityPipelineMetricEnrichmentTableFile;
21+
import com.datadog.api.client.v2.model.ObservabilityPipelineMetricEnrichmentTableFileKey;
22+
import com.datadog.api.client.v2.model.ObservabilityPipelineMetricEnrichmentTableFileProcessor;
23+
import com.datadog.api.client.v2.model.ObservabilityPipelineMetricEnrichmentTableLookupSource;
24+
import com.datadog.api.client.v2.model.ObservabilityPipelineMetricEnrichmentTableProcessor;
25+
import com.datadog.api.client.v2.model.ObservabilityPipelineMetricEnrichmentTableTagLookup;
26+
import com.datadog.api.client.v2.model.ObservabilityPipelineMetricEnrichmentTableTagLookupType;
27+
import com.datadog.api.client.v2.model.ObservabilityPipelineSpec;
28+
import com.datadog.api.client.v2.model.ObservabilityPipelineSpecData;
29+
import com.datadog.api.client.v2.model.ValidationResponse;
30+
import java.util.Collections;
31+
32+
public class Example {
33+
public static void main(String[] args) {
34+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
35+
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
36+
ObservabilityPipelinesApi apiInstance = new ObservabilityPipelinesApi(defaultClient);
37+
38+
ObservabilityPipelineSpec body =
39+
new ObservabilityPipelineSpec()
40+
.data(
41+
new ObservabilityPipelineSpecData()
42+
.attributes(
43+
new ObservabilityPipelineDataAttributes()
44+
.config(
45+
new ObservabilityPipelineConfig()
46+
.pipelineType(ObservabilityPipelineConfigPipelineType.METRICS)
47+
.destinations(
48+
Collections.singletonList(
49+
new ObservabilityPipelineConfigDestinationItem(
50+
new ObservabilityPipelineDatadogMetricsDestination()
51+
.id("datadog-metrics-destination")
52+
.inputs(
53+
Collections.singletonList(
54+
"my-processor-group"))
55+
.type(
56+
ObservabilityPipelineDatadogMetricsDestinationType
57+
.DATADOG_METRICS))))
58+
.processorGroups(
59+
Collections.singletonList(
60+
new ObservabilityPipelineConfigProcessorGroup()
61+
.enabled(true)
62+
.id("my-processor-group")
63+
.include("*")
64+
.inputs(
65+
Collections.singletonList(
66+
"datadog-agent-source"))
67+
.processors(
68+
Collections.singletonList(
69+
new ObservabilityPipelineConfigProcessorItem(
70+
new ObservabilityPipelineMetricEnrichmentTableProcessor(
71+
new ObservabilityPipelineMetricEnrichmentTableFileProcessor()
72+
.enabled(true)
73+
.id(
74+
"enrichment-table-processor")
75+
.include("*")
76+
.type(
77+
ObservabilityPipelineEnrichmentTableProcessorType
78+
.ENRICHMENT_TABLE)
79+
.file(
80+
new ObservabilityPipelineMetricEnrichmentTableFile()
81+
.encoding(
82+
new ObservabilityPipelineEnrichmentTableFileEncoding()
83+
.delimiter(",")
84+
.type(
85+
ObservabilityPipelineEnrichmentTableFileEncodingType
86+
.CSV)
87+
.includesHeaders(
88+
true))
89+
.key(
90+
new ObservabilityPipelineMetricEnrichmentTableFileKey()
91+
.column(
92+
"service")
93+
.source(
94+
new ObservabilityPipelineMetricEnrichmentTableLookupSource(
95+
new ObservabilityPipelineMetricEnrichmentTableTagLookup()
96+
.type(
97+
ObservabilityPipelineMetricEnrichmentTableTagLookupType
98+
.TAG)
99+
.name(
100+
"service"))))
101+
.path(
102+
"/etc/enrichment/lookup.csv"))))))))
103+
.sources(
104+
Collections.singletonList(
105+
new ObservabilityPipelineConfigSourceItem(
106+
new ObservabilityPipelineDatadogAgentSource()
107+
.id("datadog-agent-source")
108+
.type(
109+
ObservabilityPipelineDatadogAgentSourceType
110+
.DATADOG_AGENT)))))
111+
.name("Metrics Pipeline with Enrichment Table File Lookup"))
112+
.type("pipelines"));
113+
114+
try {
115+
ValidationResponse result = apiInstance.validatePipeline(body);
116+
System.out.println(result);
117+
} catch (ApiException e) {
118+
System.err.println("Exception when calling ObservabilityPipelinesApi#validatePipeline");
119+
System.err.println("Status code: " + e.getCode());
120+
System.err.println("Reason: " + e.getResponseBody());
121+
System.err.println("Response headers: " + e.getResponseHeaders());
122+
e.printStackTrace();
123+
}
124+
}
125+
}

0 commit comments

Comments
 (0)