Skip to content

Commit f17ed7e

Browse files
Merge master into datadog-api-spec/test/d.marin/oncall-api
2 parents eca6b6d + 44f3b8e commit f17ed7e

33 files changed

Lines changed: 2306 additions & 59 deletions

File tree

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-04-08 14:37:44.703187",
8-
"spec_repo_commit": "642b7d0b"
7+
"regenerated": "2025-04-08 20:55:42.169501",
8+
"spec_repo_commit": "21cf6edb"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-04-08 14:37:44.802514",
13-
"spec_repo_commit": "642b7d0b"
12+
"regenerated": "2025-04-08 20:55:42.184778",
13+
"spec_repo_commit": "21cf6edb"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17271,6 +17271,14 @@ components:
1727117271
example: 0
1727217272
format: int64
1727317273
type: integer
17274+
ip_addresses:
17275+
description: The interface IP addresses
17276+
example:
17277+
- 1.1.1.1
17278+
- 1.1.1.2
17279+
items:
17280+
type: string
17281+
type: array
1727417282
mac_address:
1727517283
description: The interface MAC address
1727617284
example: 00:00:00:00:00:00
@@ -25238,6 +25246,14 @@ components:
2523825246
example: 1.0
2523925247
format: double
2524025248
type: number
25249+
trace_rate:
25250+
description: 'Sample rate to apply to traces containing spans going through
25251+
this retention filter.
25252+
25253+
A value of 1.0 keeps all traces with spans matching the query.'
25254+
example: 1.0
25255+
format: double
25256+
type: number
2524125257
type: object
2524225258
RetentionFilterAllType:
2524325259
default: spans-sampling-processor
@@ -25297,6 +25313,14 @@ components:
2529725313
example: 1.0
2529825314
format: double
2529925315
type: number
25316+
trace_rate:
25317+
description: 'Sample rate to apply to traces containing spans going through
25318+
this retention filter.
25319+
25320+
A value of 1.0 keeps all traces with spans matching the query.'
25321+
example: 1.0
25322+
format: double
25323+
type: number
2530025324
type: object
2530125325
RetentionFilterCreateAttributes:
2530225326
description: The object describing the configuration of the retention filter
@@ -25322,6 +25346,14 @@ components:
2532225346
example: 1.0
2532325347
format: double
2532425348
type: number
25349+
trace_rate:
25350+
description: 'Sample rate to apply to traces containing spans going through
25351+
this retention filter.
25352+
25353+
A value of 1.0 keeps all traces with spans matching the query.'
25354+
example: 1.0
25355+
format: double
25356+
type: number
2532525357
required:
2532625358
- name
2532725359
- filter
@@ -25393,6 +25425,14 @@ components:
2539325425
example: 1.0
2539425426
format: double
2539525427
type: number
25428+
trace_rate:
25429+
description: 'Sample rate to apply to traces containing spans going through
25430+
this retention filter.
25431+
25432+
A value of 1.0 keeps all traces with spans matching the query.'
25433+
example: 1.0
25434+
format: double
25435+
type: number
2539625436
required:
2539725437
- name
2539825438
- filter
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
"""
2+
Create a retention filter with trace rate returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.apm_retention_filters_api import APMRetentionFiltersApi
7+
from datadog_api_client.v2.model.apm_retention_filter_type import ApmRetentionFilterType
8+
from datadog_api_client.v2.model.retention_filter_create_attributes import RetentionFilterCreateAttributes
9+
from datadog_api_client.v2.model.retention_filter_create_data import RetentionFilterCreateData
10+
from datadog_api_client.v2.model.retention_filter_create_request import RetentionFilterCreateRequest
11+
from datadog_api_client.v2.model.retention_filter_type import RetentionFilterType
12+
from datadog_api_client.v2.model.spans_filter_create import SpansFilterCreate
13+
14+
body = RetentionFilterCreateRequest(
15+
data=RetentionFilterCreateData(
16+
attributes=RetentionFilterCreateAttributes(
17+
enabled=True,
18+
filter=SpansFilterCreate(
19+
query="@http.status_code:200 service:my-service",
20+
),
21+
filter_type=RetentionFilterType.SPANS_SAMPLING_PROCESSOR,
22+
name="my retention filter",
23+
rate=1.0,
24+
trace_rate=1.0,
25+
),
26+
type=ApmRetentionFilterType.apm_retention_filter,
27+
),
28+
)
29+
30+
configuration = Configuration()
31+
with ApiClient(configuration) as api_client:
32+
api_instance = APMRetentionFiltersApi(api_client)
33+
response = api_instance.create_apm_retention_filter(body=body)
34+
35+
print(response)
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
"""
2+
Update a retention filter with trace rate 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.apm_retention_filters_api import APMRetentionFiltersApi
8+
from datadog_api_client.v2.model.apm_retention_filter_type import ApmRetentionFilterType
9+
from datadog_api_client.v2.model.retention_filter_all_type import RetentionFilterAllType
10+
from datadog_api_client.v2.model.retention_filter_update_attributes import RetentionFilterUpdateAttributes
11+
from datadog_api_client.v2.model.retention_filter_update_data import RetentionFilterUpdateData
12+
from datadog_api_client.v2.model.retention_filter_update_request import RetentionFilterUpdateRequest
13+
from datadog_api_client.v2.model.spans_filter_create import SpansFilterCreate
14+
15+
# there is a valid "retention_filter" in the system
16+
RETENTION_FILTER_DATA_ID = environ["RETENTION_FILTER_DATA_ID"]
17+
18+
body = RetentionFilterUpdateRequest(
19+
data=RetentionFilterUpdateData(
20+
attributes=RetentionFilterUpdateAttributes(
21+
name="test",
22+
rate=0.9,
23+
trace_rate=1.0,
24+
filter=SpansFilterCreate(
25+
query="@_top_level:1 test:service-demo",
26+
),
27+
enabled=True,
28+
filter_type=RetentionFilterAllType.SPANS_SAMPLING_PROCESSOR,
29+
),
30+
id="test-id",
31+
type=ApmRetentionFilterType.apm_retention_filter,
32+
),
33+
)
34+
35+
configuration = Configuration()
36+
with ApiClient(configuration) as api_client:
37+
api_instance = APMRetentionFiltersApi(api_client)
38+
response = api_instance.update_apm_retention_filter(filter_id=RETENTION_FILTER_DATA_ID, body=body)
39+
40+
print(response)

src/datadog_api_client/v2/model/interface_attributes.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6-
from typing import Union, TYPE_CHECKING
6+
from typing import List, Union, TYPE_CHECKING
77

88
from datadog_api_client.model_utils import (
99
ModelNormal,
@@ -26,6 +26,7 @@ def openapi_types(_):
2626
"alias": (str,),
2727
"description": (str,),
2828
"index": (int,),
29+
"ip_addresses": ([str],),
2930
"mac_address": (str,),
3031
"name": (str,),
3132
"status": (InterfaceAttributesStatus,),
@@ -35,6 +36,7 @@ def openapi_types(_):
3536
"alias": "alias",
3637
"description": "description",
3738
"index": "index",
39+
"ip_addresses": "ip_addresses",
3840
"mac_address": "mac_address",
3941
"name": "name",
4042
"status": "status",
@@ -45,6 +47,7 @@ def __init__(
4547
alias: Union[str, UnsetType] = unset,
4648
description: Union[str, UnsetType] = unset,
4749
index: Union[int, UnsetType] = unset,
50+
ip_addresses: Union[List[str], UnsetType] = unset,
4851
mac_address: Union[str, UnsetType] = unset,
4952
name: Union[str, UnsetType] = unset,
5053
status: Union[InterfaceAttributesStatus, UnsetType] = unset,
@@ -62,6 +65,9 @@ def __init__(
6265
:param index: The interface index
6366
:type index: int, optional
6467
68+
:param ip_addresses: The interface IP addresses
69+
:type ip_addresses: [str], optional
70+
6571
:param mac_address: The interface MAC address
6672
:type mac_address: str, optional
6773
@@ -77,6 +83,8 @@ def __init__(
7783
kwargs["description"] = description
7884
if index is not unset:
7985
kwargs["index"] = index
86+
if ip_addresses is not unset:
87+
kwargs["ip_addresses"] = ip_addresses
8088
if mac_address is not unset:
8189
kwargs["mac_address"] = mac_address
8290
if name is not unset:

src/datadog_api_client/v2/model/retention_filter_all_attributes.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def openapi_types(_):
3636
"modified_by": (str,),
3737
"name": (str,),
3838
"rate": (float,),
39+
"trace_rate": (float,),
3940
}
4041

4142
attribute_map = {
@@ -50,6 +51,7 @@ def openapi_types(_):
5051
"modified_by": "modified_by",
5152
"name": "name",
5253
"rate": "rate",
54+
"trace_rate": "trace_rate",
5355
}
5456

5557
def __init__(
@@ -65,6 +67,7 @@ def __init__(
6567
modified_by: Union[str, UnsetType] = unset,
6668
name: Union[str, UnsetType] = unset,
6769
rate: Union[float, UnsetType] = unset,
70+
trace_rate: Union[float, UnsetType] = unset,
6871
**kwargs,
6972
):
7073
"""
@@ -103,6 +106,10 @@ def __init__(
103106
:param rate: Sample rate to apply to spans going through this retention filter,
104107
a value of 1.0 keeps all spans matching the query.
105108
:type rate: float, optional
109+
110+
:param trace_rate: Sample rate to apply to traces containing spans going through this retention filter.
111+
A value of 1.0 keeps all traces with spans matching the query.
112+
:type trace_rate: float, optional
106113
"""
107114
if created_at is not unset:
108115
kwargs["created_at"] = created_at
@@ -126,4 +133,6 @@ def __init__(
126133
kwargs["name"] = name
127134
if rate is not unset:
128135
kwargs["rate"] = rate
136+
if trace_rate is not unset:
137+
kwargs["trace_rate"] = trace_rate
129138
super().__init__(kwargs)

src/datadog_api_client/v2/model/retention_filter_attributes.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def openapi_types(_):
3636
"modified_by": (str,),
3737
"name": (str,),
3838
"rate": (float,),
39+
"trace_rate": (float,),
3940
}
4041

4142
attribute_map = {
@@ -50,6 +51,7 @@ def openapi_types(_):
5051
"modified_by": "modified_by",
5152
"name": "name",
5253
"rate": "rate",
54+
"trace_rate": "trace_rate",
5355
}
5456

5557
def __init__(
@@ -65,6 +67,7 @@ def __init__(
6567
modified_by: Union[str, UnsetType] = unset,
6668
name: Union[str, UnsetType] = unset,
6769
rate: Union[float, UnsetType] = unset,
70+
trace_rate: Union[float, UnsetType] = unset,
6871
**kwargs,
6972
):
7073
"""
@@ -103,6 +106,10 @@ def __init__(
103106
:param rate: Sample rate to apply to spans going through this retention filter,
104107
a value of 1.0 keeps all spans matching the query.
105108
:type rate: float, optional
109+
110+
:param trace_rate: Sample rate to apply to traces containing spans going through this retention filter.
111+
A value of 1.0 keeps all traces with spans matching the query.
112+
:type trace_rate: float, optional
106113
"""
107114
if created_at is not unset:
108115
kwargs["created_at"] = created_at
@@ -126,4 +133,6 @@ def __init__(
126133
kwargs["name"] = name
127134
if rate is not unset:
128135
kwargs["rate"] = rate
136+
if trace_rate is not unset:
137+
kwargs["trace_rate"] = trace_rate
129138
super().__init__(kwargs)

src/datadog_api_client/v2/model/retention_filter_create_attributes.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6-
from typing import TYPE_CHECKING
6+
from typing import Union, TYPE_CHECKING
77

88
from datadog_api_client.model_utils import (
99
ModelNormal,
1010
cached_property,
11+
unset,
12+
UnsetType,
1113
)
1214

1315

@@ -28,6 +30,7 @@ def openapi_types(_):
2830
"filter_type": (RetentionFilterType,),
2931
"name": (str,),
3032
"rate": (float,),
33+
"trace_rate": (float,),
3134
}
3235

3336
attribute_map = {
@@ -36,6 +39,7 @@ def openapi_types(_):
3639
"filter_type": "filter_type",
3740
"name": "name",
3841
"rate": "rate",
42+
"trace_rate": "trace_rate",
3943
}
4044

4145
def __init__(
@@ -45,6 +49,7 @@ def __init__(
4549
filter_type: RetentionFilterType,
4650
name: str,
4751
rate: float,
52+
trace_rate: Union[float, UnsetType] = unset,
4853
**kwargs,
4954
):
5055
"""
@@ -65,7 +70,13 @@ def __init__(
6570
:param rate: Sample rate to apply to spans going through this retention filter,
6671
a value of 1.0 keeps all spans matching the query.
6772
:type rate: float
73+
74+
:param trace_rate: Sample rate to apply to traces containing spans going through this retention filter.
75+
A value of 1.0 keeps all traces with spans matching the query.
76+
:type trace_rate: float, optional
6877
"""
78+
if trace_rate is not unset:
79+
kwargs["trace_rate"] = trace_rate
6980
super().__init__(kwargs)
7081

7182
self_.enabled = enabled

0 commit comments

Comments
 (0)