Skip to content

Commit 81cd31e

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 3a277bf of spec repo
1 parent 2b902da commit 81cd31e

24 files changed

+653
-0
lines changed

.generator/schemas/v1/openapi.yaml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2672,6 +2672,123 @@ components:
26722672
- service
26732673
- name
26742674
type: object
2675+
FormulaAndFunctionApmMetricStatName:
2676+
description: APM metric stat name.
2677+
enum:
2678+
- errors
2679+
- error_rate
2680+
- errors_per_second
2681+
- latency_avg
2682+
- latency_max
2683+
- latency_p50
2684+
- latency_p75
2685+
- latency_p90
2686+
- latency_p95
2687+
- latency_p99
2688+
- latency_p999
2689+
- latency_distribution
2690+
- hits
2691+
- hits_per_second
2692+
- total_time
2693+
- apdex
2694+
example: "hits"
2695+
type: string
2696+
x-enum-varnames:
2697+
- ERRORS
2698+
- ERROR_RATE
2699+
- ERRORS_PER_SECOND
2700+
- LATENCY_AVG
2701+
- LATENCY_MAX
2702+
- LATENCY_P50
2703+
- LATENCY_P75
2704+
- LATENCY_P90
2705+
- LATENCY_P95
2706+
- LATENCY_P99
2707+
- LATENCY_P999
2708+
- LATENCY_DISTRIBUTION
2709+
- HITS
2710+
- HITS_PER_SECOND
2711+
- TOTAL_TIME
2712+
- APDEX
2713+
FormulaAndFunctionApmMetricsDataSource:
2714+
description: Data source for APM metrics queries.
2715+
enum:
2716+
- apm_metrics
2717+
example: apm_metrics
2718+
type: string
2719+
x-enum-varnames:
2720+
- APM_METRICS
2721+
FormulaAndFunctionApmMetricsQueryDefinition:
2722+
description: A formula and functions APM metrics query.
2723+
properties:
2724+
data_source:
2725+
$ref: "#/components/schemas/FormulaAndFunctionApmMetricsDataSource"
2726+
group_by:
2727+
description: Optional fields to group the query results by.
2728+
items:
2729+
description: A field to group results by.
2730+
example: "resource_name"
2731+
type: string
2732+
type: array
2733+
name:
2734+
description: Name of this query to use in formulas.
2735+
example: "query_errors"
2736+
type: string
2737+
operation_mode:
2738+
description: Optional operation mode to aggregate across operation names.
2739+
example: "primary"
2740+
type: string
2741+
operation_name:
2742+
description: Name of operation on service. If not provided, the primary operation name is used.
2743+
example: "web.request"
2744+
type: string
2745+
peer_tags:
2746+
description: Tags to query for a specific downstream entity (peer.service, peer.db_instance, peer.s3, peer.s3.bucket, etc.).
2747+
items:
2748+
example: "peer.service:my-service"
2749+
type: string
2750+
type: array
2751+
query_filter:
2752+
description: Additional filters for the query using metrics query syntax (e.g., env, primary_tag).
2753+
example: "env:prod"
2754+
type: string
2755+
resource_hash:
2756+
description: The hash of a specific resource to filter by.
2757+
example: "abc123"
2758+
type: string
2759+
resource_name:
2760+
description: The full name of a specific resource to filter by.
2761+
example: "GET /api/v1/users"
2762+
type: string
2763+
service:
2764+
description: APM service name.
2765+
example: "web-store"
2766+
type: string
2767+
span_kind:
2768+
$ref: "#/components/schemas/FormulaAndFunctionApmMetricsSpanKind"
2769+
stat:
2770+
$ref: "#/components/schemas/FormulaAndFunctionApmMetricStatName"
2771+
required:
2772+
- data_source
2773+
- name
2774+
- stat
2775+
type: object
2776+
FormulaAndFunctionApmMetricsSpanKind:
2777+
description: Describes the relationship between the span, its parents, and its children in a trace.
2778+
enum:
2779+
- consumer
2780+
- server
2781+
- client
2782+
- producer
2783+
- internal
2784+
example: "server"
2785+
type: string
2786+
x-enum-varnames:
2787+
- CONSUMER
2788+
- SERVER
2789+
- CLIENT
2790+
- PRODUCER
2791+
- INTERNAL
26752792
FormulaAndFunctionApmResourceStatName:
26762793
description: APM resource stat name.
26772794
enum:
@@ -3101,6 +3218,7 @@ components:
31013218
- $ref: "#/components/schemas/FormulaAndFunctionProcessQueryDefinition"
31023219
- $ref: "#/components/schemas/FormulaAndFunctionApmDependencyStatsQueryDefinition"
31033220
- $ref: "#/components/schemas/FormulaAndFunctionApmResourceStatsQueryDefinition"
3221+
- $ref: "#/components/schemas/FormulaAndFunctionApmMetricsQueryDefinition"
31043222
- $ref: "#/components/schemas/FormulaAndFunctionSLOQueryDefinition"
31053223
- $ref: "#/components/schemas/FormulaAndFunctionCloudCostQueryDefinition"
31063224
FormulaAndFunctionResponseFormat:

docs/datadog_api_client.v1.model.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,34 @@ datadog\_api\_client.v1.model.formula\_and\_function\_apm\_dependency\_stats\_qu
865865
:members:
866866
:show-inheritance:
867867

868+
datadog\_api\_client.v1.model.formula\_and\_function\_apm\_metric\_stat\_name module
869+
------------------------------------------------------------------------------------
870+
871+
.. automodule:: datadog_api_client.v1.model.formula_and_function_apm_metric_stat_name
872+
:members:
873+
:show-inheritance:
874+
875+
datadog\_api\_client.v1.model.formula\_and\_function\_apm\_metrics\_data\_source module
876+
---------------------------------------------------------------------------------------
877+
878+
.. automodule:: datadog_api_client.v1.model.formula_and_function_apm_metrics_data_source
879+
:members:
880+
:show-inheritance:
881+
882+
datadog\_api\_client.v1.model.formula\_and\_function\_apm\_metrics\_query\_definition module
883+
--------------------------------------------------------------------------------------------
884+
885+
.. automodule:: datadog_api_client.v1.model.formula_and_function_apm_metrics_query_definition
886+
:members:
887+
:show-inheritance:
888+
889+
datadog\_api\_client.v1.model.formula\_and\_function\_apm\_metrics\_span\_kind module
890+
-------------------------------------------------------------------------------------
891+
892+
.. automodule:: datadog_api_client.v1.model.formula_and_function_apm_metrics_span_kind
893+
:members:
894+
:show-inheritance:
895+
868896
datadog\_api\_client.v1.model.formula\_and\_function\_apm\_resource\_stat\_name module
869897
--------------------------------------------------------------------------------------
870898

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
"""
2+
Create a new dashboard with apm metrics widget
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v1.api.dashboards_api import DashboardsApi
7+
from datadog_api_client.v1.model.dashboard import Dashboard
8+
from datadog_api_client.v1.model.dashboard_layout_type import DashboardLayoutType
9+
from datadog_api_client.v1.model.formula_and_function_apm_metric_stat_name import FormulaAndFunctionApmMetricStatName
10+
from datadog_api_client.v1.model.formula_and_function_apm_metrics_data_source import (
11+
FormulaAndFunctionApmMetricsDataSource,
12+
)
13+
from datadog_api_client.v1.model.formula_and_function_apm_metrics_query_definition import (
14+
FormulaAndFunctionApmMetricsQueryDefinition,
15+
)
16+
from datadog_api_client.v1.model.formula_and_function_response_format import FormulaAndFunctionResponseFormat
17+
from datadog_api_client.v1.model.table_widget_definition import TableWidgetDefinition
18+
from datadog_api_client.v1.model.table_widget_definition_type import TableWidgetDefinitionType
19+
from datadog_api_client.v1.model.table_widget_request import TableWidgetRequest
20+
from datadog_api_client.v1.model.widget import Widget
21+
from datadog_api_client.v1.model.widget_layout import WidgetLayout
22+
from datadog_api_client.v1.model.widget_text_align import WidgetTextAlign
23+
24+
body = Dashboard(
25+
title="Example-Dashboard",
26+
widgets=[
27+
Widget(
28+
definition=TableWidgetDefinition(
29+
title="",
30+
title_size="16",
31+
title_align=WidgetTextAlign.LEFT,
32+
type=TableWidgetDefinitionType.QUERY_TABLE,
33+
requests=[
34+
TableWidgetRequest(
35+
response_format=FormulaAndFunctionResponseFormat.SCALAR,
36+
queries=[
37+
FormulaAndFunctionApmMetricsQueryDefinition(
38+
stat=FormulaAndFunctionApmMetricStatName.HITS,
39+
name="query1",
40+
service="web-store",
41+
data_source=FormulaAndFunctionApmMetricsDataSource.APM_METRICS,
42+
query_filter="env:prod",
43+
group_by=[
44+
"resource_name",
45+
],
46+
),
47+
],
48+
),
49+
],
50+
),
51+
layout=WidgetLayout(
52+
x=0,
53+
y=0,
54+
width=4,
55+
height=4,
56+
),
57+
),
58+
],
59+
layout_type=DashboardLayoutType.ORDERED,
60+
)
61+
62+
configuration = Configuration()
63+
with ApiClient(configuration) as api_client:
64+
api_instance = DashboardsApi(api_client)
65+
response = api_instance.create_dashboard(body=body)
66+
67+
print(response)

src/datadog_api_client/v1/model/bar_chart_widget_request.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
from datadog_api_client.v1.model.formula_and_function_apm_resource_stats_query_definition import (
3838
FormulaAndFunctionApmResourceStatsQueryDefinition,
3939
)
40+
from datadog_api_client.v1.model.formula_and_function_apm_metrics_query_definition import (
41+
FormulaAndFunctionApmMetricsQueryDefinition,
42+
)
4043
from datadog_api_client.v1.model.formula_and_function_slo_query_definition import (
4144
FormulaAndFunctionSLOQueryDefinition,
4245
)
@@ -116,6 +119,7 @@ def __init__(
116119
FormulaAndFunctionProcessQueryDefinition,
117120
FormulaAndFunctionApmDependencyStatsQueryDefinition,
118121
FormulaAndFunctionApmResourceStatsQueryDefinition,
122+
FormulaAndFunctionApmMetricsQueryDefinition,
119123
FormulaAndFunctionSLOQueryDefinition,
120124
FormulaAndFunctionCloudCostQueryDefinition,
121125
]

src/datadog_api_client/v1/model/change_widget_request.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
from datadog_api_client.v1.model.formula_and_function_apm_resource_stats_query_definition import (
3939
FormulaAndFunctionApmResourceStatsQueryDefinition,
4040
)
41+
from datadog_api_client.v1.model.formula_and_function_apm_metrics_query_definition import (
42+
FormulaAndFunctionApmMetricsQueryDefinition,
43+
)
4144
from datadog_api_client.v1.model.formula_and_function_slo_query_definition import (
4245
FormulaAndFunctionSLOQueryDefinition,
4346
)
@@ -125,6 +128,7 @@ def __init__(
125128
FormulaAndFunctionProcessQueryDefinition,
126129
FormulaAndFunctionApmDependencyStatsQueryDefinition,
127130
FormulaAndFunctionApmResourceStatsQueryDefinition,
131+
FormulaAndFunctionApmMetricsQueryDefinition,
128132
FormulaAndFunctionSLOQueryDefinition,
129133
FormulaAndFunctionCloudCostQueryDefinition,
130134
]

src/datadog_api_client/v1/model/distribution_widget_request.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
from datadog_api_client.v1.model.formula_and_function_apm_resource_stats_query_definition import (
4141
FormulaAndFunctionApmResourceStatsQueryDefinition,
4242
)
43+
from datadog_api_client.v1.model.formula_and_function_apm_metrics_query_definition import (
44+
FormulaAndFunctionApmMetricsQueryDefinition,
45+
)
4346
from datadog_api_client.v1.model.formula_and_function_slo_query_definition import (
4447
FormulaAndFunctionSLOQueryDefinition,
4548
)
@@ -121,6 +124,7 @@ def __init__(
121124
FormulaAndFunctionProcessQueryDefinition,
122125
FormulaAndFunctionApmDependencyStatsQueryDefinition,
123126
FormulaAndFunctionApmResourceStatsQueryDefinition,
127+
FormulaAndFunctionApmMetricsQueryDefinition,
124128
FormulaAndFunctionSLOQueryDefinition,
125129
FormulaAndFunctionCloudCostQueryDefinition,
126130
]
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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+
7+
from datadog_api_client.model_utils import (
8+
ModelSimple,
9+
cached_property,
10+
)
11+
12+
from typing import ClassVar
13+
14+
15+
class FormulaAndFunctionApmMetricStatName(ModelSimple):
16+
"""
17+
APM metric stat name.
18+
19+
:param value: Must be one of ["errors", "error_rate", "errors_per_second", "latency_avg", "latency_max", "latency_p50", "latency_p75", "latency_p90", "latency_p95", "latency_p99", "latency_p999", "latency_distribution", "hits", "hits_per_second", "total_time", "apdex"].
20+
:type value: str
21+
"""
22+
23+
allowed_values = {
24+
"errors",
25+
"error_rate",
26+
"errors_per_second",
27+
"latency_avg",
28+
"latency_max",
29+
"latency_p50",
30+
"latency_p75",
31+
"latency_p90",
32+
"latency_p95",
33+
"latency_p99",
34+
"latency_p999",
35+
"latency_distribution",
36+
"hits",
37+
"hits_per_second",
38+
"total_time",
39+
"apdex",
40+
}
41+
ERRORS: ClassVar["FormulaAndFunctionApmMetricStatName"]
42+
ERROR_RATE: ClassVar["FormulaAndFunctionApmMetricStatName"]
43+
ERRORS_PER_SECOND: ClassVar["FormulaAndFunctionApmMetricStatName"]
44+
LATENCY_AVG: ClassVar["FormulaAndFunctionApmMetricStatName"]
45+
LATENCY_MAX: ClassVar["FormulaAndFunctionApmMetricStatName"]
46+
LATENCY_P50: ClassVar["FormulaAndFunctionApmMetricStatName"]
47+
LATENCY_P75: ClassVar["FormulaAndFunctionApmMetricStatName"]
48+
LATENCY_P90: ClassVar["FormulaAndFunctionApmMetricStatName"]
49+
LATENCY_P95: ClassVar["FormulaAndFunctionApmMetricStatName"]
50+
LATENCY_P99: ClassVar["FormulaAndFunctionApmMetricStatName"]
51+
LATENCY_P999: ClassVar["FormulaAndFunctionApmMetricStatName"]
52+
LATENCY_DISTRIBUTION: ClassVar["FormulaAndFunctionApmMetricStatName"]
53+
HITS: ClassVar["FormulaAndFunctionApmMetricStatName"]
54+
HITS_PER_SECOND: ClassVar["FormulaAndFunctionApmMetricStatName"]
55+
TOTAL_TIME: ClassVar["FormulaAndFunctionApmMetricStatName"]
56+
APDEX: ClassVar["FormulaAndFunctionApmMetricStatName"]
57+
58+
@cached_property
59+
def openapi_types(_):
60+
return {
61+
"value": (str,),
62+
}
63+
64+
65+
FormulaAndFunctionApmMetricStatName.ERRORS = FormulaAndFunctionApmMetricStatName("errors")
66+
FormulaAndFunctionApmMetricStatName.ERROR_RATE = FormulaAndFunctionApmMetricStatName("error_rate")
67+
FormulaAndFunctionApmMetricStatName.ERRORS_PER_SECOND = FormulaAndFunctionApmMetricStatName("errors_per_second")
68+
FormulaAndFunctionApmMetricStatName.LATENCY_AVG = FormulaAndFunctionApmMetricStatName("latency_avg")
69+
FormulaAndFunctionApmMetricStatName.LATENCY_MAX = FormulaAndFunctionApmMetricStatName("latency_max")
70+
FormulaAndFunctionApmMetricStatName.LATENCY_P50 = FormulaAndFunctionApmMetricStatName("latency_p50")
71+
FormulaAndFunctionApmMetricStatName.LATENCY_P75 = FormulaAndFunctionApmMetricStatName("latency_p75")
72+
FormulaAndFunctionApmMetricStatName.LATENCY_P90 = FormulaAndFunctionApmMetricStatName("latency_p90")
73+
FormulaAndFunctionApmMetricStatName.LATENCY_P95 = FormulaAndFunctionApmMetricStatName("latency_p95")
74+
FormulaAndFunctionApmMetricStatName.LATENCY_P99 = FormulaAndFunctionApmMetricStatName("latency_p99")
75+
FormulaAndFunctionApmMetricStatName.LATENCY_P999 = FormulaAndFunctionApmMetricStatName("latency_p999")
76+
FormulaAndFunctionApmMetricStatName.LATENCY_DISTRIBUTION = FormulaAndFunctionApmMetricStatName("latency_distribution")
77+
FormulaAndFunctionApmMetricStatName.HITS = FormulaAndFunctionApmMetricStatName("hits")
78+
FormulaAndFunctionApmMetricStatName.HITS_PER_SECOND = FormulaAndFunctionApmMetricStatName("hits_per_second")
79+
FormulaAndFunctionApmMetricStatName.TOTAL_TIME = FormulaAndFunctionApmMetricStatName("total_time")
80+
FormulaAndFunctionApmMetricStatName.APDEX = FormulaAndFunctionApmMetricStatName("apdex")

0 commit comments

Comments
 (0)