diff --git a/.generated-info b/.generated-info index 7d31455ea..4286bf4c0 100644 --- a/.generated-info +++ b/.generated-info @@ -1,4 +1,4 @@ { - "spec_repo_commit": "b75095c", - "generated": "2025-07-31 10:50:58.895" + "spec_repo_commit": "b14c9da", + "generated": "2025-07-31 15:36:46.970" } diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b125b71c6..ab031f4a8 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -27480,6 +27480,16 @@ components: description: The `sample` processor allows probabilistic sampling of logs at a fixed rate. properties: + group_by: + description: Optional list of fields to group events by. Each group will + be sampled independently + example: + - service + - host + items: + type: string + minItems: 1 + type: array id: description: The unique identifier for this component. Used to reference this component in other parts of the pipeline (for example, as the `input` diff --git a/src/datadogV2/model/model_observability_pipeline_sample_processor.rs b/src/datadogV2/model/model_observability_pipeline_sample_processor.rs index d3365d06f..0f389098d 100644 --- a/src/datadogV2/model/model_observability_pipeline_sample_processor.rs +++ b/src/datadogV2/model/model_observability_pipeline_sample_processor.rs @@ -11,6 +11,9 @@ use std::fmt::{self, Formatter}; #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] pub struct ObservabilityPipelineSampleProcessor { + /// Optional list of fields to group events by. Each group will be sampled independently + #[serde(rename = "group_by")] + pub group_by: Option>, /// The unique identifier for this component. Used to reference this component in other parts of the pipeline (for example, as the `input` to downstream components). #[serde(rename = "id")] pub id: String, @@ -44,6 +47,7 @@ impl ObservabilityPipelineSampleProcessor { type_: crate::datadogV2::model::ObservabilityPipelineSampleProcessorType, ) -> ObservabilityPipelineSampleProcessor { ObservabilityPipelineSampleProcessor { + group_by: None, id, include, inputs, @@ -55,6 +59,11 @@ impl ObservabilityPipelineSampleProcessor { } } + pub fn group_by(mut self, value: Vec) -> Self { + self.group_by = Some(value); + self + } + pub fn percentage(mut self, value: f64) -> Self { self.percentage = Some(value); self @@ -91,6 +100,7 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineSampleProcessor { where M: MapAccess<'a>, { + let mut group_by: Option> = None; let mut id: Option = None; let mut include: Option = None; let mut inputs: Option> = None; @@ -107,6 +117,12 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineSampleProcessor { while let Some((k, v)) = map.next_entry::()? { match k.as_str() { + "group_by" => { + if v.is_null() { + continue; + } + group_by = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } "id" => { id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } @@ -152,6 +168,7 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineSampleProcessor { let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; let content = ObservabilityPipelineSampleProcessor { + group_by, id, include, inputs,