Skip to content

Commit 3adf7d9

Browse files
dd-octo-sts[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 7feba9d of spec repo (#4180)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 4f84717 commit 3adf7d9

21 files changed

Lines changed: 1435 additions & 0 deletions

‎.generator/schemas/v2/openapi.yaml‎

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86022,6 +86022,7 @@ components:
8602286022
- $ref: "#/components/schemas/ObservabilityPipelineReduceProcessor"
8602386023
- $ref: "#/components/schemas/ObservabilityPipelineRemoveFieldsProcessor"
8602486024
- $ref: "#/components/schemas/ObservabilityPipelineRenameFieldsProcessor"
86025+
- $ref: "#/components/schemas/ObservabilityPipelineSpikeProtectionProcessor"
8602586026
- $ref: "#/components/schemas/ObservabilityPipelineSplitArrayProcessor"
8602686027
- $ref: "#/components/schemas/ObservabilityPipelineThrottleProcessor"
8602786028
- $ref: "#/components/schemas/ObservabilityPipelineCustomProcessor"
@@ -90514,6 +90515,169 @@ components:
9051490515
- type
9051590516
- attributes
9051690517
type: object
90518+
ObservabilityPipelineSpikeProtectionProcessor:
90519+
description: |-
90520+
The `spike_protection` processor learns the normal ingestion volume for the logs that match a specified filter and takes action when the volume spikes unexpectedly.
90521+
90522+
**Supported pipeline types:** logs
90523+
properties:
90524+
action_when_missing_partitions:
90525+
$ref: "#/components/schemas/ObservabilityPipelineSpikeProtectionProcessorActionWhenMissingPartitions"
90526+
display_name:
90527+
$ref: "#/components/schemas/ObservabilityPipelineComponentDisplayName"
90528+
enabled:
90529+
description: Indicates whether the processor is enabled.
90530+
example: true
90531+
type: boolean
90532+
id:
90533+
description: The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components).
90534+
example: "spike-protection-processor"
90535+
type: string
90536+
include:
90537+
description: A Datadog search query used to determine which logs this processor targets.
90538+
example: "service:my-service"
90539+
type: string
90540+
minimal_threshold:
90541+
description: The minimum volume, in bytes, that must be observed within 24 hours before spike protection can activate. Defaults to 100 GiB.
90542+
example: 107374182400
90543+
format: int64
90544+
type: integer
90545+
minimal_threshold_overrides:
90546+
description: A list of per-partition overrides for the minimal threshold, identified by matching field values. Requires `partition_fields` to be set.
90547+
items:
90548+
$ref: "#/components/schemas/ObservabilityPipelineSpikeProtectionProcessorThresholdOverride"
90549+
type: array
90550+
name:
90551+
description: Name of the spike protection rule.
90552+
example: MySpikeProtection
90553+
type: string
90554+
partition_fields:
90555+
description: A list of fields used to segment log traffic. Volume is learned and evaluated independently for each unique combination of these field values. A maximum of five fields is supported.
90556+
items:
90557+
description: The name of a log field used to partition spike detection.
90558+
maxLength: 128
90559+
type: string
90560+
maxItems: 5
90561+
type: array
90562+
uniqueItems: true
90563+
spike_action:
90564+
$ref: "#/components/schemas/ObservabilityPipelineSpikeProtectionProcessorSpikeAction"
90565+
spike_threshold:
90566+
description: The number of standard deviations above the learned mean volume that must be exceeded before a spike is detected. Defaults to `5`.
90567+
example: 5
90568+
format: double
90569+
type: number
90570+
type:
90571+
$ref: "#/components/schemas/ObservabilityPipelineSpikeProtectionProcessorType"
90572+
required:
90573+
- id
90574+
- type
90575+
- include
90576+
- name
90577+
- spike_action
90578+
- enabled
90579+
type: object
90580+
x-pipeline-types: [logs]
90581+
ObservabilityPipelineSpikeProtectionProcessorActionWhenMissingPartitions:
90582+
default: ignore
90583+
description: |-
90584+
How to handle logs that are missing one of the `partition_fields`. Options:
90585+
- `ignore`: Forward the event without applying spike protection.
90586+
- `default_bucket`: Assign the event to a default partition.
90587+
enum:
90588+
- ignore
90589+
- default_bucket
90590+
example: ignore
90591+
type: string
90592+
x-enum-varnames:
90593+
- IGNORE
90594+
- DEFAULT_BUCKET
90595+
ObservabilityPipelineSpikeProtectionProcessorMinimalThreshold:
90596+
description: The minimal threshold to apply to the matching partition.
90597+
oneOf:
90598+
- $ref: "#/components/schemas/ObservabilityPipelineSpikeProtectionProcessorMinimalThresholdBytes"
90599+
- $ref: "#/components/schemas/ObservabilityPipelineSpikeProtectionProcessorMinimalThresholdAlwaysKeep"
90600+
ObservabilityPipelineSpikeProtectionProcessorMinimalThresholdAlwaysKeep:
90601+
description: Never activates spike protection for the matching partition, regardless of volume.
90602+
properties:
90603+
type:
90604+
$ref: "#/components/schemas/ObservabilityPipelineSpikeProtectionProcessorMinimalThresholdAlwaysKeepType"
90605+
required:
90606+
- type
90607+
type: object
90608+
ObservabilityPipelineSpikeProtectionProcessorMinimalThresholdAlwaysKeepType:
90609+
default: always_keep
90610+
description: The minimal threshold type. The value should always be `always_keep`.
90611+
enum:
90612+
- always_keep
90613+
example: always_keep
90614+
type: string
90615+
x-enum-varnames:
90616+
- ALWAYS_KEEP
90617+
ObservabilityPipelineSpikeProtectionProcessorMinimalThresholdBytes:
90618+
description: Sets a specific byte threshold for the matching partition.
90619+
properties:
90620+
bytes:
90621+
description: The minimal threshold, in bytes, for the matching partition.
90622+
example: 107374182400
90623+
format: int64
90624+
type: integer
90625+
type:
90626+
$ref: "#/components/schemas/ObservabilityPipelineSpikeProtectionProcessorMinimalThresholdBytesType"
90627+
required:
90628+
- type
90629+
- bytes
90630+
type: object
90631+
ObservabilityPipelineSpikeProtectionProcessorMinimalThresholdBytesType:
90632+
default: threshold
90633+
description: The minimal threshold type. The value should always be `threshold`.
90634+
enum:
90635+
- threshold
90636+
example: threshold
90637+
type: string
90638+
x-enum-varnames:
90639+
- THRESHOLD
90640+
ObservabilityPipelineSpikeProtectionProcessorSpikeAction:
90641+
description: |-
90642+
The action to take with matching logs while spike protection is active. Options:
90643+
- `drop`: Drop the event.
90644+
- `no_action`: Let the event pass through.
90645+
- `overflow_routing`: Route to an overflow destination.
90646+
90647+
When `overflow_routing` is used, there must be a destination whose `inputs` reference this processor with the `<processor-id>.overflow_events` suffix to route the overflowing events.
90648+
enum:
90649+
- drop
90650+
- no_action
90651+
- overflow_routing
90652+
example: drop
90653+
type: string
90654+
x-enum-varnames:
90655+
- DROP
90656+
- NO_ACTION
90657+
- OVERFLOW_ROUTING
90658+
ObservabilityPipelineSpikeProtectionProcessorThresholdOverride:
90659+
description: Defines a minimal threshold that applies to a specific partition instead of the processor-wide `minimal_threshold`.
90660+
properties:
90661+
fields:
90662+
description: The set of field matchers that identifies the partition this override applies to. Every field name listed must also appear in `partition_fields`.
90663+
items:
90664+
$ref: "#/components/schemas/ObservabilityPipelineFieldValue"
90665+
type: array
90666+
minimal_threshold:
90667+
$ref: "#/components/schemas/ObservabilityPipelineSpikeProtectionProcessorMinimalThreshold"
90668+
required:
90669+
- fields
90670+
- minimal_threshold
90671+
type: object
90672+
ObservabilityPipelineSpikeProtectionProcessorType:
90673+
default: spike_protection
90674+
description: The processor type. The value should always be `spike_protection`.
90675+
enum:
90676+
- spike_protection
90677+
example: spike_protection
90678+
type: string
90679+
x-enum-varnames:
90680+
- SPIKE_PROTECTION
9051790681
ObservabilityPipelineSplitArrayProcessor:
9051890682
description: |-
9051990683
The `split_array` processor splits array fields into separate events based on configured rules.
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
"""
2+
Validate an observability pipeline with spike protection processor threshold overrides returns "OK" response
3+
"""
4+
5+
from os import environ
6+
from datadog_api_client import ApiClient, Configuration
7+
from datadog_api_client.v2.api.observability_pipelines_api import ObservabilityPipelinesApi
8+
from datadog_api_client.v2.model.observability_pipeline_config import ObservabilityPipelineConfig
9+
from datadog_api_client.v2.model.observability_pipeline_config_processor_group import (
10+
ObservabilityPipelineConfigProcessorGroup,
11+
)
12+
from datadog_api_client.v2.model.observability_pipeline_data_attributes import ObservabilityPipelineDataAttributes
13+
from datadog_api_client.v2.model.observability_pipeline_datadog_agent_source import (
14+
ObservabilityPipelineDatadogAgentSource,
15+
)
16+
from datadog_api_client.v2.model.observability_pipeline_datadog_agent_source_type import (
17+
ObservabilityPipelineDatadogAgentSourceType,
18+
)
19+
from datadog_api_client.v2.model.observability_pipeline_datadog_logs_destination import (
20+
ObservabilityPipelineDatadogLogsDestination,
21+
)
22+
from datadog_api_client.v2.model.observability_pipeline_datadog_logs_destination_type import (
23+
ObservabilityPipelineDatadogLogsDestinationType,
24+
)
25+
from datadog_api_client.v2.model.observability_pipeline_field_value import ObservabilityPipelineFieldValue
26+
from datadog_api_client.v2.model.observability_pipeline_spec import ObservabilityPipelineSpec
27+
from datadog_api_client.v2.model.observability_pipeline_spec_data import ObservabilityPipelineSpecData
28+
from datadog_api_client.v2.model.observability_pipeline_spike_protection_processor import (
29+
ObservabilityPipelineSpikeProtectionProcessor,
30+
)
31+
from datadog_api_client.v2.model.observability_pipeline_spike_protection_processor_action_when_missing_partitions import (
32+
ObservabilityPipelineSpikeProtectionProcessorActionWhenMissingPartitions,
33+
)
34+
from datadog_api_client.v2.model.observability_pipeline_spike_protection_processor_minimal_threshold_always_keep import (
35+
ObservabilityPipelineSpikeProtectionProcessorMinimalThresholdAlwaysKeep,
36+
)
37+
from datadog_api_client.v2.model.observability_pipeline_spike_protection_processor_minimal_threshold_always_keep_type import (
38+
ObservabilityPipelineSpikeProtectionProcessorMinimalThresholdAlwaysKeepType,
39+
)
40+
from datadog_api_client.v2.model.observability_pipeline_spike_protection_processor_minimal_threshold_bytes import (
41+
ObservabilityPipelineSpikeProtectionProcessorMinimalThresholdBytes,
42+
)
43+
from datadog_api_client.v2.model.observability_pipeline_spike_protection_processor_minimal_threshold_bytes_type import (
44+
ObservabilityPipelineSpikeProtectionProcessorMinimalThresholdBytesType,
45+
)
46+
from datadog_api_client.v2.model.observability_pipeline_spike_protection_processor_spike_action import (
47+
ObservabilityPipelineSpikeProtectionProcessorSpikeAction,
48+
)
49+
from datadog_api_client.v2.model.observability_pipeline_spike_protection_processor_threshold_override import (
50+
ObservabilityPipelineSpikeProtectionProcessorThresholdOverride,
51+
)
52+
from datadog_api_client.v2.model.observability_pipeline_spike_protection_processor_type import (
53+
ObservabilityPipelineSpikeProtectionProcessorType,
54+
)
55+
56+
body = ObservabilityPipelineSpec(
57+
data=ObservabilityPipelineSpecData(
58+
attributes=ObservabilityPipelineDataAttributes(
59+
config=ObservabilityPipelineConfig(
60+
destinations=[
61+
ObservabilityPipelineDatadogLogsDestination(
62+
id="datadog-logs-destination",
63+
inputs=[
64+
"my-processor-group",
65+
],
66+
type=ObservabilityPipelineDatadogLogsDestinationType.DATADOG_LOGS,
67+
),
68+
],
69+
processor_groups=[
70+
ObservabilityPipelineConfigProcessorGroup(
71+
enabled=True,
72+
id="my-processor-group",
73+
include="service:my-service",
74+
inputs=[
75+
"datadog-agent-source",
76+
],
77+
processors=[
78+
ObservabilityPipelineSpikeProtectionProcessor(
79+
enabled=True,
80+
id="spike-protection-processor",
81+
include="*",
82+
type=ObservabilityPipelineSpikeProtectionProcessorType.SPIKE_PROTECTION,
83+
name="MyPartitionedSpikeProtection",
84+
spike_action=ObservabilityPipelineSpikeProtectionProcessorSpikeAction.NO_ACTION,
85+
partition_fields=[
86+
"service",
87+
],
88+
action_when_missing_partitions=ObservabilityPipelineSpikeProtectionProcessorActionWhenMissingPartitions.DEFAULT_BUCKET,
89+
minimal_threshold_overrides=[
90+
ObservabilityPipelineSpikeProtectionProcessorThresholdOverride(
91+
fields=[
92+
ObservabilityPipelineFieldValue(
93+
name="service",
94+
value="checkout",
95+
),
96+
],
97+
minimal_threshold=ObservabilityPipelineSpikeProtectionProcessorMinimalThresholdBytes(
98+
type=ObservabilityPipelineSpikeProtectionProcessorMinimalThresholdBytesType.THRESHOLD,
99+
bytes=53687091200,
100+
),
101+
),
102+
ObservabilityPipelineSpikeProtectionProcessorThresholdOverride(
103+
fields=[
104+
ObservabilityPipelineFieldValue(
105+
name="service",
106+
value="payments",
107+
),
108+
],
109+
minimal_threshold=ObservabilityPipelineSpikeProtectionProcessorMinimalThresholdAlwaysKeep(
110+
type=ObservabilityPipelineSpikeProtectionProcessorMinimalThresholdAlwaysKeepType.ALWAYS_KEEP,
111+
),
112+
),
113+
],
114+
),
115+
],
116+
),
117+
],
118+
sources=[
119+
ObservabilityPipelineDatadogAgentSource(
120+
id="datadog-agent-source",
121+
type=ObservabilityPipelineDatadogAgentSourceType.DATADOG_AGENT,
122+
),
123+
],
124+
),
125+
name="Pipeline with Spike Protection Threshold Overrides",
126+
),
127+
type="pipelines",
128+
),
129+
)
130+
131+
configuration = Configuration()
132+
configuration.access_token = environ["DD_BEARER_TOKEN"]
133+
with ApiClient(configuration) as api_client:
134+
api_instance = ObservabilityPipelinesApi(api_client)
135+
response = api_instance.validate_pipeline(body=body)
136+
137+
print(response)

0 commit comments

Comments
 (0)