Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92151,6 +92151,18 @@ components:
type: string
x-enum-varnames:
- AMAZON_SECURITY_LAKE
ObservabilityPipelineAnomalyDetection:
description: |-
Anomaly detection settings for the pipeline.
Only applies to `logs` pipelines. Requires Observability Pipelines Worker 2.25 or later.
properties:
enabled:
description: Whether anomaly detection is enabled for the pipeline.
example: true
type: boolean
required:
- enabled
type: object
ObservabilityPipelineAwsAuth:
description: |-
AWS authentication credentials used for accessing AWS services such as S3.
Expand Down Expand Up @@ -92831,12 +92843,20 @@ components:
ObservabilityPipelineConfig:
description: Specifies the pipeline's configuration, including its sources, processors, and destinations.
properties:
anomaly_detection:
$ref: "#/components/schemas/ObservabilityPipelineAnomalyDetection"
destinations:
description: A list of destination components where processed logs are sent.
example: [{"id": "datadog-logs-destination", "inputs": ["my-processor-group"], "type": "datadog_logs"}]
items:
$ref: "#/components/schemas/ObservabilityPipelineConfigDestinationItem"
type: array
end_to_end_acknowledgements:
description: |-
Set to `true` to enable end-to-end acknowledgments for the pipeline.
Requires Observability Pipelines Worker 2.14 or later.
example: false
type: boolean
pipeline_type:
$ref: "#/components/schemas/ObservabilityPipelineConfigPipelineType"
processor_groups:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations


from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
)


class ObservabilityPipelineAnomalyDetection(ModelNormal):
@cached_property
def openapi_types(_):
return {
"enabled": (bool,),
}

attribute_map = {
"enabled": "enabled",
}

def __init__(self_, enabled: bool, **kwargs):
"""
Anomaly detection settings for the pipeline.
Only applies to ``logs`` pipelines. Requires Observability Pipelines Worker 2.25 or later.

:param enabled: Whether anomaly detection is enabled for the pipeline.
:type enabled: bool
"""
super().__init__(kwargs)

self_.enabled = enabled
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@


if TYPE_CHECKING:
from datadog_api_client.v2.model.observability_pipeline_anomaly_detection import (
ObservabilityPipelineAnomalyDetection,
)
from datadog_api_client.v2.model.observability_pipeline_config_destination_item import (
ObservabilityPipelineConfigDestinationItem,
)
Expand Down Expand Up @@ -161,6 +164,9 @@
class ObservabilityPipelineConfig(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.observability_pipeline_anomaly_detection import (
ObservabilityPipelineAnomalyDetection,
)
from datadog_api_client.v2.model.observability_pipeline_config_destination_item import (
ObservabilityPipelineConfigDestinationItem,
)
Expand All @@ -175,7 +181,9 @@ def openapi_types(_):
)

return {
"anomaly_detection": (ObservabilityPipelineAnomalyDetection,),
"destinations": ([ObservabilityPipelineConfigDestinationItem],),
"end_to_end_acknowledgements": (bool,),
"pipeline_type": (ObservabilityPipelineConfigPipelineType,),
"processor_groups": ([ObservabilityPipelineConfigProcessorGroup],),
"processors": ([ObservabilityPipelineConfigProcessorGroup],),
Expand All @@ -184,7 +192,9 @@ def openapi_types(_):
}

attribute_map = {
"anomaly_detection": "anomaly_detection",
"destinations": "destinations",
"end_to_end_acknowledgements": "end_to_end_acknowledgements",
"pipeline_type": "pipeline_type",
"processor_groups": "processor_groups",
"processors": "processors",
Expand Down Expand Up @@ -254,6 +264,8 @@ def __init__(
ObservabilityPipelinePrometheusRemoteWriteSource,
]
],
anomaly_detection: Union[ObservabilityPipelineAnomalyDetection, UnsetType] = unset,
end_to_end_acknowledgements: Union[bool, UnsetType] = unset,
pipeline_type: Union[ObservabilityPipelineConfigPipelineType, UnsetType] = unset,
processor_groups: Union[List[ObservabilityPipelineConfigProcessorGroup], UnsetType] = unset,
processors: Union[List[ObservabilityPipelineConfigProcessorGroup], UnsetType] = unset,
Expand All @@ -263,9 +275,17 @@ def __init__(
"""
Specifies the pipeline's configuration, including its sources, processors, and destinations.

:param anomaly_detection: Anomaly detection settings for the pipeline.
Only applies to ``logs`` pipelines. Requires Observability Pipelines Worker 2.25 or later.
:type anomaly_detection: ObservabilityPipelineAnomalyDetection, optional

:param destinations: A list of destination components where processed logs are sent.
:type destinations: [ObservabilityPipelineConfigDestinationItem]

:param end_to_end_acknowledgements: Set to ``true`` to enable end-to-end acknowledgments for the pipeline.
Requires Observability Pipelines Worker 2.14 or later.
:type end_to_end_acknowledgements: bool, optional

:param pipeline_type: The type of data being ingested. Defaults to ``logs`` if not specified.
:type pipeline_type: ObservabilityPipelineConfigPipelineType, optional

Expand All @@ -287,6 +307,10 @@ def __init__(
See `Upgrade Your Filter Queries to the New Search Syntax <https://docs.datadoghq.com/observability_pipelines/guide/upgrade_your_filter_queries_to_the_new_search_syntax/>`_ for more information.
:type use_legacy_search_syntax: bool, optional
"""
if anomaly_detection is not unset:
kwargs["anomaly_detection"] = anomaly_detection
if end_to_end_acknowledgements is not unset:
kwargs["end_to_end_acknowledgements"] = end_to_end_acknowledgements
if pipeline_type is not unset:
kwargs["pipeline_type"] = pipeline_type
if processor_groups is not unset:
Expand Down
2 changes: 2 additions & 0 deletions src/datadog_api_client/v2/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7490,6 +7490,7 @@
from datadog_api_client.v2.model.observability_pipeline_amazon_security_lake_destination_type import (
ObservabilityPipelineAmazonSecurityLakeDestinationType,
)
from datadog_api_client.v2.model.observability_pipeline_anomaly_detection import ObservabilityPipelineAnomalyDetection
from datadog_api_client.v2.model.observability_pipeline_aws_auth import ObservabilityPipelineAwsAuth
from datadog_api_client.v2.model.observability_pipeline_azure_data_explorer_destination import (
ObservabilityPipelineAzureDataExplorerDestination,
Expand Down Expand Up @@ -19148,6 +19149,7 @@
"ObservabilityPipelineAmazonS3SourceType",
"ObservabilityPipelineAmazonSecurityLakeDestination",
"ObservabilityPipelineAmazonSecurityLakeDestinationType",
"ObservabilityPipelineAnomalyDetection",
"ObservabilityPipelineAwsAuth",
"ObservabilityPipelineAzureDataExplorerDestination",
"ObservabilityPipelineAzureDataExplorerDestinationAuth",
Expand Down
4 changes: 2 additions & 2 deletions tests/v2/features/observability_pipelines.feature
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Feature: Observability Pipelines
@generated @skip @team:ddoghq/observability-pipelines
Scenario: Create a new pipeline returns "Conflict" response
Given new "CreatePipeline" request
And body with value {"data": {"attributes": {"config": {"destinations": [{"id": "datadog-logs-destination", "inputs": ["my-processor-group"], "type": "datadog_logs"}], "pipeline_type": "logs", "processor_groups": [{"enabled": true, "id": "my-processor-group", "include": "service:my-service", "inputs": ["datadog-agent-source"], "processors": [{"enabled": true, "id": "filter-processor", "include": "status:error", "type": "filter"}, {"enabled": true, "field": "message", "id": "json-processor", "include": "*", "type": "parse_json"}]}], "processors": [], "sources": [{"id": "datadog-agent-source", "type": "datadog_agent"}]}, "name": "Main Observability Pipeline"}, "type": "pipelines"}}
And body with value {"data": {"attributes": {"config": {"anomaly_detection": {"enabled": true}, "destinations": [{"id": "datadog-logs-destination", "inputs": ["my-processor-group"], "type": "datadog_logs"}], "end_to_end_acknowledgements": false, "pipeline_type": "logs", "processor_groups": [{"enabled": true, "id": "my-processor-group", "include": "service:my-service", "inputs": ["datadog-agent-source"], "processors": [{"enabled": true, "id": "filter-processor", "include": "status:error", "type": "filter"}, {"enabled": true, "field": "message", "id": "json-processor", "include": "*", "type": "parse_json"}]}], "processors": [], "sources": [{"id": "datadog-agent-source", "type": "datadog_agent"}]}, "name": "Main Observability Pipeline"}, "type": "pipelines"}}
When the request is sent
Then the response status is 409 Conflict

Expand Down Expand Up @@ -123,7 +123,7 @@ Feature: Observability Pipelines
Scenario: Update a pipeline returns "Conflict" response
Given new "UpdatePipeline" request
And request contains "pipeline_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"config": {"destinations": [{"id": "datadog-logs-destination", "inputs": ["my-processor-group"], "type": "datadog_logs"}], "pipeline_type": "logs", "processor_groups": [{"enabled": true, "id": "my-processor-group", "include": "service:my-service", "inputs": ["datadog-agent-source"], "processors": [{"enabled": true, "id": "filter-processor", "include": "status:error", "type": "filter"}, {"enabled": true, "field": "message", "id": "json-processor", "include": "*", "type": "parse_json"}]}], "processors": [], "sources": [{"id": "datadog-agent-source", "type": "datadog_agent"}]}, "name": "Main Observability Pipeline"}, "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "pipelines"}}
And body with value {"data": {"attributes": {"config": {"anomaly_detection": {"enabled": true}, "destinations": [{"id": "datadog-logs-destination", "inputs": ["my-processor-group"], "type": "datadog_logs"}], "end_to_end_acknowledgements": false, "pipeline_type": "logs", "processor_groups": [{"enabled": true, "id": "my-processor-group", "include": "service:my-service", "inputs": ["datadog-agent-source"], "processors": [{"enabled": true, "id": "filter-processor", "include": "status:error", "type": "filter"}, {"enabled": true, "field": "message", "id": "json-processor", "include": "*", "type": "parse_json"}]}], "processors": [], "sources": [{"id": "datadog-agent-source", "type": "datadog_agent"}]}, "name": "Main Observability Pipeline"}, "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "pipelines"}}
When the request is sent
Then the response status is 409 Conflict

Expand Down
Loading