Skip to content

Commit 656ed34

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 7253915 of spec repo
1 parent 1227b58 commit 656ed34

12 files changed

Lines changed: 566 additions & 0 deletions

File tree

.generator/schemas/v1/openapi.yaml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2648,6 +2648,123 @@ components:
26482648
- service
26492649
- name
26502650
type: object
2651+
FormulaAndFunctionApmMetricStatName:
2652+
description: APM metric stat name.
2653+
enum:
2654+
- errors
2655+
- error_rate
2656+
- errors_per_second
2657+
- latency_avg
2658+
- latency_max
2659+
- latency_p50
2660+
- latency_p75
2661+
- latency_p90
2662+
- latency_p95
2663+
- latency_p99
2664+
- latency_p999
2665+
- latency_distribution
2666+
- hits
2667+
- hits_per_second
2668+
- total_time
2669+
- apdex
2670+
example: "hits"
2671+
type: string
2672+
x-enum-varnames:
2673+
- ERRORS
2674+
- ERROR_RATE
2675+
- ERRORS_PER_SECOND
2676+
- LATENCY_AVG
2677+
- LATENCY_MAX
2678+
- LATENCY_P50
2679+
- LATENCY_P75
2680+
- LATENCY_P90
2681+
- LATENCY_P95
2682+
- LATENCY_P99
2683+
- LATENCY_P999
2684+
- LATENCY_DISTRIBUTION
2685+
- HITS
2686+
- HITS_PER_SECOND
2687+
- TOTAL_TIME
2688+
- APDEX
2689+
FormulaAndFunctionApmMetricsDataSource:
2690+
description: Data source for APM metrics queries.
2691+
enum:
2692+
- apm_metrics
2693+
example: apm_metrics
2694+
type: string
2695+
x-enum-varnames:
2696+
- APM_METRICS
2697+
FormulaAndFunctionApmMetricsQueryDefinition:
2698+
description: A formula and functions APM metrics query.
2699+
properties:
2700+
data_source:
2701+
$ref: "#/components/schemas/FormulaAndFunctionApmMetricsDataSource"
2702+
group_by:
2703+
description: Optional fields to group the query results by.
2704+
items:
2705+
description: A field to group results by.
2706+
example: "resource_name"
2707+
type: string
2708+
type: array
2709+
name:
2710+
description: Name of this query to use in formulas.
2711+
example: "query_errors"
2712+
type: string
2713+
operation_mode:
2714+
description: Optional operation mode to aggregate across operation names.
2715+
example: "primary"
2716+
type: string
2717+
operation_name:
2718+
description: Name of operation on service. If not provided, the primary operation name is used.
2719+
example: "web.request"
2720+
type: string
2721+
peer_tags:
2722+
description: Tags to query for a specific downstream entity (peer.service, peer.db_instance, peer.s3, peer.s3.bucket, etc.).
2723+
items:
2724+
example: "peer.service:my-service"
2725+
type: string
2726+
type: array
2727+
query_filter:
2728+
description: Additional filters for the query using metrics query syntax (e.g., env, primary_tag).
2729+
example: "env:prod"
2730+
type: string
2731+
resource_hash:
2732+
description: The hash of a specific resource to filter by.
2733+
example: "abc123"
2734+
type: string
2735+
resource_name:
2736+
description: The full name of a specific resource to filter by.
2737+
example: "GET /api/v1/users"
2738+
type: string
2739+
service:
2740+
description: APM service name.
2741+
example: "web-store"
2742+
type: string
2743+
span_kind:
2744+
$ref: "#/components/schemas/FormulaAndFunctionApmMetricsSpanKind"
2745+
stat:
2746+
$ref: "#/components/schemas/FormulaAndFunctionApmMetricStatName"
2747+
required:
2748+
- data_source
2749+
- name
2750+
- stat
2751+
type: object
2752+
FormulaAndFunctionApmMetricsSpanKind:
2753+
description: Describes the relationship between the span, its parents, and its children in a trace.
2754+
enum:
2755+
- consumer
2756+
- server
2757+
- client
2758+
- producer
2759+
- internal
2760+
example: "server"
2761+
type: string
2762+
x-enum-varnames:
2763+
- CONSUMER
2764+
- SERVER
2765+
- CLIENT
2766+
- PRODUCER
2767+
- INTERNAL
26512768
FormulaAndFunctionApmResourceStatName:
26522769
description: APM resource stat name.
26532770
enum:
@@ -3077,6 +3194,7 @@ components:
30773194
- $ref: "#/components/schemas/FormulaAndFunctionProcessQueryDefinition"
30783195
- $ref: "#/components/schemas/FormulaAndFunctionApmDependencyStatsQueryDefinition"
30793196
- $ref: "#/components/schemas/FormulaAndFunctionApmResourceStatsQueryDefinition"
3197+
- $ref: "#/components/schemas/FormulaAndFunctionApmMetricsQueryDefinition"
30803198
- $ref: "#/components/schemas/FormulaAndFunctionSLOQueryDefinition"
30813199
- $ref: "#/components/schemas/FormulaAndFunctionCloudCostQueryDefinition"
30823200
FormulaAndFunctionResponseFormat:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2025-02-20T10:00:00.000Z"
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
{
2+
"log": {
3+
"_recordingName": "Dashboards/Create a new dashboard with apm metrics widget",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "1cfcf5ccd2e7dff3d4f3b05c53d79057",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 433,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"_fromType": "array",
20+
"name": "accept",
21+
"value": "application/json"
22+
},
23+
{
24+
"_fromType": "array",
25+
"name": "content-type",
26+
"value": "application/json"
27+
}
28+
],
29+
"headersSize": 560,
30+
"httpVersion": "HTTP/1.1",
31+
"method": "POST",
32+
"postData": {
33+
"mimeType": "application/json",
34+
"params": [],
35+
"text": "{\"layout_type\":\"ordered\",\"title\":\"Test-Create_a_new_dashboard_with_apm_metrics_widget-1740045600\",\"widgets\":[{\"definition\":{\"requests\":[{\"queries\":[{\"data_source\":\"apm_metrics\",\"group_by\":[\"resource_name\"],\"name\":\"query1\",\"query_filter\":\"env:prod\",\"service\":\"web-store\",\"stat\":\"hits\"}],\"response_format\":\"scalar\"}],\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"query_table\"},\"layout\":{\"height\":4,\"width\":4,\"x\":0,\"y\":0}}]}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v1/dashboard"
39+
},
40+
"response": {
41+
"bodySize": 819,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 819,
45+
"text": "{\"id\":\"apm-met-ric\",\"title\":\"Test-Create_a_new_dashboard_with_apm_metrics_widget-1740045600\",\"description\":null,\"author_handle\":\"test@datadoghq.com\",\"author_name\":null,\"layout_type\":\"ordered\",\"url\":\"/dashboard/apm-met-ric/testcreateanewdashboardwithapmmetricswidget1740045600\",\"is_read_only\":false,\"template_variables\":null,\"widgets\":[{\"definition\":{\"requests\":[{\"queries\":[{\"data_source\":\"apm_metrics\",\"group_by\":[\"resource_name\"],\"name\":\"query1\",\"query_filter\":\"env:prod\",\"service\":\"web-store\",\"stat\":\"hits\"}],\"response_format\":\"scalar\"}],\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"query_table\"},\"layout\":{\"height\":4,\"width\":4,\"x\":0,\"y\":0},\"id\":1234567890123456}],\"notify_list\":null,\"created_at\":\"2025-02-20T10:00:01.000000+00:00\",\"modified_at\":\"2025-02-20T10:00:01.000000+00:00\",\"restricted_roles\":[]}"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 381,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 200,
58+
"statusText": "OK"
59+
},
60+
"startedDateTime": "2025-02-20T10:00:00.015Z",
61+
"time": 430
62+
},
63+
{
64+
"_id": "71162de52581d0f391d949ff27e2aac0",
65+
"_order": 0,
66+
"cache": {},
67+
"request": {
68+
"bodySize": 0,
69+
"cookies": [],
70+
"headers": [
71+
{
72+
"_fromType": "array",
73+
"name": "accept",
74+
"value": "application/json"
75+
}
76+
],
77+
"headersSize": 520,
78+
"httpVersion": "HTTP/1.1",
79+
"method": "DELETE",
80+
"queryString": [],
81+
"url": "https://api.datadoghq.com/api/v1/dashboard/apm-met-ric"
82+
},
83+
"response": {
84+
"bodySize": 38,
85+
"content": {
86+
"mimeType": "application/json",
87+
"size": 38,
88+
"text": "{\"deleted_dashboard_id\":\"apm-met-ric\"}"
89+
},
90+
"cookies": [],
91+
"headers": [
92+
{
93+
"name": "content-type",
94+
"value": "application/json"
95+
}
96+
],
97+
"headersSize": 379,
98+
"httpVersion": "HTTP/1.1",
99+
"redirectURL": "",
100+
"status": 200,
101+
"statusText": "OK"
102+
},
103+
"startedDateTime": "2025-02-20T10:00:00.460Z",
104+
"time": 380
105+
}
106+
],
107+
"pages": [],
108+
"version": "1.2"
109+
}
110+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/**
2+
* Create a new dashboard with apm metrics widget
3+
*/
4+
5+
import { client, v1 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v1.DashboardsApi(configuration);
9+
10+
const params: v1.DashboardsApiCreateDashboardRequest = {
11+
body: {
12+
title: "Example-Dashboard",
13+
widgets: [
14+
{
15+
definition: {
16+
title: "",
17+
titleSize: "16",
18+
titleAlign: "left",
19+
type: "query_table",
20+
requests: [
21+
{
22+
responseFormat: "scalar",
23+
queries: [
24+
{
25+
stat: "hits",
26+
name: "query1",
27+
service: "web-store",
28+
dataSource: "apm_metrics",
29+
queryFilter: "env:prod",
30+
groupBy: ["resource_name"],
31+
},
32+
],
33+
},
34+
],
35+
},
36+
layout: {
37+
x: 0,
38+
y: 0,
39+
width: 4,
40+
height: 4,
41+
},
42+
},
43+
],
44+
layoutType: "ordered",
45+
},
46+
};
47+
48+
apiInstance
49+
.createDashboard(params)
50+
.then((data: v1.Dashboard) => {
51+
console.log(
52+
"API called successfully. Returned data: " + JSON.stringify(data)
53+
);
54+
})
55+
.catch((error: any) => console.error(error));

features/v1/dashboards.feature

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,20 @@ Feature: Dashboards
320320
And the response "widgets[0].definition.requests[0].queries[0].primary_tag_name" is equal to "datacenter"
321321
And the response "widgets[0].definition.requests[0].queries[0].operation_name" is equal to "cassandra.query"
322322

323+
@team:DataDog/dashboards-backend
324+
Scenario: Create a new dashboard with apm metrics widget
325+
Given new "CreateDashboard" request
326+
And body with value { "title": "{{ unique }}", "widgets": [{"definition": { "title": "", "title_size": "16", "title_align": "left", "type": "query_table", "requests": [ { "response_format": "scalar", "queries": [ { "stat": "hits", "name": "query1", "service": "web-store", "data_source": "apm_metrics", "query_filter": "env:prod", "group_by": ["resource_name"] } ] } ] }, "layout": { "x": 0, "y": 0, "width": 4, "height": 4 } } ], "layout_type": "ordered" }
327+
When the request is sent
328+
Then the response status is 200 OK
329+
And the response "widgets[0].definition.requests[0].response_format" is equal to "scalar"
330+
And the response "widgets[0].definition.requests[0].queries[0].stat" is equal to "hits"
331+
And the response "widgets[0].definition.requests[0].queries[0].group_by[0]" is equal to "resource_name"
332+
And the response "widgets[0].definition.requests[0].queries[0].name" is equal to "query1"
333+
And the response "widgets[0].definition.requests[0].queries[0].service" is equal to "web-store"
334+
And the response "widgets[0].definition.requests[0].queries[0].data_source" is equal to "apm_metrics"
335+
And the response "widgets[0].definition.requests[0].queries[0].query_filter" is equal to "env:prod"
336+
323337
@team:DataDog/dashboards-backend
324338
Scenario: Create a new dashboard with apm resource stats widget
325339
Given new "CreateDashboard" request

packages/datadog-api-client-v1/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,10 @@ export { EventTimelineWidgetDefinitionType } from "./models/EventTimelineWidgetD
453453
export { FormulaAndFunctionApmDependencyStatName } from "./models/FormulaAndFunctionApmDependencyStatName";
454454
export { FormulaAndFunctionApmDependencyStatsDataSource } from "./models/FormulaAndFunctionApmDependencyStatsDataSource";
455455
export { FormulaAndFunctionApmDependencyStatsQueryDefinition } from "./models/FormulaAndFunctionApmDependencyStatsQueryDefinition";
456+
export { FormulaAndFunctionApmMetricsDataSource } from "./models/FormulaAndFunctionApmMetricsDataSource";
457+
export { FormulaAndFunctionApmMetricsQueryDefinition } from "./models/FormulaAndFunctionApmMetricsQueryDefinition";
458+
export { FormulaAndFunctionApmMetricsSpanKind } from "./models/FormulaAndFunctionApmMetricsSpanKind";
459+
export { FormulaAndFunctionApmMetricStatName } from "./models/FormulaAndFunctionApmMetricStatName";
456460
export { FormulaAndFunctionApmResourceStatName } from "./models/FormulaAndFunctionApmResourceStatName";
457461
export { FormulaAndFunctionApmResourceStatsDataSource } from "./models/FormulaAndFunctionApmResourceStatsDataSource";
458462
export { FormulaAndFunctionApmResourceStatsQueryDefinition } from "./models/FormulaAndFunctionApmResourceStatsQueryDefinition";
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/**
2+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
* Copyright 2020-Present Datadog, Inc.
5+
*/
6+
7+
import { UnparsedObject } from "../../datadog-api-client-common/util";
8+
9+
/**
10+
* APM metric stat name.
11+
*/
12+
13+
export type FormulaAndFunctionApmMetricStatName =
14+
| typeof ERRORS
15+
| typeof ERROR_RATE
16+
| typeof ERRORS_PER_SECOND
17+
| typeof LATENCY_AVG
18+
| typeof LATENCY_MAX
19+
| typeof LATENCY_P50
20+
| typeof LATENCY_P75
21+
| typeof LATENCY_P90
22+
| typeof LATENCY_P95
23+
| typeof LATENCY_P99
24+
| typeof LATENCY_P999
25+
| typeof LATENCY_DISTRIBUTION
26+
| typeof HITS
27+
| typeof HITS_PER_SECOND
28+
| typeof TOTAL_TIME
29+
| typeof APDEX
30+
| UnparsedObject;
31+
export const ERRORS = "errors";
32+
export const ERROR_RATE = "error_rate";
33+
export const ERRORS_PER_SECOND = "errors_per_second";
34+
export const LATENCY_AVG = "latency_avg";
35+
export const LATENCY_MAX = "latency_max";
36+
export const LATENCY_P50 = "latency_p50";
37+
export const LATENCY_P75 = "latency_p75";
38+
export const LATENCY_P90 = "latency_p90";
39+
export const LATENCY_P95 = "latency_p95";
40+
export const LATENCY_P99 = "latency_p99";
41+
export const LATENCY_P999 = "latency_p999";
42+
export const LATENCY_DISTRIBUTION = "latency_distribution";
43+
export const HITS = "hits";
44+
export const HITS_PER_SECOND = "hits_per_second";
45+
export const TOTAL_TIME = "total_time";
46+
export const APDEX = "apdex";
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
* Copyright 2020-Present Datadog, Inc.
5+
*/
6+
7+
import { UnparsedObject } from "../../datadog-api-client-common/util";
8+
9+
/**
10+
* Data source for APM metrics queries.
11+
*/
12+
13+
export type FormulaAndFunctionApmMetricsDataSource =
14+
| typeof APM_METRICS
15+
| UnparsedObject;
16+
export const APM_METRICS = "apm_metrics";

0 commit comments

Comments
 (0)