Skip to content

Commit 500e808

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
and
ci.datadog-api-spec
authored
Add trace_stream to dashboard ListStreamSource (#1282)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 256598a commit 500e808

File tree

8 files changed

+179
-4
lines changed

8 files changed

+179
-4
lines changed

.apigentools-info

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.5",
7-
"regenerated": "2023-08-23 18:27:41.461663",
8-
"spec_repo_commit": "d78a6960"
7+
"regenerated": "2023-08-23 20:02:10.805710",
8+
"spec_repo_commit": "7e4a4121"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.5",
12-
"regenerated": "2023-08-23 18:27:41.479485",
13-
"spec_repo_commit": "d78a6960"
12+
"regenerated": "2023-08-23 20:02:10.823663",
13+
"spec_repo_commit": "7e4a4121"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -4414,6 +4414,7 @@ components:
44144414
- ci_test_stream
44154415
- rum_issue_stream
44164416
- apm_issue_stream
4417+
- trace_stream
44174418
- logs_issue_stream
44184419
- logs_pattern_stream
44194420
- logs_transaction_stream
@@ -4427,6 +4428,7 @@ components:
44274428
- CI_TEST_STREAM
44284429
- RUM_ISSUE_STREAM
44294430
- APM_ISSUE_STREAM
4431+
- TRACE_STREAM
44304432
- LOGS_ISSUE_STREAM
44314433
- LOGS_PATTERN_STREAM
44324434
- LOGS_TRANSACTION_STREAM
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2022-04-11T09:33:06.223Z"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
{
2+
"log": {
3+
"_recordingName": "Dashboards/Create a new dashboard with trace_stream widget",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.4"
8+
},
9+
"entries": [
10+
{
11+
"_id": "9f2c1d36ab2a75b29654c3c774f4394a",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 360,
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": 558,
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_trace_stream_widget-1649669586 with list_stream widget\",\"widgets\":[{\"definition\":{\"requests\":[{\"columns\":[{\"field\":\"timestamp\",\"width\":\"auto\"},{\"field\":\"service\",\"width\":\"auto\"}],\"query\":{\"data_source\":\"trace_stream\",\"query_string\":\"\"},\"response_format\":\"event_list\"}],\"type\":\"list_stream\"}}]}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v1/dashboard"
39+
},
40+
"response": {
41+
"bodySize": 772,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 772,
45+
"text": "{\"notify_list\":null,\"description\":null,\"restricted_roles\":[],\"author_name\":null,\"template_variables\":null,\"is_read_only\":false,\"id\":\"hq5-hih-hbv\",\"title\":\"Test-Create_a_new_dashboard_with_trace_stream_widget-1649669586 with list_stream widget\",\"url\":\"/dashboard/hq5-hih-hbv/test-createanewdashboardwithtracestreamwidget-1649669586-with-liststream-widget\",\"created_at\":\"2022-04-11T09:33:06.331374+00:00\",\"modified_at\":\"2022-04-11T09:33:06.331374+00:00\",\"author_handle\":\"frog@datadoghq.com\",\"widgets\":[{\"definition\":{\"requests\":[{\"query\":{\"query_string\":\"\",\"data_source\":\"trace_stream\"},\"response_format\":\"event_list\",\"columns\":[{\"field\":\"timestamp\",\"width\":\"auto\"},{\"field\":\"service\",\"width\":\"auto\"}]}],\"type\":\"list_stream\"},\"id\":6190567117163115}],\"layout_type\":\"ordered\"}"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 636,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 200,
58+
"statusText": "OK"
59+
},
60+
"startedDateTime": "2022-04-11T09:33:06.241Z",
61+
"time": 135
62+
},
63+
{
64+
"_id": "ba5e3fb6f561a9be211c115290abdfc4",
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": 519,
78+
"httpVersion": "HTTP/1.1",
79+
"method": "DELETE",
80+
"queryString": [],
81+
"url": "https://api.datadoghq.com/api/v1/dashboard/hq5-hih-hbv"
82+
},
83+
"response": {
84+
"bodySize": 38,
85+
"content": {
86+
"mimeType": "application/json",
87+
"size": 38,
88+
"text": "{\"deleted_dashboard_id\":\"hq5-hih-hbv\"}"
89+
},
90+
"cookies": [],
91+
"headers": [
92+
{
93+
"name": "content-type",
94+
"value": "application/json"
95+
}
96+
],
97+
"headersSize": 635,
98+
"httpVersion": "HTTP/1.1",
99+
"redirectURL": "",
100+
"status": 200,
101+
"statusText": "OK"
102+
},
103+
"startedDateTime": "2022-04-11T09:33:06.386Z",
104+
"time": 152
105+
}
106+
],
107+
"pages": [],
108+
"version": "1.2"
109+
}
110+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/**
2+
* Create a new dashboard with trace_stream 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+
layoutType: "ordered",
13+
title: "Example-Dashboard with list_stream widget",
14+
widgets: [
15+
{
16+
definition: {
17+
type: "list_stream",
18+
requests: [
19+
{
20+
columns: [
21+
{
22+
width: "auto",
23+
field: "timestamp",
24+
},
25+
{
26+
width: "auto",
27+
field: "service",
28+
},
29+
],
30+
query: {
31+
dataSource: "trace_stream",
32+
queryString: "",
33+
},
34+
responseFormat: "event_list",
35+
},
36+
],
37+
},
38+
},
39+
],
40+
},
41+
};
42+
43+
apiInstance
44+
.createDashboard(params)
45+
.then((data: v1.Dashboard) => {
46+
console.log(
47+
"API called successfully. Returned data: " + JSON.stringify(data)
48+
);
49+
})
50+
.catch((error: any) => console.error(error));

features/v1/dashboards.feature

+9
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,15 @@ Feature: Dashboards
731731
And the response "widgets[0].definition.type" is equal to "trace_service"
732732
And the response "widgets[0].definition.env" is equal to "none"
733733

734+
@team:DataDog/dashboards-backend
735+
Scenario: Create a new dashboard with trace_stream widget
736+
Given new "CreateDashboard" request
737+
And body with value {"layout_type": "ordered", "title": "{{ unique }} with list_stream widget","widgets": [{"definition": {"type": "list_stream","requests": [{"columns":[{"width":"auto","field":"timestamp"},{"width":"auto","field":"service"}],"query":{"data_source":"trace_stream","query_string":""},"response_format":"event_list"}]}}]}
738+
When the request is sent
739+
Then the response status is 200 OK
740+
And the response "widgets[0].definition.type" is equal to "list_stream"
741+
And the response "widgets[0].definition.requests[0].query.data_source" is equal to "trace_stream"
742+
734743
@team:DataDog/dashboards-backend
735744
Scenario: Create a new timeseries widget with ci_pipelines data source
736745
Given new "CreateDashboard" request

packages/datadog-api-client-v1/models/ListStreamSource.ts

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export type ListStreamSource =
1717
| typeof CI_TEST_STREAM
1818
| typeof RUM_ISSUE_STREAM
1919
| typeof APM_ISSUE_STREAM
20+
| typeof TRACE_STREAM
2021
| typeof LOGS_ISSUE_STREAM
2122
| typeof LOGS_PATTERN_STREAM
2223
| typeof LOGS_TRANSACTION_STREAM
@@ -28,6 +29,7 @@ export const CI_PIPELINE_STREAM = "ci_pipeline_stream";
2829
export const CI_TEST_STREAM = "ci_test_stream";
2930
export const RUM_ISSUE_STREAM = "rum_issue_stream";
3031
export const APM_ISSUE_STREAM = "apm_issue_stream";
32+
export const TRACE_STREAM = "trace_stream";
3133
export const LOGS_ISSUE_STREAM = "logs_issue_stream";
3234
export const LOGS_PATTERN_STREAM = "logs_pattern_stream";
3335
export const LOGS_TRANSACTION_STREAM = "logs_transaction_stream";

packages/datadog-api-client-v1/models/ObjectSerializer.ts

+1
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,7 @@ const enumsMap: { [key: string]: any[] } = {
796796
"ci_test_stream",
797797
"rum_issue_stream",
798798
"apm_issue_stream",
799+
"trace_stream",
799800
"logs_issue_stream",
800801
"logs_pattern_stream",
801802
"logs_transaction_stream",

0 commit comments

Comments
 (0)