Skip to content

Commit da0d5e2

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 1ec43f9 of spec repo (#3597)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 8471f5b commit da0d5e2

23 files changed

Lines changed: 1759 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 578 additions & 0 deletions
Large diffs are not rendered by default.

docs/datadog_api_client.v2.api.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ datadog\_api\_client.v2.api.apm\_retention\_filters\_api module
5353
:members:
5454
:show-inheritance:
5555

56+
datadog\_api\_client.v2.api.apm\_trace\_api module
57+
--------------------------------------------------
58+
59+
.. automodule:: datadog_api_client.v2.api.apm_trace_api
60+
:members:
61+
:show-inheritance:
62+
5663
datadog\_api\_client.v2.api.app\_builder\_api module
5764
----------------------------------------------------
5865

docs/datadog_api_client.v2.model.rst

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,6 +1215,20 @@ datadog\_api\_client.v2.model.apm\_retention\_filter\_type module
12151215
:members:
12161216
:show-inheritance:
12171217

1218+
datadog\_api\_client.v2.model.apm\_span\_error\_flag module
1219+
-----------------------------------------------------------
1220+
1221+
.. automodule:: datadog_api_client.v2.model.apm_span_error_flag
1222+
:members:
1223+
:show-inheritance:
1224+
1225+
datadog\_api\_client.v2.model.apm\_trace\_span module
1226+
-----------------------------------------------------
1227+
1228+
.. automodule:: datadog_api_client.v2.model.apm_trace_span
1229+
:members:
1230+
:show-inheritance:
1231+
12181232
datadog\_api\_client.v2.model.app\_builder\_event module
12191233
--------------------------------------------------------
12201234

@@ -28585,6 +28599,34 @@ datadog\_api\_client.v2.model.projects\_response module
2858528599
:members:
2858628600
:show-inheritance:
2858728601

28602+
datadog\_api\_client.v2.model.pruned\_trace\_attributes module
28603+
--------------------------------------------------------------
28604+
28605+
.. automodule:: datadog_api_client.v2.model.pruned_trace_attributes
28606+
:members:
28607+
:show-inheritance:
28608+
28609+
datadog\_api\_client.v2.model.pruned\_trace\_data module
28610+
--------------------------------------------------------
28611+
28612+
.. automodule:: datadog_api_client.v2.model.pruned_trace_data
28613+
:members:
28614+
:show-inheritance:
28615+
28616+
datadog\_api\_client.v2.model.pruned\_trace\_response module
28617+
------------------------------------------------------------
28618+
28619+
.. automodule:: datadog_api_client.v2.model.pruned_trace_response
28620+
:members:
28621+
:show-inheritance:
28622+
28623+
datadog\_api\_client.v2.model.pruned\_trace\_type module
28624+
--------------------------------------------------------
28625+
28626+
.. automodule:: datadog_api_client.v2.model.pruned_trace_type
28627+
:members:
28628+
:show-inheritance:
28629+
2858828630
datadog\_api\_client.v2.model.publish\_app\_response module
2858928631
-----------------------------------------------------------
2859028632

@@ -36635,6 +36677,20 @@ datadog\_api\_client.v2.model.suite\_search\_response\_type module
3663536677
:members:
3663636678
:show-inheritance:
3663736679

36680+
datadog\_api\_client.v2.model.summarized\_span module
36681+
-----------------------------------------------------
36682+
36683+
.. automodule:: datadog_api_client.v2.model.summarized_span
36684+
:members:
36685+
:show-inheritance:
36686+
36687+
datadog\_api\_client.v2.model.summarized\_trace module
36688+
------------------------------------------------------
36689+
36690+
.. automodule:: datadog_api_client.v2.model.summarized_trace
36691+
:members:
36692+
:show-inheritance:
36693+
3663836694
datadog\_api\_client.v2.model.suppression\_version\_history module
3663936695
------------------------------------------------------------------
3664036696

@@ -39547,6 +39603,34 @@ datadog\_api\_client.v2.model.token\_type module
3954739603
:members:
3954839604
:show-inheritance:
3954939605

39606+
datadog\_api\_client.v2.model.trace\_attributes module
39607+
------------------------------------------------------
39608+
39609+
.. automodule:: datadog_api_client.v2.model.trace_attributes
39610+
:members:
39611+
:show-inheritance:
39612+
39613+
datadog\_api\_client.v2.model.trace\_data module
39614+
------------------------------------------------
39615+
39616+
.. automodule:: datadog_api_client.v2.model.trace_data
39617+
:members:
39618+
:show-inheritance:
39619+
39620+
datadog\_api\_client.v2.model.trace\_response module
39621+
----------------------------------------------------
39622+
39623+
.. automodule:: datadog_api_client.v2.model.trace_response
39624+
:members:
39625+
:show-inheritance:
39626+
39627+
datadog\_api\_client.v2.model.trace\_type module
39628+
------------------------------------------------
39629+
39630+
.. automodule:: datadog_api_client.v2.model.trace_type
39631+
:members:
39632+
:show-inheritance:
39633+
3955039634
datadog\_api\_client.v2.model.trigger module
3955139635
--------------------------------------------
3955239636

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
Get a pruned trace by ID returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.apm_trace_api import APMTraceApi
7+
8+
configuration = Configuration()
9+
configuration.unstable_operations["get_pruned_trace_by_id"] = True
10+
with ApiClient(configuration) as api_client:
11+
api_instance = APMTraceApi(api_client)
12+
response = api_instance.get_pruned_trace_by_id(
13+
trace_id="trace_id",
14+
)
15+
16+
print(response)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
Get a trace by ID returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.apm_trace_api import APMTraceApi
7+
8+
configuration = Configuration()
9+
configuration.unstable_operations["get_trace_by_id"] = True
10+
with ApiClient(configuration) as api_client:
11+
api_instance = APMTraceApi(api_client)
12+
response = api_instance.get_trace_by_id(
13+
trace_id="trace_id",
14+
)
15+
16+
print(response)

src/datadog_api_client/configuration.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,8 @@ def __init__(
618618
"v2.query_event_filtered_users": False,
619619
"v2.query_users": False,
620620
"v2.update_connection": False,
621+
"v2.get_pruned_trace_by_id": False,
622+
"v2.get_trace_by_id": False,
621623
"v2.create_scorecard_outcomes_batch": False,
622624
"v2.list_entity_risk_scores": False,
623625
"v2.create_incident_service": False,
Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import Any, Dict, List, Union
7+
8+
from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint
9+
from datadog_api_client.configuration import Configuration
10+
from datadog_api_client.model_utils import (
11+
UnsetType,
12+
unset,
13+
)
14+
from datadog_api_client.v2.model.pruned_trace_response import PrunedTraceResponse
15+
from datadog_api_client.v2.model.trace_response import TraceResponse
16+
17+
18+
class APMTraceApi:
19+
"""
20+
Retrieve full or pruned APM traces by trace ID.
21+
"""
22+
23+
def __init__(self, api_client=None):
24+
if api_client is None:
25+
api_client = ApiClient(Configuration())
26+
self.api_client = api_client
27+
28+
self._get_pruned_trace_by_id_endpoint = _Endpoint(
29+
settings={
30+
"response_type": (PrunedTraceResponse,),
31+
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
32+
"endpoint_path": "/api/v2/pruned_trace/{trace_id}",
33+
"operation_id": "get_pruned_trace_by_id",
34+
"http_method": "GET",
35+
"version": "v2",
36+
},
37+
params_map={
38+
"trace_id": {
39+
"required": True,
40+
"openapi_types": (str,),
41+
"attribute": "trace_id",
42+
"location": "path",
43+
},
44+
"expand_span_id": {
45+
"openapi_types": (int,),
46+
"attribute": "expand_span_id",
47+
"location": "query",
48+
},
49+
"time_hint": {
50+
"validation": {
51+
"inclusive_maximum": 2147483647,
52+
},
53+
"openapi_types": (int,),
54+
"attribute": "time_hint",
55+
"location": "query",
56+
},
57+
"force_source": {
58+
"openapi_types": (str,),
59+
"attribute": "force_source",
60+
"location": "query",
61+
},
62+
"include_path": {
63+
"openapi_types": ([str],),
64+
"attribute": "include_path",
65+
"location": "query",
66+
"collection_format": "multi",
67+
},
68+
"tag_include": {
69+
"openapi_types": ([str],),
70+
"attribute": "tag_include",
71+
"location": "query",
72+
"collection_format": "multi",
73+
},
74+
"tag_exclude": {
75+
"openapi_types": ([str],),
76+
"attribute": "tag_exclude",
77+
"location": "query",
78+
"collection_format": "multi",
79+
},
80+
"only_service_entry_spans": {
81+
"openapi_types": (bool,),
82+
"attribute": "only_service_entry_spans",
83+
"location": "query",
84+
},
85+
},
86+
headers_map={
87+
"accept": ["application/json"],
88+
},
89+
api_client=api_client,
90+
)
91+
92+
self._get_trace_by_id_endpoint = _Endpoint(
93+
settings={
94+
"response_type": (TraceResponse,),
95+
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
96+
"endpoint_path": "/api/v2/trace/{trace_id}",
97+
"operation_id": "get_trace_by_id",
98+
"http_method": "GET",
99+
"version": "v2",
100+
},
101+
params_map={
102+
"trace_id": {
103+
"required": True,
104+
"openapi_types": (str,),
105+
"attribute": "trace_id",
106+
"location": "path",
107+
},
108+
"include_fields": {
109+
"openapi_types": ([str],),
110+
"attribute": "include_fields",
111+
"location": "query",
112+
"collection_format": "multi",
113+
},
114+
},
115+
headers_map={
116+
"accept": ["application/json"],
117+
},
118+
api_client=api_client,
119+
)
120+
121+
def get_pruned_trace_by_id(
122+
self,
123+
trace_id: str,
124+
*,
125+
expand_span_id: Union[int, UnsetType] = unset,
126+
time_hint: Union[int, UnsetType] = unset,
127+
force_source: Union[str, UnsetType] = unset,
128+
include_path: Union[List[str], UnsetType] = unset,
129+
tag_include: Union[List[str], UnsetType] = unset,
130+
tag_exclude: Union[List[str], UnsetType] = unset,
131+
only_service_entry_spans: Union[bool, UnsetType] = unset,
132+
) -> PrunedTraceResponse:
133+
"""Get a pruned trace by ID.
134+
135+
Retrieve a pruned, hierarchical view of an APM trace by its trace ID.
136+
The trace is summarized as a tree of spans rooted at the trace root and reduced in size
137+
to keep rendering large traces in the UI practical.
138+
This endpoint is rate limited to ``60`` requests per minute per organization.
139+
140+
:param trace_id: The trace ID. Accepts either a 32-character hexadecimal string (128-bit trace ID)
141+
or a decimal string of up to 39 digits.
142+
:type trace_id: str
143+
:param expand_span_id: Span ID to expand and preserve in the pruned tree even when its branch would
144+
normally be summarized.
145+
:type expand_span_id: int, optional
146+
:param time_hint: Optional Unix time hint, in seconds, used to optimize the lookup of the trace
147+
in long-term storage.
148+
:type time_hint: int, optional
149+
:param force_source: Force the trace to be loaded from a specific source. When unset, the API picks
150+
the source automatically.
151+
:type force_source: str, optional
152+
:param include_path: Restrict the pruned tree to spans matching the given ``key:value`` pairs.
153+
Values may be passed as repeated query parameters.
154+
:type include_path: [str], optional
155+
:param tag_include: Regex patterns of tag keys whose values must be included in the pruned spans.
156+
Values may be passed as repeated query parameters.
157+
:type tag_include: [str], optional
158+
:param tag_exclude: Regex patterns of tag keys whose values must be excluded from the pruned spans.
159+
Values may be passed as repeated query parameters.
160+
:type tag_exclude: [str], optional
161+
:param only_service_entry_spans: When set to ``true`` , only service entry spans are included in the pruned tree.
162+
:type only_service_entry_spans: bool, optional
163+
:rtype: PrunedTraceResponse
164+
"""
165+
kwargs: Dict[str, Any] = {}
166+
kwargs["trace_id"] = trace_id
167+
168+
if expand_span_id is not unset:
169+
kwargs["expand_span_id"] = expand_span_id
170+
171+
if time_hint is not unset:
172+
kwargs["time_hint"] = time_hint
173+
174+
if force_source is not unset:
175+
kwargs["force_source"] = force_source
176+
177+
if include_path is not unset:
178+
kwargs["include_path"] = include_path
179+
180+
if tag_include is not unset:
181+
kwargs["tag_include"] = tag_include
182+
183+
if tag_exclude is not unset:
184+
kwargs["tag_exclude"] = tag_exclude
185+
186+
if only_service_entry_spans is not unset:
187+
kwargs["only_service_entry_spans"] = only_service_entry_spans
188+
189+
return self._get_pruned_trace_by_id_endpoint.call_with_http_info(**kwargs)
190+
191+
def get_trace_by_id(
192+
self,
193+
trace_id: str,
194+
*,
195+
include_fields: Union[List[str], UnsetType] = unset,
196+
) -> TraceResponse:
197+
"""Get a trace by ID.
198+
199+
Retrieve a full APM trace by its trace ID, including every span in the trace.
200+
Traces are returned from live storage when available and fall back to longer-term storage.
201+
This endpoint is rate limited to ``60`` requests per minute per organization.
202+
203+
:param trace_id: The trace ID. Accepts either a 32-character hexadecimal string (128-bit trace ID)
204+
or a decimal string of up to 39 digits.
205+
:type trace_id: str
206+
:param include_fields: List of span fields to include in the response. When omitted, every available field is returned.
207+
Values may be passed as repeated query parameters or as a single comma-separated value.
208+
:type include_fields: [str], optional
209+
:rtype: TraceResponse
210+
"""
211+
kwargs: Dict[str, Any] = {}
212+
kwargs["trace_id"] = trace_id
213+
214+
if include_fields is not unset:
215+
kwargs["include_fields"] = include_fields
216+
217+
return self._get_trace_by_id_endpoint.call_with_http_info(**kwargs)

0 commit comments

Comments
 (0)