Skip to content

Commit 518d1cf

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 1ec43f9 of spec repo
1 parent 2cdd403 commit 518d1cf

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
@@ -46,6 +46,13 @@ datadog\_api\_client.v2.api.apm\_retention\_filters\_api module
4646
:members:
4747
:show-inheritance:
4848

49+
datadog\_api\_client.v2.api.apm\_trace\_api module
50+
--------------------------------------------------
51+
52+
.. automodule:: datadog_api_client.v2.api.apm_trace_api
53+
:members:
54+
:show-inheritance:
55+
4956
datadog\_api\_client.v2.api.app\_builder\_api module
5057
----------------------------------------------------
5158

docs/datadog_api_client.v2.model.rst

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

1127+
datadog\_api\_client.v2.model.apm\_span\_error\_flag module
1128+
-----------------------------------------------------------
1129+
1130+
.. automodule:: datadog_api_client.v2.model.apm_span_error_flag
1131+
:members:
1132+
:show-inheritance:
1133+
1134+
datadog\_api\_client.v2.model.apm\_trace\_span module
1135+
-----------------------------------------------------
1136+
1137+
.. automodule:: datadog_api_client.v2.model.apm_trace_span
1138+
:members:
1139+
:show-inheritance:
1140+
11271141
datadog\_api\_client.v2.model.app\_builder\_event module
11281142
--------------------------------------------------------
11291143

@@ -28466,6 +28480,34 @@ datadog\_api\_client.v2.model.projects\_response module
2846628480
:members:
2846728481
:show-inheritance:
2846828482

28483+
datadog\_api\_client.v2.model.pruned\_trace\_attributes module
28484+
--------------------------------------------------------------
28485+
28486+
.. automodule:: datadog_api_client.v2.model.pruned_trace_attributes
28487+
:members:
28488+
:show-inheritance:
28489+
28490+
datadog\_api\_client.v2.model.pruned\_trace\_data module
28491+
--------------------------------------------------------
28492+
28493+
.. automodule:: datadog_api_client.v2.model.pruned_trace_data
28494+
:members:
28495+
:show-inheritance:
28496+
28497+
datadog\_api\_client.v2.model.pruned\_trace\_response module
28498+
------------------------------------------------------------
28499+
28500+
.. automodule:: datadog_api_client.v2.model.pruned_trace_response
28501+
:members:
28502+
:show-inheritance:
28503+
28504+
datadog\_api\_client.v2.model.pruned\_trace\_type module
28505+
--------------------------------------------------------
28506+
28507+
.. automodule:: datadog_api_client.v2.model.pruned_trace_type
28508+
:members:
28509+
:show-inheritance:
28510+
2846928511
datadog\_api\_client.v2.model.publish\_app\_response module
2847028512
-----------------------------------------------------------
2847128513

@@ -36516,6 +36558,20 @@ datadog\_api\_client.v2.model.suite\_search\_response\_type module
3651636558
:members:
3651736559
:show-inheritance:
3651836560

36561+
datadog\_api\_client.v2.model.summarized\_span module
36562+
-----------------------------------------------------
36563+
36564+
.. automodule:: datadog_api_client.v2.model.summarized_span
36565+
:members:
36566+
:show-inheritance:
36567+
36568+
datadog\_api\_client.v2.model.summarized\_trace module
36569+
------------------------------------------------------
36570+
36571+
.. automodule:: datadog_api_client.v2.model.summarized_trace
36572+
:members:
36573+
:show-inheritance:
36574+
3651936575
datadog\_api\_client.v2.model.suppression\_version\_history module
3652036576
------------------------------------------------------------------
3652136577

@@ -39428,6 +39484,34 @@ datadog\_api\_client.v2.model.token\_type module
3942839484
:members:
3942939485
:show-inheritance:
3943039486

39487+
datadog\_api\_client.v2.model.trace\_attributes module
39488+
------------------------------------------------------
39489+
39490+
.. automodule:: datadog_api_client.v2.model.trace_attributes
39491+
:members:
39492+
:show-inheritance:
39493+
39494+
datadog\_api\_client.v2.model.trace\_data module
39495+
------------------------------------------------
39496+
39497+
.. automodule:: datadog_api_client.v2.model.trace_data
39498+
:members:
39499+
:show-inheritance:
39500+
39501+
datadog\_api\_client.v2.model.trace\_response module
39502+
----------------------------------------------------
39503+
39504+
.. automodule:: datadog_api_client.v2.model.trace_response
39505+
:members:
39506+
:show-inheritance:
39507+
39508+
datadog\_api\_client.v2.model.trace\_type module
39509+
------------------------------------------------
39510+
39511+
.. automodule:: datadog_api_client.v2.model.trace_type
39512+
:members:
39513+
:show-inheritance:
39514+
3943139515
datadog\_api\_client.v2.model.trigger module
3943239516
--------------------------------------------
3943339517

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
@@ -613,6 +613,8 @@ def __init__(
613613
"v2.query_event_filtered_users": False,
614614
"v2.query_users": False,
615615
"v2.update_connection": False,
616+
"v2.get_pruned_trace_by_id": False,
617+
"v2.get_trace_by_id": False,
616618
"v2.create_scorecard_outcomes_batch": False,
617619
"v2.list_entity_risk_scores": False,
618620
"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)