diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 50e579156644..3bec741a1267 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -44821,7 +44821,7 @@ components: Protocol (OTLP) over gRPC and HTTP. - **Supported pipeline types:** logs' + **Supported pipeline types:** logs, metrics' properties: grpc_address_key: description: Environment variable name containing the gRPC server address @@ -44851,6 +44851,7 @@ components: type: object x-pipeline-types: - logs + - metrics ObservabilityPipelineOpentelemetrySourceType: default: opentelemetry description: The source type. The value should always be `opentelemetry`. diff --git a/cassettes/features/v2/observability_pipelines/Validate-a-metrics-pipeline-with-opentelemetry-source-returns-OK-response.frozen b/cassettes/features/v2/observability_pipelines/Validate-a-metrics-pipeline-with-opentelemetry-source-returns-OK-response.frozen new file mode 100644 index 000000000000..9218d08a363b --- /dev/null +++ b/cassettes/features/v2/observability_pipelines/Validate-a-metrics-pipeline-with-opentelemetry-source-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-03-10T16:11:47.487Z \ No newline at end of file diff --git a/cassettes/features/v2/observability_pipelines/Validate-a-metrics-pipeline-with-opentelemetry-source-returns-OK-response.yml b/cassettes/features/v2/observability_pipelines/Validate-a-metrics-pipeline-with-opentelemetry-source-returns-OK-response.yml new file mode 100644 index 000000000000..1c8db742f78a --- /dev/null +++ b/cassettes/features/v2/observability_pipelines/Validate-a-metrics-pipeline-with-opentelemetry-source-returns-OK-response.yml @@ -0,0 +1,27 @@ +http_interactions: +- recorded_at: Tue, 10 Mar 2026 16:11:47 GMT + request: + body: + encoding: UTF-8 + string: '{"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":["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"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/obs-pipelines/pipelines/validate + response: + body: + encoding: UTF-8 + string: '{"errors":[]} + + ' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v2/observability-pipelines/ValidatePipeline_884022323.rb b/examples/v2/observability-pipelines/ValidatePipeline_884022323.rb new file mode 100644 index 000000000000..0a6c3d0e78a5 --- /dev/null +++ b/examples/v2/observability-pipelines/ValidatePipeline_884022323.rb @@ -0,0 +1,50 @@ +# Validate a metrics pipeline with opentelemetry source returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ObservabilityPipelinesAPI.new + +body = DatadogAPIClient::V2::ObservabilityPipelineSpec.new({ + data: DatadogAPIClient::V2::ObservabilityPipelineSpecData.new({ + attributes: DatadogAPIClient::V2::ObservabilityPipelineDataAttributes.new({ + config: DatadogAPIClient::V2::ObservabilityPipelineConfig.new({ + pipeline_type: DatadogAPIClient::V2::ObservabilityPipelineConfigPipelineType::METRICS, + destinations: [ + DatadogAPIClient::V2::ObservabilityPipelineDatadogMetricsDestination.new({ + id: "datadog-metrics-destination", + inputs: [ + "my-processor-group", + ], + type: DatadogAPIClient::V2::ObservabilityPipelineDatadogMetricsDestinationType::DATADOG_METRICS, + }), + ], + processor_groups: [ + DatadogAPIClient::V2::ObservabilityPipelineConfigProcessorGroup.new({ + enabled: true, + id: "my-processor-group", + include: "*", + inputs: [ + "opentelemetry-source", + ], + processors: [ + DatadogAPIClient::V2::ObservabilityPipelineFilterProcessor.new({ + enabled: true, + id: "filter-processor", + include: "env:production", + type: DatadogAPIClient::V2::ObservabilityPipelineFilterProcessorType::FILTER, + }), + ], + }), + ], + sources: [ + DatadogAPIClient::V2::ObservabilityPipelineOpentelemetrySource.new({ + id: "opentelemetry-source", + type: DatadogAPIClient::V2::ObservabilityPipelineOpentelemetrySourceType::OPENTELEMETRY, + }), + ], + }), + name: "Metrics OTel Pipeline", + }), + type: "pipelines", + }), +}) +p api_instance.validate_pipeline(body) diff --git a/features/v2/observability_pipelines.feature b/features/v2/observability_pipelines.feature index bf90c06c1399..e272303955a0 100644 --- a/features/v2/observability_pipelines.feature +++ b/features/v2/observability_pipelines.feature @@ -149,6 +149,14 @@ 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 opentelemetry source 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": ["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"}} + 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 an observability pipeline returns "Bad Request" response Given new "ValidatePipeline" request diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_opentelemetry_source.rb b/lib/datadog_api_client/v2/models/observability_pipeline_opentelemetry_source.rb index 8404b77f9341..6df608ca1081 100644 --- a/lib/datadog_api_client/v2/models/observability_pipeline_opentelemetry_source.rb +++ b/lib/datadog_api_client/v2/models/observability_pipeline_opentelemetry_source.rb @@ -19,7 +19,7 @@ module DatadogAPIClient::V2 # The `opentelemetry` source receives telemetry data using the OpenTelemetry Protocol (OTLP) over gRPC and HTTP. # - # **Supported pipeline types:** logs + # **Supported pipeline types:** logs, metrics class ObservabilityPipelineOpentelemetrySource include BaseGenericModel