Skip to content

Commit f79ff1f

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Adds OpenTelemetry source support for metrics pipelines (DataDog#3054)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 9ff34f8 commit f79ff1f

6 files changed

Lines changed: 89 additions & 2 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44821,7 +44821,7 @@ components:
4482144821
Protocol (OTLP) over gRPC and HTTP.
4482244822

4482344823

44824-
**Supported pipeline types:** logs'
44824+
**Supported pipeline types:** logs, metrics'
4482544825
properties:
4482644826
grpc_address_key:
4482744827
description: Environment variable name containing the gRPC server address
@@ -44851,6 +44851,7 @@ components:
4485144851
type: object
4485244852
x-pipeline-types:
4485344853
- logs
44854+
- metrics
4485444855
ObservabilityPipelineOpentelemetrySourceType:
4485544856
default: opentelemetry
4485644857
description: The source type. The value should always be `opentelemetry`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2026-03-10T16:11:47.487Z

cassettes/features/v2/observability_pipelines/Validate-a-metrics-pipeline-with-opentelemetry-source-returns-OK-response.yml

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Validate a metrics pipeline with opentelemetry source returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::ObservabilityPipelinesAPI.new
5+
6+
body = DatadogAPIClient::V2::ObservabilityPipelineSpec.new({
7+
data: DatadogAPIClient::V2::ObservabilityPipelineSpecData.new({
8+
attributes: DatadogAPIClient::V2::ObservabilityPipelineDataAttributes.new({
9+
config: DatadogAPIClient::V2::ObservabilityPipelineConfig.new({
10+
pipeline_type: DatadogAPIClient::V2::ObservabilityPipelineConfigPipelineType::METRICS,
11+
destinations: [
12+
DatadogAPIClient::V2::ObservabilityPipelineDatadogMetricsDestination.new({
13+
id: "datadog-metrics-destination",
14+
inputs: [
15+
"my-processor-group",
16+
],
17+
type: DatadogAPIClient::V2::ObservabilityPipelineDatadogMetricsDestinationType::DATADOG_METRICS,
18+
}),
19+
],
20+
processor_groups: [
21+
DatadogAPIClient::V2::ObservabilityPipelineConfigProcessorGroup.new({
22+
enabled: true,
23+
id: "my-processor-group",
24+
include: "*",
25+
inputs: [
26+
"opentelemetry-source",
27+
],
28+
processors: [
29+
DatadogAPIClient::V2::ObservabilityPipelineFilterProcessor.new({
30+
enabled: true,
31+
id: "filter-processor",
32+
include: "env:production",
33+
type: DatadogAPIClient::V2::ObservabilityPipelineFilterProcessorType::FILTER,
34+
}),
35+
],
36+
}),
37+
],
38+
sources: [
39+
DatadogAPIClient::V2::ObservabilityPipelineOpentelemetrySource.new({
40+
id: "opentelemetry-source",
41+
type: DatadogAPIClient::V2::ObservabilityPipelineOpentelemetrySourceType::OPENTELEMETRY,
42+
}),
43+
],
44+
}),
45+
name: "Metrics OTel Pipeline",
46+
}),
47+
type: "pipelines",
48+
}),
49+
})
50+
p api_instance.validate_pipeline(body)

features/v2/observability_pipelines.feature

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,14 @@ Feature: Observability Pipelines
149149
And the response "data.attributes.config.destinations" has length 1
150150
And the response "data.attributes.config.destinations[0].id" is equal to "updated-datadog-logs-destination-id"
151151

152+
@team:DataDog/observability-pipelines
153+
Scenario: Validate a metrics pipeline with opentelemetry source returns "OK" response
154+
Given new "ValidatePipeline" request
155+
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": ["opentelemetry-source"], "processors": [{"enabled": true, "id": "filter-processor", "include": "env:production", "type": "filter"}]}], "sources": [{"id": "opentelemetry-source", "type": "opentelemetry"}]}, "name": "Metrics OTel Pipeline"}, "type": "pipelines"}}
156+
When the request is sent
157+
Then the response status is 200 OK
158+
And the response "errors" has length 0
159+
152160
@team:DataDog/observability-pipelines
153161
Scenario: Validate an observability pipeline returns "Bad Request" response
154162
Given new "ValidatePipeline" request

lib/datadog_api_client/v2/models/observability_pipeline_opentelemetry_source.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
module DatadogAPIClient::V2
2020
# The `opentelemetry` source receives telemetry data using the OpenTelemetry Protocol (OTLP) over gRPC and HTTP.
2121
#
22-
# **Supported pipeline types:** logs
22+
# **Supported pipeline types:** logs, metrics
2323
class ObservabilityPipelineOpentelemetrySource
2424
include BaseGenericModel
2525

0 commit comments

Comments
 (0)